我们想要实现的是创建一个Google Cloud Platform
启用Cloud Run
插件的 Kubernetes 集群;然后使用自定义 helm chart 版本实例化集群,所有这些都通过Terraform
从 terraform 文档中,只展示了如何创建 kubernetes 集群,而不展示如何安装Cloud Run
.
resource "google_container_cluster" "primary" {
name = "my-gke-cluster"
location = "us-central1"
# We can't create a cluster with no node pool defined, but we want to only use
# separately managed node pools. So we create the smallest possible default
# node pool and immediately delete it.
remove_default_node_pool = true
initial_node_count = 1
}
resource "google_container_node_pool" "primary_preemptible_nodes" {
name = "my-node-pool"
location = "us-central1"
cluster = google_container_cluster.primary.name
node_count = 1
node_config {
preemptible = true
machine_type = "e2-medium"
# Google recommends custom service accounts that have cloud-platform scope and permissions granted via IAM Roles.
service_account = google_service_account.default.email
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
我们应该改变什么才能让 terraform 创建一个在主节点中安装了 Istio 和 KNative 的集群