<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tom Dickman on Medium]]></title>
        <description><![CDATA[Stories by Tom Dickman on Medium]]></description>
        <link>https://medium.com/@tdickman?source=rss-5e8d310f4581------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QqoYj7SjlLzJRhqcqUFYIQ.png</url>
            <title>Stories by Tom Dickman on Medium</title>
            <link>https://medium.com/@tdickman?source=rss-5e8d310f4581------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 15:59:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tdickman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Upgrade a Kubernetes Cluster With No Downtime]]></title>
            <link>https://engineering.ziffmedia.com/zero-downtime-kubernetes-cluster-upgrades-aab4cac943d2?source=rss-5e8d310f4581------2</link>
            <guid isPermaLink="false">https://medium.com/p/aab4cac943d2</guid>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Tom Dickman]]></dc:creator>
            <pubDate>Mon, 19 Sep 2016 23:57:45 GMT</pubDate>
            <atom:updated>2016-09-21T17:57:09.103Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*UQo3EjFtgzduk9piMXmsPg.png" /><figcaption>Kubernetes Logo</figcaption></figure><p>At RetailMeNot, teams traditionally use AWS services such as EC2 Container Service and Elastic Beanstalk, but as a member of the Labs group, we are tasked with rapidly prototyping and deploying apps. As such, we have been using <a href="https://cloud.google.com/container-engine/">Google Container Engine</a> (GKE), Google’s managed version of <a href="http://kubernetes.io/">Kubernetes</a>, as a low-overhead way of exploring Kubernetes.</p><p>Kubernetes operates on a <a href="https://github.com/kubernetes/features/blob/master/release-1.3/release-1.3.md">three-month-release cycle</a>, so recently we were planning to upgrade our clusters from version 1.2.x to 1.3.x. Thankfully, GKE provides a straightforward process for cluster upgrades, initiated via a few clicks in its web interface. Unfortunately, during our testing we observed some downtime during this process, but we were able to find a better way.</p><h3>GKE’s Default Upgrade Procedure</h3><p>A GKE cluster consists of a cluster master, which is managed and hosted by Google, and one or more cluster nodes. The cluster master is <a href="https://cloud.google.com/container-engine/docs/clusters/upgrade">automatically upgraded by Google</a> soon after a new version is released, while worker node upgrades have to manually be initiated.</p><p>The master is the control plane for Kubernetes, and it includes the Kubernetes API server, the scheduler, and the controller manager server. During the upgrade process, pods will continue to run, but new pods cannot be scheduled, and stopped pods will not restart.</p><p>The worker nodes consist of the kubelet that is in charge of managing pods, and their associated images, volumes, secrets, etc, and the kube-proxy that acts as a simple load balancer for services. During the upgrade process, Google takes each node down, and upgrades the kubelet version running on that node. This process continues without waiting for the upgraded node to return to the ready state, which can result in having:</p><ol><li>Too few nodes to run all scheduled pods</li><li>Not enough time to restart pods on neighboring nodes</li></ol><p>These two side effects create a risk that there’s no pod running in a <a href="http://kubernetes.io/docs/user-guide/replicasets/">replica set</a>, resulting in downtime for your services.</p><h3>A Better Way</h3><p>Fortunately, Kubernetes lets you run multiple kubelet versions on your cluster by setting up <a href="https://cloudplatform.googleblog.com/2016/05/introducing-Google-Container-Engine-GKE-node-pools.html">node pools</a>. We were able to setup a second node pool running the new version and then safely transition our pods. What follows is the process we used for upgrading our production cluster. Please note: You’ll need to install Google’s <a href="https://cloud.google.com/sdk/">Cloud SDK</a> to proceed.</p><p>First, switch to your project in Google Cloud.</p><pre>gcloud config set project {project_name}</pre><p>Next you need to create a new node pool. Note: You can do this via the Google Cloud web interface, but by default the new nodes will not have any <a href="https://developers.google.com/identity/protocols/googlescopes">permissions</a>. If you wish to give the new nodes permissions, you will need to run the following:</p><pre>gcloud container node-pools create {node_pool_name} --num-nodes {num_nodes} --machine-type {<a href="https://cloud.google.com/compute/pricing">machine_type</a>} --cluster {cluster_name} --scopes<a href="https://www.googleapis.com/auth/userinfo.email"> https://www.googleapis.com/auth/userinfo.email</a>,\<br><a href="https://www.googleapis.com/auth/compute">https://www.googleapis.com/auth/compute</a>,\<br><a href="https://www.googleapis.com/auth/devstorage.full_control">https://www.googleapis.com/auth/devstorage.full_control</a>,\<br><a href="https://www.googleapis.com/auth/taskqueue">https://www.googleapis.com/auth/taskqueue</a>,\<br><a href="https://www.googleapis.com/auth/bigquery">https://www.googleapis.com/auth/bigquery</a>,\<br><a href="https://www.googleapis.com/auth/sqlservice.admin">https://www.googleapis.com/auth/sqlservice.admin</a>,\<br><a href="https://www.googleapis.com/auth/datastore">https://www.googleapis.com/auth/datastore</a>,\<br><a href="https://www.googleapis.com/auth/logging.admin">https://www.googleapis.com/auth/logging.admin</a>,\<br><a href="https://www.googleapis.com/auth/monitoring">https://www.googleapis.com/auth/monitoring</a>,\<br><a href="https://www.googleapis.com/auth/cloud-platform">https://www.googleapis.com/auth/cloud-platform</a>,\<br><a href="https://www.googleapis.com/auth/bigtable.data">https://www.googleapis.com/auth/bigtable.data</a>,\<br><a href="https://www.googleapis.com/auth/bigtable.admin">https://www.googleapis.com/auth/bigtable.admin</a>,\<br><a href="https://www.googleapis.com/auth/pubsub">https://www.googleapis.com/auth/pubsub</a>,\<br><a href="https://www.googleapis.com/auth/servicecontrol">https://www.googleapis.com/auth/servicecontrol</a>,\<br><a href="https://www.googleapis.com/auth/service.management">https://www.googleapis.com/auth/service.management</a>,\<br><a href="https://www.googleapis.com/auth/logging.write">https://www.googleapis.com/auth/logging.write</a> \<br>--zone {<a href="https://cloud.google.com/compute/docs/regions-zones/regions-zones">zone</a>}</pre><p>Ensure that your new node pool is provisioned to handle all of the existing pods.</p><pre>gcloud config set container/cluster {cluster_name}</pre><p>Next, verify that your new nodes are running and are in the ‘ready’ state.</p><pre>gcloud container clusters get-credentials {cluster_name}<br>kubectl get nodes</pre><p>Mark the old nodes as unschedulable. This will force pods to only start on new, upgraded nodes, as you drain nodes in the next step.</p><pre>kubectl cordon {old_node_name}  # Repeat this command for each old node</pre><p>Begin draining nodes from your old node pool, one at a time, waiting until all pods have been scheduled on other nodes before proceeding. Daemonsets run on all nodes, so you will need to pass the ignore-daemonsets parameter if you are running any on your cluster.</p><pre>k drain {new_node_name} — ignore-daemonsets</pre><p>Once you have completed this process, you can safely delete your old node pool, and your cluster will be running on the new version.</p><pre>gcloud container node-pools delete {node_pool_name} — cluster {cluster_name}</pre><h3>Concluding Thoughts</h3><p>GKE provides a great way to run Kubernetes without having to worry about cluster management or spin up. In the future, we’d love to see GKE offer cluster upgrades with no downtime. There’s currently an <a href="https://github.com/kubernetes/kubernetes/issues/6080">open ticket</a> on GitHub to resolve this with the core Kubernetes project. In the meantime, creating a new node pool and manually draining old nodes is a reasonable workaround.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aab4cac943d2" width="1" height="1" alt=""><hr><p><a href="https://engineering.ziffmedia.com/zero-downtime-kubernetes-cluster-upgrades-aab4cac943d2">How to Upgrade a Kubernetes Cluster With No Downtime</a> was originally published in <a href="https://engineering.ziffmedia.com/">Ziff Media Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>