【问题标题】:Creating private gke cluster创建私有 gke 集群
【发布时间】:2020-01-30 22:59:06
【问题描述】:

使用 yaml 创建私有 gke 集群。

目前正在考虑创建一个私有 gke。尝试在 yaml 文件中添加私有设置但出现错误

resources:
- name: myclus
  type: gcp-types/container-v1:projects.locations.clusters
  properties:
    parent: projects/[PROJECT_ID]/locations/[REGION]
    cluster:
      name: my-clus
      zone: [ZONE]
      network: [NETWORK]
      subnetwork: [SUBNETWORK]    ### leave this field blank if using the default network###
      initialClusterVersion: "1.13"
      nodePools:
      - name: my-clus-pool1
        initialNodeCount: 1
        autoscaling:
          enabled: true
          minNodeCount: 1
          maxNodeCount: 12
        management:
          autoUpgrade: true
          autoRepair: true  
        config:
          machineType: n1-standard-1
          diskSizeGb: 15
          imageType: cos
          diskType: pd-ssd
          oauthScopes:             ###Change scope to match needs###
            - https://www.googleapis.com/auth/cloud-platform
          preemptible: false

寻找它来创建一个没有外部 IP 的私有集群。

【问题讨论】:

  • 上述 yaml 文件有效,但它也为 gke 集群分配了外部 IP。

标签: yaml cluster-computing google-kubernetes-engine google-deployment-manager


【解决方案1】:

您有没有机会仔细阅读此文档?

https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#public_master

好吧,我还发现了另一个可以帮助您实现所需的 Google 官方文档:

https://cloud.google.com/solutions/creating-kubernetes-engine-private-clusters-with-net-proxies

在“创建 Docker 映像”部分有一个 Dockerfile 示例。

祝你好运!

【讨论】:

  • 感谢您的链接。我确实看过那些。我想出了在 yaml 部署文件中添加什么以及如何添加它。如果有人感兴趣,下面是 yaml 的实际代码。 ``` privateClusterConfig: enablePrivateNodes: true masterIpv4CidrBlock: 10.81.219.0/28 ``
猜你喜欢
  • 2019-12-24
  • 2021-08-12
  • 1970-01-01
  • 1970-01-01
  • 2019-08-10
  • 2019-04-05
  • 2020-04-15
  • 1970-01-01
  • 2020-03-19
相关资源
最近更新 更多