Creating private gke cluster

10/1/2019

Creating private gke cluster with yaml.

Currently looking into creating a private gke. tried adding private settings in yaml file but getting error

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

Looking for it to create a private cluster with no external IPs.

-- k2swat
cluster-computing
google-deployment-manager
google-kubernetes-engine
yaml

1 Answer

10/8/2019

Did you ever had the chance to go over this documentation?

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

Well, I also found this other Official Google Document that can help you achieve what you want:

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

On the "Creating the Docker Image" section there's a Dockerfile example.

Best of Luck!

-- Carlo C.
Source: StackOverflow