diff --git a/examples/v2/gke/README.md b/examples/v2/gke/README.md index aa2ad844e..e2601a13c 100644 --- a/examples/v2/gke/README.md +++ b/examples/v2/gke/README.md @@ -18,9 +18,11 @@ When ready, deploy with the following command: NAME="your-name" ZONE="your-zone" + CLUSTER_VERSION="your-cluster-version" + MACHINE_TYPE="your-machine-type" gcloud deployment-manager deployments create ${NAME} \ --template cluster.py \ - --properties zone:${ZONE} + --properties zone:${ZONE},clusterVersion:${CLUSTER_VERSION},machineType:${MACHINE_TYPE} This will result in two resources: diff --git a/examples/v2/gke/python/cluster.py b/examples/v2/gke/python/cluster.py index 1e61b0364..b12849508 100644 --- a/examples/v2/gke/python/cluster.py +++ b/examples/v2/gke/python/cluster.py @@ -36,8 +36,10 @@ def GenerateConfig(context): 'zone': context.properties['zone'], 'cluster': { 'name': cluster_name, + 'initialClusterVersion': context.properties['clusterVersion'], 'initialNodeCount': context.properties['initialNodeCount'], 'nodeConfig': { + 'machineType': context.properties['machineType'], 'oauthScopes': [ 'https://www.googleapis.com/auth/' + s for s in [ diff --git a/examples/v2/gke/python/cluster.py.schema b/examples/v2/gke/python/cluster.py.schema index 2592e5757..9ea87b33b 100644 --- a/examples/v2/gke/python/cluster.py.schema +++ b/examples/v2/gke/python/cluster.py.schema @@ -28,6 +28,12 @@ properties: zone: type: string description: Zone in which the cluster should run. + clusterVersion: + type: string + description: The initial Kubernetes version for this cluster. + machineType: + type: string + description: A set of virtualized hardware resources available to VM instance. initialNodeCount: type: integer description: Initial number of nodes desired in the cluster. diff --git a/examples/v2/gke/python/cluster.yaml b/examples/v2/gke/python/cluster.yaml index e708f8e08..9bf67ec1b 100644 --- a/examples/v2/gke/python/cluster.yaml +++ b/examples/v2/gke/python/cluster.yaml @@ -20,4 +20,6 @@ resources: type: cluster.py properties: zone: ZONE_TO_RUN + clusterVersion: CLUSTER_VERSION + machineType: MACHINE_TYPE