Skip to content

Instantly share code, notes, and snippets.

@kwyn
Last active January 15, 2019 21:13
Show Gist options
  • Save kwyn/54b03961432fe3af478f802cf114af87 to your computer and use it in GitHub Desktop.
Save kwyn/54b03961432fe3af478f802cf114af87 to your computer and use it in GitHub Desktop.
Regional Autoscaling for GKE using Google Deployment Manager
resources:
- name: provision-test
# type: container.v1beta1.cluster
type: gcp-types/container-v1beta1:projects.locations.clusters
properties:
# Region that the cluster will be deployed to
parent: 'projects/kwyn-testbed/locations/us-west1'
cluster:
loggingService: logging.googleapis.com
initialClusterVersion: "1.11.5-gke.5"
currentMasterVersion: "1.11.5-gke.5"
nodePools:
- name: "provision-test-np-1"
# auto-upgrade node images and auto repair bad nodes
management:
autoUpgrade: true
autoRepair: true
# Autoscaling enabled for the given node pool
autoscaling:
enabled: true
minNodeCount: 1
maxNodeCount: 100
# Initial Node Count of 2 will result in a 6 node cluster initially for us-west1
# since there's 3 AZs in use-west1 that means 2 nodes per AZ = 6 nodes
initialNodeCount: 2
version: "1.11.5-gke.5"
config:
machineType: "n1-standard-2"
# Oath scopes avaiable to the nodes. Logging and monitoring are always needed since we plan to use all google logging capabilities.
oauthScopes:
- https://www.googleapis.com/auth/logging.write
- https://www.googleapis.com/auth/monitoring
# Preemptable means that google can oust our process from the machine in these node pools.
# We should have a hard minimum of 2 machines at a time of we keep this true in prod.
# It's cheaper for testing purposes though.
preemptible: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment