Yes, it is. To attach an autoscaler to your existing GKE cluster:
Find the name of your cluster's instance group:
$ gcloud compute instance-groups managed list
NAME ZONE BASE_INSTANCE_NAME SIZE TARGET_SIZE INSTANCE_TEMPLATE AUTOSCALED
gke-buildlets-69898e2d-group us-central1-f gke-buildlets-69898e2d-node 1 1 gke-buildlets-69898e2d-1-1-3 yes
Here I have a GKE cluster named buildlets, and its instance group is named gke-buildlets-6989e2d-group
Enable autoscaling. This particular example will scale on a target CPU utilization of 70%:
gcloud compute instance-groups managed set-autoscaling YOUR_INSTANCE_GROUP_NAME \
--zone=YOUR_INSTANCE_GROUP_ZONE \
--min-num-replicas=1 \
--max-num-replicas=8 \
--scale-based-on-cpu \
--target-cpu-utilization=.7
You can also use Google Cloud Deployment manager to create your GKE cluster, and create/attach an autoscaler right along with it:
resources:
- name: buildlets
type: container.v1.cluster
properties:
zone: us-central1-f
cluster:
initial_node_count: 1
network: "default"
logging_service: "logging.googleapis.com"
monitoring_service: "monitoring.googleapis.com"
node_config:
machine_type: n1-standard-1
oauth_scopes:
- "https://www.googleapis.com/auth/cloud-platform"
master_auth:
username: admin
password: password123
- name: autoscaler
type: compute.v1.autoscaler
properties:
zone: us-central1-f
name: buildlets
target: "$(ref.buildlets.instanceGroupUrls[0])"
autoscalingPolicy:
minNumReplicas: 2
maxNumReplicas: 8
coolDownPeriodSec: 600
cpuUtilization:
utilizationTarget: .7`