Introduction
The purpose of this guide is to describe the steps to upgrade Kubernetes from version 1.10 k8s to 1.14 k8s for Fortanix DSM release 4.3.
Overview
The Fortanix DSM 4.3 release will upgrade the system from Kubernetes version 1.10 k8s to 1.14 k8s.
Subsequent Kubernetes upgrades will be released as part of regular upgrades or could continue to be independent upgrades.
After upgrading Fortanix DSM to the 4.3 version, you will not be able to downgrade to previous releases. The Fortanix DSM UI will not allow a downgrade after 4.3 is installed. Please work with Fortanix Support to ensure you have a valid backup that can be used to perform a manual recovery.
Also, you will need to upgrade Fortanix DSM to 4.3 before moving to any future release.
Prerequisites
The following are the prerequisites before upgrading:
Ensure that Disk space of more than 15 GB is available in
/var
and root directory (/
) by executing the following command:The following is the output:
Ensure that all software versions are available in all the endpoints by executing the following command:
The following is the output:
Ensure that Docker registry status “
systemctl status docker-registry
” is active and running before and after the software is uploaded. Also, ensure that the overlay mount matches with this on each node. The following is the command:Here, ‘
vXXXX
’ is the previous version and ‘vYYYY
’ is the upgraded version.Ensure that the latest backup is triggered and verify that it is a successful backup (size and so on).
Upgrading Kubernetes from 1.10 to 1.14
Ensure that you read the ‘Prerequisites’ section before upgrading.
Pre Checks
All nodes should report healthy and should be running Kubernetes version v1.10.13, docker version 17.3.1, and kernel 5.4.
Run the commandkubectl get nodes
and look for the version number under the columnVERSION
. It should showv1.10.13
for each of the nodes. The following is an example output:All pods are healthy in the
default swdist
andkube-systems
namespace.Check the etcd status.
etcd should be TLS migrated. The following command should output the list of etcd members where
peerURLs
should have both ports listed, 2380(http) and 2382(https).The output of the above command should be similar to:
Check the etcd version on each of the etcd pods. It should be 3.2.18.
Check the etcd cluster health. It should report that the cluster is healthy. For example:
Check the image versions for all Kubernetes control plane components. On each node, go to the directory
/etc/kubernetes/manifests
and run the following commands. The desired output should be the following.Make sure the Kubernetes certificates have not expired or are about to expire.
Check the certificates under
/etc/kubernetes/pki
and/etc/kubernetes/pki/etcd
.If the certificates have expired, renew them using
/opt/fortanix/sdkms/bin/renew-k8s-certs.sh
.
The kubelet, docker, and docker-registry service should be running on each node.
There should be disk space of 15+ GB available in
/var
and/
. If not, please delete the oldest version of Fortanix DSM from the UI.
Post Upgrade
The following are the post-update details to note.
Kubernetes version is now upgraded from v1.10.13 to v1.14.10. This means that the packages kubeadm, kubectl, kubelet are upgraded to v.1.14.10.
kubectl does not support
-a
option now. The commandkubectl get pods -a
throws an error.kubelet configuration now uses a file called
/etc/default/kubelet
for extra arguments.The docker version is upgraded from version 17.03 to version 18.06.
etcd upgraded to
3.3.10
from3.2.18
.Member list should show all members listening to peers on
2382(https)
and as a client on2379(https)
. There could be members that show peers listening on port2380(http)
alongside https usage.Flannel upgrade to
v0.11.0-1-g3b757492
fromv0.9.0
.Flannel CNI docker image is no longer used. Only a flannel docker image is used. Flannel CNI version updated in kube-flannel configmap from
0.3.0
to0.3.1
.Pause docker image updated from version 3.0 to 3.1. To check this on the node, run the following command:
The swdist is updated as it has the kubectl specific version as part of the Dockerfile. This would cause swdist to roll out. It would be rolled out after nodes have been upgraded to v1.14. Check the age of the pods using the command below:
Kube Proxy patch:
Kube proxy daemon set has been patched after each k8s version to include patched kube-proxy docker image (this is done to patch the bug in kube-proxy and avoid contention on iptables lock).
Kube proxy docker image versions for each k8s version.
v1.11.10 -
v1.11.10-3-cab99e3cb4b51f
v1.12.10 -
v1.12.10-3-85f7b5925c428e
v1.13.12 -
v1.13.12-3-6e71bdf7e97b1c
v1.14.10 -
v1.14.10-5-740026d6e146df
Kernel is upgraded from 5.4.0-81-generic to 5.8.0-50-generic. The Kubernetes version on each node is upgraded to 1.14 prior to doing the kernel upgrade. This can be checked with the following command under column
KERNEL-VERSION
.Kured version is upgraded from 1.1.0 to 1.2.0
Troubleshooting
In case kubelet client certificates expire (
/var/lib/kubelet/pki/kubelet-client.crt
) and there is no/var/lib/kubelet/pki/kubelet-client-current.pem
file present, then you can create the certificates using the following commands:Upgrade on a 2 node cluster can fail due to etcd quorum failure. In such a scenario, if pods are healthy, you can re-run the deploy job manually using the following command. This will eventually upgrade the cluster to 1.14.
WARNING
2 node upgrades are not recommended.
When a cluster is upgraded from build 4.2.2087 to <4.3.xxxx> on a 3-node cluster, it is possible that the deploy job is exited and marked completed before cluster upgrade. In such a scenario, if all the pods are healthy, you can deploy the version again.