yaml - 创建私有 gke 集群
问题描述
使用 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 的私有集群。
解决方案
你有没有机会翻阅这份文档?
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 示例。
祝你好运!