From aae3b1f10cc4666bdbb0c5dc2b74b70a2d95660f Mon Sep 17 00:00:00 2001 From: Michael Vincerra Date: Fri, 25 Jan 2019 15:43:17 -0800 Subject: [PATCH] Adds kubernetes-bp and organizes in new kubernetes folder. Signed-off-by: Michael Vincerra --- .../tutorials/kubernetes/kubernetes-bp.rst | 104 ++++++++++++++++++ .../tutorials/{ => kubernetes}/kubernetes.rst | 0 2 files changed, 104 insertions(+) create mode 100644 source/clear-linux/tutorials/kubernetes/kubernetes-bp.rst rename source/clear-linux/tutorials/{ => kubernetes}/kubernetes.rst (100%) diff --git a/source/clear-linux/tutorials/kubernetes/kubernetes-bp.rst b/source/clear-linux/tutorials/kubernetes/kubernetes-bp.rst new file mode 100644 index 00000000..3c241cb2 --- /dev/null +++ b/source/clear-linux/tutorials/kubernetes/kubernetes-bp.rst @@ -0,0 +1,104 @@ +.. _kubernetes-bp: + +Kubernetes Best Practices on |CL| +################################# + +This tutorial shows you how to manage your Kubernetes cluster while using +:command:`swupd` to update |CL-ATTR|. + +In our tutorial :ref:`kubernetes`, we explain how to set up a Kubernetes +cluster on |CL| using `kubeadm`. `Kubeadm documentation`_ often builds on the +assumption that the distribution uses a traditional package manager (e.g., +RPM/DEB). In contrast, |CL| manages packages in bundles. This document +describes best practices to manage cluster upgrades with kubeadm on a |CL|-based cluster. + +Prerequisites +************** + +Let's review some basic assumptions: + +* |CL| includes Kubernetes support with the `cloud-native-basic` bundle. + +* Execute :command:`sudo swupd update` **on each node** to do the update. + +* Repeat the above command for both master and worker nodes. + +Executing this command updates all of the kubernetes node and client +binaries simultaneously, which are part of `cloud-native-basic` bundle +(including kubectl, kubeadm, kubelet). + +.. note:: + + Oher Linux\* distros shown in Kubernetes upgrade documentation reflect + `apt-get update`, `apt-mark hold kubeadm`, and similar commands; however, such commands **aren not valid** on |CL|. + + +Update the cluster +****************** +#. Read kubernetes documentation `before you begin`_. + +#. On your master node, run the command: + + .. code-block:: bash + + sudo swupd update + +#. Run this command to check the message-of-the-day, or `motd`: + + .. code-block:: bash + + cat /run/motd + +#. Next, ....[Explain resultant actions/choices from above] + + .. note:: + + Swupd post install script adds a message-of-the-day to warn/notify + users if the OS update installs a new kubernetes version that is not + compatible (according to kubernetes API guarantee) with the previous + version. If the `motd` appears, a kubelet restart on master and nodes + must be postponed until the control plane is properly updated. + :command:`swupd update` does not restart services automatically unless + explicitly configured to do so (be warned about making kubelet + automatically restartable). + + .. note:: Do not restart the kubelet before the control plane is updated. + +#. Now follow these instructions in kubernetes documentation. + + * `Upgrade control plane`_ + * `Drain control plane node`_ + * `Restart Kubelet and undrain node`_ + + +Update worker nodes +******************* + +#. On each worker node, run the command: + + .. code-block:: bash + + sudo swupd update + +#. Now follow these instructions in kubernetes documentation: + + * `Drain node`_ + * `Update kubelet configuration`_ + * `Restart Kubelet and undrain node`_ + + +.. _Restart Keubelet and undrain node: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/#restart-the-kubelet-for-all-nodes + +.. _Update kubelet configuration: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/#upgrade-the-kubelet-config-on-worker-nodes + +.. _Drain node: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/#drain-control-plane-and-worker-nodes + + .. _Restart kubelet and undrain node: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/#restart-the-kubelet-for-all-nodes + +.. _Upgrade control plane: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/#upgrade-the-control-plane-node + +.. _Drain control plane node: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/#drain-control-plane-and-worker-nodes + +.. _Kubeadmn documentation: https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/ + +.. _before you begin: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/#before-you-begin \ No newline at end of file diff --git a/source/clear-linux/tutorials/kubernetes.rst b/source/clear-linux/tutorials/kubernetes/kubernetes.rst similarity index 100% rename from source/clear-linux/tutorials/kubernetes.rst rename to source/clear-linux/tutorials/kubernetes/kubernetes.rst