The cluster-ipv4-cidr option is required! Specifying it sets the IP address range for Pods inside the cluster. ※The subnet mask (the “/14” part of 10.0.0.0/14) must be specified between 9 and 19.
e.g.) The error when specifying –cluster-ipv4-cidr=10.0.0.0/8
1
ERROR: (gcloud.container.clusters.create) ResponseError: code=400, message=cluster.cluster_ipv4_cidr CIDR block size must be no bigger than /9 and no smaller than /19, found /8.
By using a ReplicationController, you can update with zero downtime.
You can actually observe it updating as follows:
For each currently Running container, start a container built from the updated image
Once the updated containers reach the Running state, delete the existing containers
1 2 3 4 5 6 7 8 9 10 11 12
// Commit the Docker Container updated locally macOS%$ docker commit 12f77feb09b4 gcr.io/hubot-167007/hubot:latest // Push to Google Container Registry macOS%$ gcloud docker -- push gcr.io/hubot-167007/hubot:latest
// Show Pods macOS%$ kubectl get pods NAME READY STATUS RESTARTS AGE deployment-hubot-cfe7528ee0b5059b14a30b942597e5ef-z8nws 1/1 Running 1 1d
// Rolling update based on the pushed Image macOS%$ kubectl rolling-update deployment-hubot-cfe7528ee0b5059b14a30b942597e5ef-z8nws --image=gcr.io/hubot-167007/hubot:latest
Cleanup
Delete the Deployment
1
macOS%$ kubectl delete -f gke-deployment.yml
Delete the LoadBalancer
1
macOS%$ kubectl delete -f gke-lb.yml
Overall Review
I configured the network firewall and launched the container, but it wouldn’t run — and I got pretty stuck on that part (; _) I happened to find someone who had raised a similar issue on Stack Overflow, and I used it as a reference. That was a lifesaver, phew.
Going forward, I’d like to try out and operate GKE + Kubernetes with common cases like Nginx + Rails. I’ll add more once I’ve put it together!