首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Terraform为Anthos云运行

用Terraform为Anthos云运行
EN

Stack Overflow用户
提问于 2021-12-30 16:40:50
回答 1查看 225关注 0票数 0

我们想要实现的是在Google Cloud Platform中创建一个Kubernetes集群,该集群启用了Cloud Run插件;然后使用自定义的头盔图表发布来实例化集群,所有这些都通过Terraform实现。

从terraform文档中,只显示了如何创建kubernetes集群,而没有说明如何安装Cloud Run

代码语言:javascript
复制
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的集群?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-31 12:18:38

您可以将配置块与cloudrun_config块一起使用:

代码语言:javascript
复制
addons_config {
  cloudrun_config {
    disabled = false
  }
}

或者,如果要为CloudRun使用内部负载均衡器,则

代码语言:javascript
复制
addons_config {
  cloudrun_config {
    disabled = false
    load_balancer_type=LOAD_BALANCER_TYPE_INTERNAL
  }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70534331

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档