From 8ade9bfc88396eb6d20e9899b827f794fa8bb2cc Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Fri, 11 Aug 2017 09:52:53 +0100 Subject: [PATCH 1/8] inits the kubeadm upgrade docs addresses kubernetes/kubernetes.github.io/issues/4689 --- .../administer-cluster/kubeadm-upgrade-cmd.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md diff --git a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md new file mode 100644 index 0000000000000..fdb1d278e0782 --- /dev/null +++ b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md @@ -0,0 +1,54 @@ +--- +approvers: +- pipejakob +title: Upgrading kubeadm clusters +--- + +{% capture overview %} + +This guide is for upgrading kubeadm clusters from version 1.7.x to 1.8.x. +See also [upgrading kubeadm clusters from 1.6 to 1.7](/docs/tasks/administer-cluster/kubeadm-upgrade-1-7/) if you're on a 1.6 cluster, currently. + +{% endcapture %} + +{% capture prerequisites %} +You need to have a Kubernetes cluster running version 1.7.x in order to use the process described here. Note that only one minor version upgrade is supported, that is, you can only upgrade from, say 1.7 to 1.8, not from 1.7 to 1.9. + +Before proceeding, make sure you read the [release notes](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#v180-alpha2) carefully. + +The following is out of scope for `kubeadm upgrade`, that is, you need to take care of it yourself: + +- No etcd upgrades are performed. You can, for example, use `etcdctl` to take care of this. +- Any app-level state, for example, a database an app might depend on (like MySQL or MongoDB) must be backed up beforehand. + + +Note that `kubeadm upgrade` is 'eventually idempotent', that is, you can run it over and over again if you find yourself in a bad state and it should be able to recover. + +{% endcapture %} + +{% capture steps %} + +## On the master + +1. Upgrade `kubectl` using [curl](/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl). Note: DO NOT use `apt` or `yum` or any other package manager to upgrade it. + +2. Install the most recent version of `kubeadm` using curl. + +3. On the master node, run `kubeadm upgrade plan`, which tells you what versions are available. + +4. Pick a version to upgrade to and run, for example, `kubeadm upgrade apply --version v1.7.3`. + +5. After `kubeadm upgrade` you need to manually upgrade your SDN. + + Your CNI provider might have its own upgrade instructions to follow now. + Check the [addons](/docs/concepts/cluster-administration/addons/) page to + find your CNI provider and see if there are additional upgrade steps + necessary. + +## Recovering from a bad state + +You can use `kubeadm upgrade` to change a running cluster with `x.x.x --> x.x.x` with `--force`, which can be used to recover from a bad state. + +{% endcapture %} + +{% include templates/task.md %} From c29168c78c4d0c5f5032af9747dfbbb782340a17 Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Fri, 11 Aug 2017 10:03:48 +0100 Subject: [PATCH 2/8] adds kubeadm upgrade cmd to ToC addresses kubernetes/kubernetes.github.io/issues/4689 --- _data/tasks.yml | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/_data/tasks.yml b/_data/tasks.yml index 08b45308d487b..a6c5a9bfbd5ff 100644 --- a/_data/tasks.yml +++ b/_data/tasks.yml @@ -1,15 +1,15 @@ -bigheader: "Tasks" -abstract: "Step-by-step instructions for performing operations with Kubernetes." +bigheader: "Tasks" +abstract: "Step-by-step instructions for performing operations with Kubernetes." toc: - docs/tasks/index.md -- title: Install Tools +- title: Install Tools section: - docs/tasks/tools/install-kubectl.md - docs/tasks/tools/install-minikube.md - docs/setup/independent/install-kubeadm.md -- title: Configure Pods and Containers +- title: Configure Pods and Containers section: - docs/tasks/configure-pod-container/assign-cpu-ram-container.md - docs/tasks/configure-pod-container/configure-volume-storage.md @@ -28,7 +28,7 @@ toc: - docs/tasks/configure-pod-container/configure-pod-configmap.md - docs/tools/kompose/user-guide.md -- title: Inject Data Into Applications +- title: Inject Data Into Applications section: - docs/tasks/inject-data-application/define-command-argument-container.md - docs/tasks/inject-data-application/define-environment-variable-container.md @@ -37,7 +37,7 @@ toc: - docs/tasks/inject-data-application/distribute-credentials-secure.md - docs/tasks/inject-data-application/podpreset.md -- title: Run Applications +- title: Run Applications section: - docs/tasks/run-application/run-stateless-application-deployment.md - docs/tasks/run-application/run-single-instance-stateful-application.md @@ -51,13 +51,13 @@ toc: - docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md - docs/tasks/run-application/configure-pdb.md -- title: Run Jobs +- title: Run Jobs section: - docs/tasks/job/parallel-processing-expansion.md - docs/tasks/job/coarse-parallel-processing-work-queue/index.md - docs/tasks/job/fine-parallel-processing-work-queue/index.md -- title: Access Applications in a Cluster +- title: Access Applications in a Cluster section: - docs/tasks/access-application-cluster/web-ui-dashboard.md - docs/tasks/access-application-cluster/access-cluster.md @@ -70,10 +70,10 @@ toc: - docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md - docs/tasks/access-application-cluster/list-all-running-container-images.md - docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume.md - - title: Configuring DNS for a Cluster - path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/cluster-dns + - title: Configuring DNS for a Cluster + path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/cluster-dns -- title: Monitor, Log, and Debug +- title: Monitor, Log, and Debug section: - docs/tasks/debug-application-cluster/resource-usage-monitoring.md - docs/tasks/debug-application-cluster/get-shell-running-container.md @@ -90,10 +90,10 @@ toc: - docs/tasks/debug-application-cluster/debug-stateful-set.md - docs/tasks/debug-application-cluster/debug-application-introspection.md - docs/tasks/debug-application-cluster/audit.md - - title: Use Explorer to Examine the Runtime Environment - path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/explorer + - title: Use Explorer to Examine the Runtime Environment + path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/explorer -- title: Access and Extend the Kubernetes API +- title: Access and Extend the Kubernetes API section: - docs/tasks/access-kubernetes-api/http-proxy-access-api.md - docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions.md @@ -102,11 +102,11 @@ toc: - docs/tasks/access-kubernetes-api/configure-aggregation-layer.md - docs/tasks/access-kubernetes-api/setup-extension-api-server.md -- title: TLS +- title: TLS section: - docs/tasks/tls/managing-tls-in-a-cluster.md -- title: Administer a Cluster +- title: Administer a Cluster section: - docs/tasks/administer-cluster/access-cluster-api.md - docs/tasks/administer-cluster/access-cluster-services.md @@ -122,12 +122,13 @@ toc: - docs/tasks/administer-cluster/cluster-management.md - docs/tasks/administer-cluster/upgrade-1-6.md - docs/tasks/administer-cluster/kubeadm-upgrade-1-7.md + - docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md - docs/tasks/administer-cluster/namespaces.md - docs/tasks/administer-cluster/namespaces-walkthrough.md - docs/tasks/administer-cluster/dns-horizontal-autoscaling.md - docs/tasks/administer-cluster/safely-drain-node.md - docs/tasks/administer-cluster/declare-network-policy.md - - title: Install Network Policy Provider + - title: Install Network Policy Provider section: - docs/tasks/administer-cluster/calico-network-policy.md - docs/tasks/administer-cluster/romana-network-policy.md @@ -142,10 +143,10 @@ toc: - docs/tasks/administer-cluster/configure-multiple-schedulers.md - docs/tasks/administer-cluster/ip-masq-agent.md - docs/tasks/administer-cluster/dns-custom-nameservers.md - - title: Change Cluster Size - path: https://github.com/kubernetes/kubernetes/wiki/User-FAQ#how-do-i-change-the-size-of-my-cluster/ + - title: Change Cluster Size + path: https://github.com/kubernetes/kubernetes/wiki/User-FAQ#how-do-i-change-the-size-of-my-cluster/ -- title: Federation - Run an App on Multiple Clusters +- title: Federation - Run an App on Multiple Clusters section: - docs/tasks/federation/federation-service-discovery.md - docs/tasks/federation/set-up-cluster-federation-kubefed.md @@ -161,13 +162,11 @@ toc: - docs/tasks/administer-federation/replicaset.md - docs/tasks/administer-federation/secret.md -- title: Manage Cluster Daemons +- title: Manage Cluster Daemons section: - docs/tasks/manage-daemon/update-daemon-set.md - docs/tasks/manage-daemon/rollback-daemon-set.md -- title: Manage GPUs +- title: Manage GPUs section: - docs/tasks/manage-gpus/scheduling-gpus.md - - From 9c0a1b7732da548cae548ee11284ead45113fff1 Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Wed, 13 Sep 2017 10:21:35 +0100 Subject: [PATCH 3/8] reverts extra spacing in _data/tasks.yml --- _data/tasks.yml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/_data/tasks.yml b/_data/tasks.yml index a6c5a9bfbd5ff..102388956a74a 100644 --- a/_data/tasks.yml +++ b/_data/tasks.yml @@ -1,15 +1,15 @@ -bigheader: "Tasks" -abstract: "Step-by-step instructions for performing operations with Kubernetes." +bigheader: "Tasks" +abstract: "Step-by-step instructions for performing operations with Kubernetes." toc: - docs/tasks/index.md -- title: Install Tools +- title: Install Tools section: - docs/tasks/tools/install-kubectl.md - docs/tasks/tools/install-minikube.md - docs/setup/independent/install-kubeadm.md -- title: Configure Pods and Containers +- title: Configure Pods and Containers section: - docs/tasks/configure-pod-container/assign-cpu-ram-container.md - docs/tasks/configure-pod-container/configure-volume-storage.md @@ -28,7 +28,7 @@ toc: - docs/tasks/configure-pod-container/configure-pod-configmap.md - docs/tools/kompose/user-guide.md -- title: Inject Data Into Applications +- title: Inject Data Into Applications section: - docs/tasks/inject-data-application/define-command-argument-container.md - docs/tasks/inject-data-application/define-environment-variable-container.md @@ -37,7 +37,7 @@ toc: - docs/tasks/inject-data-application/distribute-credentials-secure.md - docs/tasks/inject-data-application/podpreset.md -- title: Run Applications +- title: Run Applications section: - docs/tasks/run-application/run-stateless-application-deployment.md - docs/tasks/run-application/run-single-instance-stateful-application.md @@ -51,13 +51,13 @@ toc: - docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md - docs/tasks/run-application/configure-pdb.md -- title: Run Jobs +- title: Run Jobs section: - docs/tasks/job/parallel-processing-expansion.md - docs/tasks/job/coarse-parallel-processing-work-queue/index.md - docs/tasks/job/fine-parallel-processing-work-queue/index.md -- title: Access Applications in a Cluster +- title: Access Applications in a Cluster section: - docs/tasks/access-application-cluster/web-ui-dashboard.md - docs/tasks/access-application-cluster/access-cluster.md @@ -70,10 +70,10 @@ toc: - docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md - docs/tasks/access-application-cluster/list-all-running-container-images.md - docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume.md - - title: Configuring DNS for a Cluster - path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/cluster-dns + - title: Configuring DNS for a Cluster + path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/cluster-dns -- title: Monitor, Log, and Debug +- title: Monitor, Log, and Debug section: - docs/tasks/debug-application-cluster/resource-usage-monitoring.md - docs/tasks/debug-application-cluster/get-shell-running-container.md @@ -90,10 +90,10 @@ toc: - docs/tasks/debug-application-cluster/debug-stateful-set.md - docs/tasks/debug-application-cluster/debug-application-introspection.md - docs/tasks/debug-application-cluster/audit.md - - title: Use Explorer to Examine the Runtime Environment - path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/explorer + - title: Use Explorer to Examine the Runtime Environment + path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/explorer -- title: Access and Extend the Kubernetes API +- title: Access and Extend the Kubernetes API section: - docs/tasks/access-kubernetes-api/http-proxy-access-api.md - docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions.md @@ -102,11 +102,11 @@ toc: - docs/tasks/access-kubernetes-api/configure-aggregation-layer.md - docs/tasks/access-kubernetes-api/setup-extension-api-server.md -- title: TLS +- title: TLS section: - docs/tasks/tls/managing-tls-in-a-cluster.md -- title: Administer a Cluster +- title: Administer a Cluster section: - docs/tasks/administer-cluster/access-cluster-api.md - docs/tasks/administer-cluster/access-cluster-services.md @@ -128,7 +128,7 @@ toc: - docs/tasks/administer-cluster/dns-horizontal-autoscaling.md - docs/tasks/administer-cluster/safely-drain-node.md - docs/tasks/administer-cluster/declare-network-policy.md - - title: Install Network Policy Provider + - title: Install Network Policy Provider section: - docs/tasks/administer-cluster/calico-network-policy.md - docs/tasks/administer-cluster/romana-network-policy.md @@ -143,10 +143,10 @@ toc: - docs/tasks/administer-cluster/configure-multiple-schedulers.md - docs/tasks/administer-cluster/ip-masq-agent.md - docs/tasks/administer-cluster/dns-custom-nameservers.md - - title: Change Cluster Size - path: https://github.com/kubernetes/kubernetes/wiki/User-FAQ#how-do-i-change-the-size-of-my-cluster/ + - title: Change Cluster Size + path: https://github.com/kubernetes/kubernetes/wiki/User-FAQ#how-do-i-change-the-size-of-my-cluster/ -- title: Federation - Run an App on Multiple Clusters +- title: Federation - Run an App on Multiple Clusters section: - docs/tasks/federation/federation-service-discovery.md - docs/tasks/federation/set-up-cluster-federation-kubefed.md @@ -162,11 +162,11 @@ toc: - docs/tasks/administer-federation/replicaset.md - docs/tasks/administer-federation/secret.md -- title: Manage Cluster Daemons +- title: Manage Cluster Daemons section: - docs/tasks/manage-daemon/update-daemon-set.md - docs/tasks/manage-daemon/rollback-daemon-set.md -- title: Manage GPUs +- title: Manage GPUs section: - docs/tasks/manage-gpus/scheduling-gpus.md From 91fc3b9f117fddc19b0f9db83cae59b52901eba8 Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Wed, 13 Sep 2017 10:56:02 +0100 Subject: [PATCH 4/8] addresses `kubeadm upgrade` review comments Feedback from @chenopis, @luxas, and @steveperry-53 addressed with this commit --- .../administer-cluster/kubeadm-upgrade-cmd.md | 151 +++++++++++++++--- 1 file changed, 133 insertions(+), 18 deletions(-) diff --git a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md index fdb1d278e0782..a7016237d49b2 100644 --- a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md +++ b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md @@ -1,52 +1,167 @@ --- approvers: - pipejakob +- luxas +- roberthbailey +- jbeda title: Upgrading kubeadm clusters --- {% capture overview %} -This guide is for upgrading kubeadm clusters from version 1.7.x to 1.8.x. -See also [upgrading kubeadm clusters from 1.6 to 1.7](/docs/tasks/administer-cluster/kubeadm-upgrade-1-7/) if you're on a 1.6 cluster, currently. +This guide is for upgrading `kubeadm` clusters from version 1.7.x to 1.8.x. +See also [upgrading kubeadm clusters from 1.6 to 1.7](/docs/tasks/administer-cluster/kubeadm-upgrade-1-7/) if you're on a 1.6 cluster currently. {% endcapture %} {% capture prerequisites %} -You need to have a Kubernetes cluster running version 1.7.x in order to use the process described here. Note that only one minor version upgrade is supported, that is, you can only upgrade from, say 1.7 to 1.8, not from 1.7 to 1.9. -Before proceeding, make sure you read the [release notes](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#v180-alpha2) carefully. +Before proceeding: -The following is out of scope for `kubeadm upgrade`, that is, you need to take care of it yourself: +- You need to have a `kubeadm` Kubernetes cluster running version 1.7.0 or higher in order to use the process described here. +- Make sure you read the [release notes](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#v180-alpha2) carefully. +- As `kubeadm upgrade` does not upgrade etcd make sure to back it up. You can, for example, use `etcdctl backup` to take care of this. +- Note that `kubeadm upgrade` will not touch any of your workloads, only Kubernetes-internal components. As a best-practice you should back up what's important to you. For example, any app-level state, such as a database an app might depend on (like MySQL or MongoDB) must be backed up beforehand. -- No etcd upgrades are performed. You can, for example, use `etcdctl` to take care of this. -- Any app-level state, for example, a database an app might depend on (like MySQL or MongoDB) must be backed up beforehand. - - -Note that `kubeadm upgrade` is 'eventually idempotent', that is, you can run it over and over again if you find yourself in a bad state and it should be able to recover. +Also, note that only one minor version upgrade is supported. That is, you can only upgrade from, say 1.7 to 1.8, not from 1.7 to 1.9. {% endcapture %} {% capture steps %} -## On the master +## Upgrading your control plane + +You have to carry out the following steps on the master: 1. Upgrade `kubectl` using [curl](/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl). Note: DO NOT use `apt` or `yum` or any other package manager to upgrade it. 2. Install the most recent version of `kubeadm` using curl. -3. On the master node, run `kubeadm upgrade plan`, which tells you what versions are available. - -4. Pick a version to upgrade to and run, for example, `kubeadm upgrade apply --version v1.7.3`. - -5. After `kubeadm upgrade` you need to manually upgrade your SDN. - - Your CNI provider might have its own upgrade instructions to follow now. +3. On the master node, run the following: + +```shell +$ kubeadm upgrade plan +[upgrade] Making sure the cluster is healthy: +[upgrade/health] Checking API Server health: Healthy +[upgrade/health] Checking Node health: All Nodes are healthy +[upgrade/health] Checking if control plane is Static Pod-hosted or Self-Hosted: Static Pod-hosted. +[upgrade/health] NOTE: kubeadm will upgrade your Static Pod-hosted control plane to a Self-Hosted one when upgrading if --feature-gates=SelfHosting=true is set (which is the default) +[upgrade/health] If you strictly want to continue using a Static Pod-hosted control plane, set --feature-gates=SelfHosting=true when running 'kubeadm upgrade apply' +[upgrade/health] Checking Static Pod manifests exists on disk: All required Static Pod manifests exist on disk +[upgrade] Making sure the configuration is correct: +[upgrade/config] Reading configuration from the cluster (you can get this with 'kubectl -n kube-system get cm kubeadm-config -oyaml') +[upgrade] Fetching available versions to upgrade to: +[upgrade/versions] Cluster version: v1.7.1 +[upgrade/versions] kubeadm version: v1.8.0-alpha.2.789+11f48dc291fe93 +[upgrade/versions] Latest stable version: v1.7.3 +[upgrade/versions] Latest version in the v1.7 series: v1.7.3 + +Components that must be upgraded manually after you've upgraded the control plane with `kubeadm upgrade apply`: +COMPONENT CURRENT AVAILABLE +Kubelet 1 x v1.7.0 v1.7.3 + +Upgrade to the latest version in the v1.7 series: + +COMPONENT CURRENT AVAILABLE +API Server v1.7.1 v1.7.3 +Controller Manager v1.7.1 v1.7.3 +Scheduler v1.7.1 v1.7.3 +Kube Proxy v1.7.1 v1.7.3 +Kube DNS 1.14.4 1.14.4 + +You can now apply the upgrade by executing the following command: + + kubeadm upgrade apply --version v1.7.3 +``` + +The `kubeadm upgrade plan` checks that your cluster is in an upgradeable state and fetches the versions available to upgrade to in an user-friendly way. + +4. Pick a version to upgrade to and run, for example, `kubeadm upgrade apply` as follows: + +```shell +$ kubeadm upgrade apply --version v1.7.3 +[upgrade] Making sure the cluster is healthy: +[upgrade/health] Checking API Server health: Healthy +[upgrade/health] Checking Node health: All Nodes are healthy +[upgrade/health] Checking if control plane is Static Pod-hosted or Self-Hosted: Static Pod-hosted. +[upgrade/health] NOTE: kubeadm will upgrade your Static Pod-hosted control plane to a Self-Hosted one when upgrading if --feature-gates=SelfHosting=true is set (which is the default) +[upgrade/health] If you strictly want to continue using a Static Pod-hosted control plane, set --feature-gates=SelfHosting=true when running 'kubeadm upgrade apply' +[upgrade/health] Checking Static Pod manifests exists on disk: All required Static Pod manifests exist on disk +[upgrade] Making sure the configuration is correct: +[upgrade/config] Reading configuration from the cluster (you can get this with 'kubectl -n kube-system get cm kubeadm-config -oyaml') +[upgrade/version] You have chosen to upgrade to version "v1.7.3" +[upgrade/versions] Cluster version: v1.7.1 +[upgrade/versions] kubeadm version: v1.8.0-alpha.2.789+11f48dc291fe93 +[upgrade/confirm] Are you sure you want to proceed with the upgrade? [y/N]: Y +[upgrade/prepull] Will prepull images for components [kube-apiserver kube-controller-manager kube-scheduler] +[upgrade/prepull] Prepulling image for component kube-scheduler. +[upgrade/prepull] Prepulling image for component kube-apiserver. +[upgrade/prepull] Prepulling image for component kube-controller-manager. +[upgrade/prepull] Prepulled image for component kube-scheduler. +[upgrade/prepull] Prepulled image for component kube-apiserver. +[upgrade/prepull] Prepulled image for component kube-controller-manager. +[upgrade/prepull] Successfully prepulled the images for all the control plane components +[upgrade/apply] Upgrading your Static Pod-hosted control plane to version "v1.7.3"... +[upgrade/staticpods] Wrote upgraded Static Pod manifests to "/tmp/kubeadm-upgrade830923296" +[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-apiserver.yaml" and backuped old manifest to "/tmp/kubeadm-upgrade830923296/old-manifests/kube-apiserver.yaml" +[upgrade/staticpods] Waiting for the kubelet to restart the component +[apiclient] Found 1 Pods for label selector component=kube-apiserver +[upgrade/staticpods] Component "kube-apiserver" upgraded successfully! +[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-controller-manager.yaml" and backuped old manifest to "/tmp/kubeadm-upgrade830923296/old-manifests/kube-controller-manager.yaml" +[upgrade/staticpods] Waiting for the kubelet to restart the component +[apiclient] Found 1 Pods for label selector component=kube-controller-manager +[upgrade/staticpods] Component "kube-controller-manager" upgraded successfully! +[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-scheduler.yaml" and backuped old manifest to "/tmp/kubeadm-upgrade830923296/old-manifests/kube-scheduler.yaml" +[upgrade/staticpods] Waiting for the kubelet to restart the component +[apiclient] Found 1 Pods for label selector component=kube-scheduler +[apiclient] Found 0 Pods for label selector component=kube-scheduler +[apiclient] Found 1 Pods for label selector component=kube-scheduler +[upgrade/staticpods] Component "kube-scheduler" upgraded successfully! +[self-hosted] Created TLS secret "ca" from ca.crt and ca.key +[self-hosted] Created TLS secret "apiserver" from apiserver.crt and apiserver.key +[self-hosted] Created TLS secret "apiserver-kubelet-client" from apiserver-kubelet-client.crt and apiserver-kubelet-client.key +[self-hosted] Created TLS secret "sa" from sa.pub and sa.key +[self-hosted] Created TLS secret "front-proxy-ca" from front-proxy-ca.crt and front-proxy-ca.key +[self-hosted] Created TLS secret "front-proxy-client" from front-proxy-client.crt and front-proxy-client.key +[self-hosted] Created secret "scheduler.conf" +[self-hosted] Created secret "controller-manager.conf" +[apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-apiserver +[apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-apiserver +[self-hosted] self-hosted kube-apiserver ready after 15.295571 seconds +[apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-controller-manager +[apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-controller-manager +[self-hosted] self-hosted kube-controller-manager ready after 15.804586 seconds +[apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-scheduler +[apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-scheduler +[self-hosted] self-hosted kube-scheduler ready after 18.958074 seconds +[apiconfig] Created RBAC rules +[addons] Applied essential addon: kube-proxy +[addons] Applied essential addon: kube-dns +``` + +The `kubeadm upgrade apply` does the following: + +- It checks that your cluster is in an upgradeable state, that is: + - The API Server is reachable, + - All nodes are in the `Ready` state, and + - The control plane is healthy +- It enforces the version skew policies. +- It makes sure the control plane images are available or available to pull to the machine. +- It upgrades the control plane components or rollbacks if any of them fails to come up. +- It applies the new `kube-dns` and `kube-proxy` manifests and enforces that all necessary RBAC rules are created. + +5. Manually upgrade your Software Defined Network (SDN). + + Your Container Network Interface (CNI) provider might have its own upgrade instructions to follow now. Check the [addons](/docs/concepts/cluster-administration/addons/) page to find your CNI provider and see if there are additional upgrade steps necessary. ## Recovering from a bad state +If `kubeadm upgrade` somehow fails and fails to roll back, due to an unexpected shutdown during execution for instance, +you may run `kubeadm upgrade` again as it is idempotent and should eventually make sure the actual state is the desired state you are declaring. + You can use `kubeadm upgrade` to change a running cluster with `x.x.x --> x.x.x` with `--force`, which can be used to recover from a bad state. {% endcapture %} From 27c000f74e0da5eb202b4377b1992e089f1a8db1 Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Thu, 14 Sep 2017 11:36:33 +0100 Subject: [PATCH 5/8] addresses `kubeadm upgrade` review comments 2nd iteration review comments by @luxas --- .../administer-cluster/kubeadm-upgrade-cmd.md | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md index a7016237d49b2..e130c00ee01c0 100644 --- a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md +++ b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md @@ -18,8 +18,8 @@ See also [upgrading kubeadm clusters from 1.6 to 1.7](/docs/tasks/administer-clu Before proceeding: -- You need to have a `kubeadm` Kubernetes cluster running version 1.7.0 or higher in order to use the process described here. -- Make sure you read the [release notes](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#v180-alpha2) carefully. +- You need to have a functional `kubeadm` Kubernetes cluster running version 1.7.0 or higher in order to use the process described here. +- Make sure you read the [release notes](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#v180-beta1) carefully. - As `kubeadm upgrade` does not upgrade etcd make sure to back it up. You can, for example, use `etcdctl backup` to take care of this. - Note that `kubeadm upgrade` will not touch any of your workloads, only Kubernetes-internal components. As a best-practice you should back up what's important to you. For example, any app-level state, such as a database an app might depend on (like MySQL or MongoDB) must be backed up beforehand. @@ -31,13 +31,17 @@ Also, note that only one minor version upgrade is supported. That is, you can on ## Upgrading your control plane -You have to carry out the following steps on the master: +You have to carry out the following steps by executing these commands on your master node: -1. Upgrade `kubectl` using [curl](/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl). Note: DO NOT use `apt` or `yum` or any other package manager to upgrade it. +1. Install the most recent version of `kubeadm` using `curl` like so: -2. Install the most recent version of `kubeadm` using curl. +```shell +$ export VERSION=v1.8.0 # or any given released Kubernetes version +$ export ARCH=amd64 # or: arm, arm64, ppc64le, s390x +$ curl -sSL https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubeadm > /usr/bin/kubeadm +``` -3. On the master node, run the following: +1. On the master node, run the following: ```shell $ kubeadm upgrade plan @@ -52,7 +56,7 @@ $ kubeadm upgrade plan [upgrade/config] Reading configuration from the cluster (you can get this with 'kubectl -n kube-system get cm kubeadm-config -oyaml') [upgrade] Fetching available versions to upgrade to: [upgrade/versions] Cluster version: v1.7.1 -[upgrade/versions] kubeadm version: v1.8.0-alpha.2.789+11f48dc291fe93 +[upgrade/versions] kubeadm version: v1.8.0 [upgrade/versions] Latest stable version: v1.7.3 [upgrade/versions] Latest version in the v1.7 series: v1.7.3 @@ -76,10 +80,10 @@ You can now apply the upgrade by executing the following command: The `kubeadm upgrade plan` checks that your cluster is in an upgradeable state and fetches the versions available to upgrade to in an user-friendly way. -4. Pick a version to upgrade to and run, for example, `kubeadm upgrade apply` as follows: +1. Pick a version to upgrade to and run, for example, `kubeadm upgrade apply` as follows: ```shell -$ kubeadm upgrade apply --version v1.7.3 +$ kubeadm upgrade apply --version v1.8.0 [upgrade] Making sure the cluster is healthy: [upgrade/health] Checking API Server health: Healthy [upgrade/health] Checking Node health: All Nodes are healthy @@ -89,9 +93,9 @@ $ kubeadm upgrade apply --version v1.7.3 [upgrade/health] Checking Static Pod manifests exists on disk: All required Static Pod manifests exist on disk [upgrade] Making sure the configuration is correct: [upgrade/config] Reading configuration from the cluster (you can get this with 'kubectl -n kube-system get cm kubeadm-config -oyaml') -[upgrade/version] You have chosen to upgrade to version "v1.7.3" +[upgrade/version] You have chosen to upgrade to version "v1.8.0" [upgrade/versions] Cluster version: v1.7.1 -[upgrade/versions] kubeadm version: v1.8.0-alpha.2.789+11f48dc291fe93 +[upgrade/versions] kubeadm version: v1.8.0 [upgrade/confirm] Are you sure you want to proceed with the upgrade? [y/N]: Y [upgrade/prepull] Will prepull images for components [kube-apiserver kube-controller-manager kube-scheduler] [upgrade/prepull] Prepulling image for component kube-scheduler. @@ -101,7 +105,7 @@ $ kubeadm upgrade apply --version v1.7.3 [upgrade/prepull] Prepulled image for component kube-apiserver. [upgrade/prepull] Prepulled image for component kube-controller-manager. [upgrade/prepull] Successfully prepulled the images for all the control plane components -[upgrade/apply] Upgrading your Static Pod-hosted control plane to version "v1.7.3"... +[upgrade/apply] Upgrading your Static Pod-hosted control plane to version "v1.8.0"... [upgrade/staticpods] Wrote upgraded Static Pod manifests to "/tmp/kubeadm-upgrade830923296" [upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-apiserver.yaml" and backuped old manifest to "/tmp/kubeadm-upgrade830923296/old-manifests/kube-apiserver.yaml" [upgrade/staticpods] Waiting for the kubelet to restart the component @@ -117,29 +121,18 @@ $ kubeadm upgrade apply --version v1.7.3 [apiclient] Found 0 Pods for label selector component=kube-scheduler [apiclient] Found 1 Pods for label selector component=kube-scheduler [upgrade/staticpods] Component "kube-scheduler" upgraded successfully! -[self-hosted] Created TLS secret "ca" from ca.crt and ca.key -[self-hosted] Created TLS secret "apiserver" from apiserver.crt and apiserver.key -[self-hosted] Created TLS secret "apiserver-kubelet-client" from apiserver-kubelet-client.crt and apiserver-kubelet-client.key -[self-hosted] Created TLS secret "sa" from sa.pub and sa.key -[self-hosted] Created TLS secret "front-proxy-ca" from front-proxy-ca.crt and front-proxy-ca.key -[self-hosted] Created TLS secret "front-proxy-client" from front-proxy-client.crt and front-proxy-client.key -[self-hosted] Created secret "scheduler.conf" -[self-hosted] Created secret "controller-manager.conf" [apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-apiserver [apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-apiserver -[self-hosted] self-hosted kube-apiserver ready after 15.295571 seconds [apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-controller-manager [apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-controller-manager -[self-hosted] self-hosted kube-controller-manager ready after 15.804586 seconds [apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-scheduler [apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-scheduler -[self-hosted] self-hosted kube-scheduler ready after 18.958074 seconds [apiconfig] Created RBAC rules [addons] Applied essential addon: kube-proxy [addons] Applied essential addon: kube-dns ``` -The `kubeadm upgrade apply` does the following: +`kubeadm upgrade apply` does the following: - It checks that your cluster is in an upgradeable state, that is: - The API Server is reachable, @@ -150,7 +143,7 @@ The `kubeadm upgrade apply` does the following: - It upgrades the control plane components or rollbacks if any of them fails to come up. - It applies the new `kube-dns` and `kube-proxy` manifests and enforces that all necessary RBAC rules are created. -5. Manually upgrade your Software Defined Network (SDN). +1. Manually upgrade your Software Defined Network (SDN). Your Container Network Interface (CNI) provider might have its own upgrade instructions to follow now. Check the [addons](/docs/concepts/cluster-administration/addons/) page to From b173596ab952b8108356825539d250a31f70046e Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Thu, 14 Sep 2017 14:18:11 +0100 Subject: [PATCH 6/8] adds kubelet upgrade section to kubeadm upgrade --- .../administer-cluster/kubeadm-upgrade-cmd.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md index e130c00ee01c0..5c9edc2fcb69a 100644 --- a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md +++ b/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md @@ -150,6 +150,47 @@ $ kubeadm upgrade apply --version v1.8.0 find your CNI provider and see if there are additional upgrade steps necessary. +## Upgrading your worker nodes + +For each worker node (referred to as `$WORKER` below) in your cluster, upgrade `kubelet` by executing the following commands: + +1. Prepare the node for maintenance, marking it unschedulable and evicting the workload: + +```shell +$ kubectl cordon $WORKER +$ kubectl drain $WORKER +``` + +1. Upgrade the `kubelet` version on the `$WORKER` node, either by using a Linux distribution-specific package manager such as `apt-get` or `yum` or manually as described in the following: + +```shell +$ sudo systemctl stop kubelet +$ curl -s -L -o kubelet \ + https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/linux/amd64/kubelet +$ chmod +x kubectl && sudo mv kubelet /usr/local/bin/ +$ sudo systemctl start kubelet +``` + +Now, the new version of the `kubelet` should be running on the `$WORKER` node. Verify this using the following command: + +```shell +$ systemctl status kubelet +``` + +1. Bring the `$WORKER` node back online by marking it schedulable: + +```shell +$ kubectl uncordon $WORKER +``` + +1. After upgrading `kubelet` on each worker node in your cluster, verify that all nodes are available again by executing the following (from anywhere, for example, from outside the cluster): + +```shell +$ kubectl get nodes +``` + +If the `STATUS` column of the above command shows `Ready` for all of your worker nodes, you are done. + ## Recovering from a bad state If `kubeadm upgrade` somehow fails and fails to roll back, due to an unexpected shutdown during execution for instance, From f4ce844fcbec289eac601abc08046407b7e18612 Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Sat, 16 Sep 2017 11:27:12 +0200 Subject: [PATCH 7/8] addresses `kubeadm upgrade` review comments CC: @luxas --- ...-upgrade-cmd.md => kubeadm-upgrade-1-8.md} | 155 ++++++++++++------ 1 file changed, 103 insertions(+), 52 deletions(-) rename docs/tasks/administer-cluster/{kubeadm-upgrade-cmd.md => kubeadm-upgrade-1-8.md} (56%) diff --git a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md b/docs/tasks/administer-cluster/kubeadm-upgrade-1-8.md similarity index 56% rename from docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md rename to docs/tasks/administer-cluster/kubeadm-upgrade-1-8.md index 5c9edc2fcb69a..d1ef1628bd827 100644 --- a/docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md +++ b/docs/tasks/administer-cluster/kubeadm-upgrade-1-8.md @@ -4,12 +4,12 @@ approvers: - luxas - roberthbailey - jbeda -title: Upgrading kubeadm clusters +title: Upgrading kubeadm clusters from 1.7 to 1.8 --- {% capture overview %} -This guide is for upgrading `kubeadm` clusters from version 1.7.x to 1.8.x. +This guide is for upgrading `kubeadm` clusters from version 1.7.x to 1.8.x, as well as 1.7.x to 1.7.y and 1.8.x to 1.8.y where `y > x`. See also [upgrading kubeadm clusters from 1.6 to 1.7](/docs/tasks/administer-cluster/kubeadm-upgrade-1-7/) if you're on a 1.6 cluster currently. {% endcapture %} @@ -41,95 +41,140 @@ $ export ARCH=amd64 # or: arm, arm64, ppc64le, s390x $ curl -sSL https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubeadm > /usr/bin/kubeadm ``` -1. On the master node, run the following: +2. If this the first time you use `kubeadm upgrade`, in order to preserve the configuration for future upgrades, do: + +Note that for below you will need to recall what CLI args you passed to `kubeadm init` the first time. + +If you used flags, do: + +```shell +$ kubeadm config upload from-flags [flags] +``` + +Where `flags` can be empty. + +If you used a config file, do: + +```shell +$ kubeadm config upload from-file --config [config] +``` + +Where the `config` is mandatory. + +3. On the master node, run the following: ```shell $ kubeadm upgrade plan +[preflight] Running pre-flight checks [upgrade] Making sure the cluster is healthy: [upgrade/health] Checking API Server health: Healthy [upgrade/health] Checking Node health: All Nodes are healthy -[upgrade/health] Checking if control plane is Static Pod-hosted or Self-Hosted: Static Pod-hosted. -[upgrade/health] NOTE: kubeadm will upgrade your Static Pod-hosted control plane to a Self-Hosted one when upgrading if --feature-gates=SelfHosting=true is set (which is the default) -[upgrade/health] If you strictly want to continue using a Static Pod-hosted control plane, set --feature-gates=SelfHosting=true when running 'kubeadm upgrade apply' -[upgrade/health] Checking Static Pod manifests exists on disk: All required Static Pod manifests exist on disk -[upgrade] Making sure the configuration is correct: -[upgrade/config] Reading configuration from the cluster (you can get this with 'kubectl -n kube-system get cm kubeadm-config -oyaml') +[upgrade/health] Checking Static Pod manifests exists on disk: All manifests exist on disk +[upgrade/config] Making sure the configuration is correct: +[upgrade/config] Reading configuration from the cluster... +[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml' [upgrade] Fetching available versions to upgrade to: [upgrade/versions] Cluster version: v1.7.1 [upgrade/versions] kubeadm version: v1.8.0 -[upgrade/versions] Latest stable version: v1.7.3 -[upgrade/versions] Latest version in the v1.7 series: v1.7.3 +[upgrade/versions] Latest stable version: v1.8.0 +[upgrade/versions] Latest version in the v1.7 series: v1.7.6 -Components that must be upgraded manually after you've upgraded the control plane with `kubeadm upgrade apply`: +Components that must be upgraded manually after you've upgraded the control plane with 'kubeadm upgrade apply': COMPONENT CURRENT AVAILABLE -Kubelet 1 x v1.7.0 v1.7.3 +Kubelet 1 x v1.7.1 v1.7.6 Upgrade to the latest version in the v1.7 series: COMPONENT CURRENT AVAILABLE -API Server v1.7.1 v1.7.3 -Controller Manager v1.7.1 v1.7.3 -Scheduler v1.7.1 v1.7.3 -Kube Proxy v1.7.1 v1.7.3 +API Server v1.7.1 v1.7.6 +Controller Manager v1.7.1 v1.7.6 +Scheduler v1.7.1 v1.7.6 +Kube Proxy v1.7.1 v1.7.6 +Kube DNS 1.14.4 1.14.4 + +You can now apply the upgrade by executing the following command: + + kubeadm upgrade apply v1.7.6 + +_____________________________________________________________________ + +Components that must be upgraded manually after you've upgraded the control plane with 'kubeadm upgrade apply': +COMPONENT CURRENT AVAILABLE +Kubelet 1 x v1.7.1 v1.8.0 + +Upgrade to the latest experimental version: + +COMPONENT CURRENT AVAILABLE +API Server v1.7.1 v1.8.0 +Controller Manager v1.7.1 v1.8.0 +Scheduler v1.7.1 v1.8.0 +Kube Proxy v1.7.1 v1.8.0 Kube DNS 1.14.4 1.14.4 You can now apply the upgrade by executing the following command: - kubeadm upgrade apply --version v1.7.3 + kubeadm upgrade apply v1.8.0 + +Note: Before you do can perform this upgrade, you have to update kubeadm to v1.8.0 + +_____________________________________________________________________ ``` The `kubeadm upgrade plan` checks that your cluster is in an upgradeable state and fetches the versions available to upgrade to in an user-friendly way. -1. Pick a version to upgrade to and run, for example, `kubeadm upgrade apply` as follows: +4. Pick a version to upgrade to and run, for example, `kubeadm upgrade apply` as follows: ```shell -$ kubeadm upgrade apply --version v1.8.0 +$ kubeadm upgrade apply v1.8.0 +[preflight] Running pre-flight checks [upgrade] Making sure the cluster is healthy: [upgrade/health] Checking API Server health: Healthy [upgrade/health] Checking Node health: All Nodes are healthy -[upgrade/health] Checking if control plane is Static Pod-hosted or Self-Hosted: Static Pod-hosted. -[upgrade/health] NOTE: kubeadm will upgrade your Static Pod-hosted control plane to a Self-Hosted one when upgrading if --feature-gates=SelfHosting=true is set (which is the default) -[upgrade/health] If you strictly want to continue using a Static Pod-hosted control plane, set --feature-gates=SelfHosting=true when running 'kubeadm upgrade apply' -[upgrade/health] Checking Static Pod manifests exists on disk: All required Static Pod manifests exist on disk -[upgrade] Making sure the configuration is correct: -[upgrade/config] Reading configuration from the cluster (you can get this with 'kubectl -n kube-system get cm kubeadm-config -oyaml') +[upgrade/health] Checking Static Pod manifests exists on disk: All manifests exist on disk +[upgrade/config] Making sure the configuration is correct: +[upgrade/config] Reading configuration from the cluster... +[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml' [upgrade/version] You have chosen to upgrade to version "v1.8.0" [upgrade/versions] Cluster version: v1.7.1 [upgrade/versions] kubeadm version: v1.8.0 -[upgrade/confirm] Are you sure you want to proceed with the upgrade? [y/N]: Y [upgrade/prepull] Will prepull images for components [kube-apiserver kube-controller-manager kube-scheduler] [upgrade/prepull] Prepulling image for component kube-scheduler. [upgrade/prepull] Prepulling image for component kube-apiserver. [upgrade/prepull] Prepulling image for component kube-controller-manager. -[upgrade/prepull] Prepulled image for component kube-scheduler. +[apiclient] Found 0 Pods for label selector k8s-app=upgrade-prepull-kube-scheduler +[apiclient] Found 1 Pods for label selector k8s-app=upgrade-prepull-kube-scheduler +[apiclient] Found 1 Pods for label selector k8s-app=upgrade-prepull-kube-apiserver +[apiclient] Found 1 Pods for label selector k8s-app=upgrade-prepull-kube-controller-manager [upgrade/prepull] Prepulled image for component kube-apiserver. [upgrade/prepull] Prepulled image for component kube-controller-manager. +[upgrade/prepull] Prepulled image for component kube-scheduler. [upgrade/prepull] Successfully prepulled the images for all the control plane components [upgrade/apply] Upgrading your Static Pod-hosted control plane to version "v1.8.0"... -[upgrade/staticpods] Wrote upgraded Static Pod manifests to "/tmp/kubeadm-upgrade830923296" -[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-apiserver.yaml" and backuped old manifest to "/tmp/kubeadm-upgrade830923296/old-manifests/kube-apiserver.yaml" +[upgrade/staticpods] Writing upgraded Static Pod manifests to "/etc/kubernetes/tmp/kubeadm-upgraded-manifests432902769" +[controlplane] Wrote Static Pod manifest for component kube-apiserver to "/etc/kubernetes/tmp/kubeadm-upgraded-manifests432902769/kube-apiserver.yaml" +[controlplane] Wrote Static Pod manifest for component kube-controller-manager to "/etc/kubernetes/tmp/kubeadm-upgraded-manifests432902769/kube-controller-manager.yaml" +[controlplane] Wrote Static Pod manifest for component kube-scheduler to "/etc/kubernetes/tmp/kubeadm-upgraded-manifests432902769/kube-scheduler.yaml" +[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-apiserver.yaml" and backed up old manifest to "/etc/kubernetes/tmp/kubeadm-backup-manifests155856668/kube-apiserver.yaml" [upgrade/staticpods] Waiting for the kubelet to restart the component [apiclient] Found 1 Pods for label selector component=kube-apiserver [upgrade/staticpods] Component "kube-apiserver" upgraded successfully! -[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-controller-manager.yaml" and backuped old manifest to "/tmp/kubeadm-upgrade830923296/old-manifests/kube-controller-manager.yaml" +[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-controller-manager.yaml" and backed up old manifest to "/etc/kubernetes/tmp/kubeadm-backup-manifests155856668/kube-controller-manager.yaml" [upgrade/staticpods] Waiting for the kubelet to restart the component [apiclient] Found 1 Pods for label selector component=kube-controller-manager [upgrade/staticpods] Component "kube-controller-manager" upgraded successfully! -[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-scheduler.yaml" and backuped old manifest to "/tmp/kubeadm-upgrade830923296/old-manifests/kube-scheduler.yaml" +[upgrade/staticpods] Moved upgraded manifest to "/etc/kubernetes/manifests/kube-scheduler.yaml" and backed up old manifest to "/etc/kubernetes/tmp/kubeadm-backup-manifests155856668/kube-scheduler.yaml" [upgrade/staticpods] Waiting for the kubelet to restart the component [apiclient] Found 1 Pods for label selector component=kube-scheduler -[apiclient] Found 0 Pods for label selector component=kube-scheduler -[apiclient] Found 1 Pods for label selector component=kube-scheduler [upgrade/staticpods] Component "kube-scheduler" upgraded successfully! -[apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-apiserver -[apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-apiserver -[apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-controller-manager -[apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-controller-manager -[apiclient] Found 0 Pods for label selector k8s-app=self-hosted-kube-scheduler -[apiclient] Found 1 Pods for label selector k8s-app=self-hosted-kube-scheduler -[apiconfig] Created RBAC rules -[addons] Applied essential addon: kube-proxy +[uploadconfig] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace +[bootstraptoken] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials +[bootstraptoken] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token [addons] Applied essential addon: kube-dns +[addons] Applied essential addon: kube-proxy + +[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.8.0". Enjoy! + +[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets in turn. ``` `kubeadm upgrade apply` does the following: @@ -143,7 +188,7 @@ $ kubeadm upgrade apply --version v1.8.0 - It upgrades the control plane components or rollbacks if any of them fails to come up. - It applies the new `kube-dns` and `kube-proxy` manifests and enforces that all necessary RBAC rules are created. -1. Manually upgrade your Software Defined Network (SDN). +5. Manually upgrade your Software Defined Network (SDN). Your Container Network Interface (CNI) provider might have its own upgrade instructions to follow now. Check the [addons](/docs/concepts/cluster-administration/addons/) page to @@ -161,29 +206,35 @@ $ kubectl cordon $WORKER $ kubectl drain $WORKER ``` -1. Upgrade the `kubelet` version on the `$WORKER` node, either by using a Linux distribution-specific package manager such as `apt-get` or `yum` or manually as described in the following: +2. Upgrade the `kubelet` version on the `$WORKER` node by using a Linux distribution-specific package manager: + +If the node is running a Debian-based distro such as Ubuntu, run: + +```shell +$ apt-get update +$ apt-get install -y kubelet +``` + +If the node is running CentOS or the like, run: ```shell -$ sudo systemctl stop kubelet -$ curl -s -L -o kubelet \ - https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/linux/amd64/kubelet -$ chmod +x kubectl && sudo mv kubelet /usr/local/bin/ -$ sudo systemctl start kubelet +$ yum update +$ yum install -y kubelet ``` -Now, the new version of the `kubelet` should be running on the `$WORKER` node. Verify this using the following command: +Now the new version of the `kubelet` should be running on the `$WORKER` node. Verify this using the following command: ```shell $ systemctl status kubelet ``` -1. Bring the `$WORKER` node back online by marking it schedulable: +3. Bring the `$WORKER` node back online by marking it schedulable: ```shell $ kubectl uncordon $WORKER ``` -1. After upgrading `kubelet` on each worker node in your cluster, verify that all nodes are available again by executing the following (from anywhere, for example, from outside the cluster): +4. After upgrading `kubelet` on each worker node in your cluster, verify that all nodes are available again by executing the following (from anywhere, for example, from outside the cluster): ```shell $ kubectl get nodes From be8d67ab5e1935b1f83718b5f9fb0f17aa9d8f83 Mon Sep 17 00:00:00 2001 From: Michael Hausenblas Date: Sat, 16 Sep 2017 11:30:44 +0200 Subject: [PATCH 8/8] fixes kubeadm upgrade index --- _data/tasks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/tasks.yml b/_data/tasks.yml index f4be2fc686ab8..2586a06a10cb6 100644 --- a/_data/tasks.yml +++ b/_data/tasks.yml @@ -134,7 +134,7 @@ toc: - docs/tasks/administer-cluster/cluster-management.md - docs/tasks/administer-cluster/upgrade-1-6.md - docs/tasks/administer-cluster/kubeadm-upgrade-1-7.md - - docs/tasks/administer-cluster/kubeadm-upgrade-cmd.md + - docs/tasks/administer-cluster/kubeadm-upgrade-1-8.md - docs/tasks/administer-cluster/namespaces.md - docs/tasks/administer-cluster/namespaces-walkthrough.md - docs/tasks/administer-cluster/dns-horizontal-autoscaling.md