From 56712a4e84477d9d1bc60144f5afcbeb034242aa Mon Sep 17 00:00:00 2001 From: Michael Vincerra Date: Mon, 10 Dec 2018 15:26:50 -0800 Subject: [PATCH 1/4] Adds internal TOC; troubleshooting detail; fixes format on code-block. Signed-off-by: Michael Vincerra --- source/clear-linux/tutorials/kubernetes.rst | 92 ++++++++++++--------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/source/clear-linux/tutorials/kubernetes.rst b/source/clear-linux/tutorials/kubernetes.rst index 5f491ad6..add6662d 100644 --- a/source/clear-linux/tutorials/kubernetes.rst +++ b/source/clear-linux/tutorials/kubernetes.rst @@ -18,6 +18,9 @@ workloads or multi-tenant scenarios. Kata Containers can be allocated on a per-pod basis so you can mix and match both on the same host to suit your needs. +.. contents:: :local: + :depth: 1 + Prerequisites ************* @@ -183,35 +186,6 @@ Create a symlink for the network overlays: |CL| installs CNI plugins that are part of the `cloud-native-basic` bundle to :file:`/usr/libexec/cni`. The directory is required because `swupd verify` uses it, if necessary, to repair a system to a known good state. -.. TODO: Verify whether to omit this section per mythi, eadamsintel. - -.. **Notes about Weave Net add-on** - -.. If you choose the `Weave Net` add-on, then you must make the following -.. changes because it installs itself in the :file:`/opt/cni/bin` directory. - -.. For using CRI-O and `Weave Net`, you must complete the following -.. steps. - -.. #. Edit the :file:`/etc/crio/crio.conf` file to change `plugin_dir` from: - -.. .. code-block:: bash - -.. plugin_dir = "/usr/libexec/cni/" - -.. to: - -.. .. code-block:: bash - -.. plugin_dir = "/opt/cni/bin" - -.. #. Add the `loopback` CNI plugin to the plugin path with the command: - -.. .. code-block:: bash - -.. sudo ln -s /usr/libexec/cni/loopback /opt/cni/bin/loopback - - Use your cluster **************** @@ -283,17 +257,17 @@ commands as a shell script to configure all of these services in one step: .. code-block:: bash - services=('crio') - for s in "${services[@]}"; do - sudo mkdir -p "/etc/systemd/system/${s}.service.d/" - cat << EOF | sudo tee "/etc/systemd/system/${s}.service.d/proxy.conf" - [Service] - Environment="HTTP_PROXY=${http_proxy}" - Environment="HTTPS_PROXY=${https_proxy}" - Environment="SOCKS_PROXY=${socks_proxy}" - Environment="NO_PROXY=${no_proxy}" - EOF - done + services=('crio') + for s in "${services[@]}"; do + sudo mkdir -p "/etc/systemd/system/${s}.service.d/" + cat << EOF | sudo tee "/etc/systemd/system/${s}.service.d/proxy.conf" + [Service] + Environment="HTTP_PROXY=${http_proxy}" + Environment="HTTPS_PROXY=${https_proxy}" + Environment="SOCKS_PROXY=${socks_proxy}" + Environment="NO_PROXY=${no_proxy}" + EOF + done Troubleshooting *************** @@ -335,6 +309,44 @@ Troubleshooting to set the proxy variables permanently, and how to make them available for all the types of access that you will use, such as remote SSH access. + If the result of the above commands is blank, you may need to add a + `profile` to the `/etc`directory. To do so, follow these steps. + + #. Create a `profile` in :file:`/etc` + + .. code-block:: bash + + sudo touch profile + + #. With a preferred editor, open `profile`, and enter your proxy settings. + Example shown below. + + .. code-block:: bash + + export "HTTP_PROXY=http://proxy.example.com:443" + export "HTTPS_PROXY=http://proxy.example.com:445" + export "SOCKS_PROXY=http://proxy.example.com:1080" + export "NO_PROXY= site.com,.site.com,localhost,127.0.0.1, + + can be obtained by running :command:`ifconfig`. + + #. Save and exit the `profile`. + + #. Run: + + .. code-block:: bash + + sudo source profile + + #. To ssure your system isn't running previous session variables, run: + + .. code-block:: bash + + sudo kubeadm reset --cri-socket=/run/crio/crio.sock + + #. Return to the `kubeadm init` command above. + + * Missing environment variables. If you are behind a proxy server, pass environment variables by adding *-E* From 12eea5d1f8dc11350b1c9856b85817072fb77bcc Mon Sep 17 00:00:00 2001 From: Michael Vincerra Date: Tue, 18 Dec 2018 11:59:43 -0800 Subject: [PATCH 2/4] Fixes typo and clarifies passing `-E` flag in init command. Signed-off-by: Michael Vincerra --- source/clear-linux/tutorials/kubernetes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/clear-linux/tutorials/kubernetes.rst b/source/clear-linux/tutorials/kubernetes.rst index add6662d..f959d94e 100644 --- a/source/clear-linux/tutorials/kubernetes.rst +++ b/source/clear-linux/tutorials/kubernetes.rst @@ -338,13 +338,13 @@ Troubleshooting sudo source profile - #. To ssure your system isn't running previous session variables, run: + #. To assure your system isn't running previous session variables, run: .. code-block:: bash sudo kubeadm reset --cri-socket=/run/crio/crio.sock - #. Return to the `kubeadm init` command above. + #. Continue below and pass the `-E` in the command. * Missing environment variables. From c2cdeb0258059b1b8aa953edde4ddc4292f1de74 Mon Sep 17 00:00:00 2001 From: Michael Vincerra Date: Wed, 19 Dec 2018 18:35:51 -0800 Subject: [PATCH 3/4] Modifications made include: - Removes containers basic and notes - Adds note on CRIO's new default plugin_dir /opt/bin/cni - Adds back the Weave Net add-on plugin. Signed-off-by: Michael Vincerra --- source/clear-linux/tutorials/kubernetes.rst | 44 ++++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/source/clear-linux/tutorials/kubernetes.rst b/source/clear-linux/tutorials/kubernetes.rst index f959d94e..6137bb83 100644 --- a/source/clear-linux/tutorials/kubernetes.rst +++ b/source/clear-linux/tutorials/kubernetes.rst @@ -40,11 +40,19 @@ Install Kubernetes and CRI runtimes *********************************** Kubernetes, a set of supported :abbr:`CRI (Container Runtime Interface)` -runtimes, and networking plugins, are included in the `cloud-native-basic`_ and `containers-basic`_ bundles. To install this framework, enter the following command: +runtimes, and networking plugins, are included in the `cloud-native-basic`_ +bundle. + +.. note:: + + CRI-O’s default plugin_dir is :file:`/opt/bin/cni`. + CNI plugins are installed as part of ``cloud-native-basic``. + +To install this framework, enter the following command: .. code-block:: bash - sudo swupd bundle-add cloud-native-basic containers-basic + sudo swupd bundle-add cloud-native-basic Configure Kubernetes ******************** @@ -174,8 +182,6 @@ If you are using CRI-O and `flannel` and you want to use Kata Containers, edit t [crio.runtime] manage_network_ns_lifecycle = true -.. TODO: Should Weave and Calico be mentioned below, or is Flannel enought? - Create a symlink for the network overlays: .. code-block:: bash @@ -184,7 +190,35 @@ Create a symlink for the network overlays: .. note:: - |CL| installs CNI plugins that are part of the `cloud-native-basic` bundle to :file:`/usr/libexec/cni`. The directory is required because `swupd verify` uses it, if necessary, to repair a system to a known good state. + |CL| installs CNI plugins that are part of the `cloud-native-basic` bundle to :file:`/usr/libexec/cni`. The directory is required because ` + swupd verify` uses it, if necessary, to repair a system to a known good + state. + +**Notes about Weave Net add-on** + +If you choose the `Weave Net` add-on, then you must make the following +changes because it installs itself in the :file:`/opt/cni/bin` directory. + +For using CRI-O and ``Weave Net``, you must complete the following +steps. + +#. Edit the :file:`/etc/crio/crio.conf` file to change `plugin_dir` from: + + .. code-block:: bash + + plugin_dir = "/usr/libexec/cni/" + + to: + + .. code-block:: bash + + plugin_dir = "/opt/bin/cni" + +#. Add the `loopback` CNI plugin to the plugin path with the command: + + code-block:: bash + + sudo ln -s /usr/libexec/cni/loopback /opt/bin/cni/loopback Use your cluster **************** From 90f5872aa720d08a193302ef5cba592f54b7ef0c Mon Sep 17 00:00:00 2001 From: Michael Vincerra Date: Wed, 26 Dec 2018 10:09:53 -0800 Subject: [PATCH 4/4] In Weave Net add-on,removes all steps except loopback symlink. - Other reorganizational edits made for narrative flow. Signed-off-by: Michael Vincerra --- source/clear-linux/tutorials/kubernetes.rst | 38 ++++++--------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/source/clear-linux/tutorials/kubernetes.rst b/source/clear-linux/tutorials/kubernetes.rst index 6137bb83..ddee5687 100644 --- a/source/clear-linux/tutorials/kubernetes.rst +++ b/source/clear-linux/tutorials/kubernetes.rst @@ -24,11 +24,11 @@ to suit your needs. Prerequisites ************* -This tutorial assumes you have installed |CL| and updated to the latest -release on your host system. You can learn about the benefits of having an -up-to-date system for cloud orchestration on the :ref:`swupd-about` -page. For detailed instructions on installing |CL| on a bare metal system, -follow the :ref:`bare metal installation tutorial`. +This tutorial assumes you have already installed |CL|. For detailed +instructions on installing |CL| on a bare metal system, follow the +:ref:`bare metal installation tutorial`. Learn about the +benefits of having an up-to-date system for cloud orchestration on the +:ref:`swupd-about` page. Before you install any new packages, update |CL| with the following command: @@ -190,29 +190,16 @@ Create a symlink for the network overlays: .. note:: - |CL| installs CNI plugins that are part of the `cloud-native-basic` bundle to :file:`/usr/libexec/cni`. The directory is required because ` - swupd verify` uses it, if necessary, to repair a system to a known good - state. + |CL| installs CNI plugins that are part of the `cloud-native-basic` + bundle to :file:`/usr/libexec/cni`. The directory is required because ` + swupd verify` may use it to repair a system to a known good state. **Notes about Weave Net add-on** -If you choose the `Weave Net` add-on, then you must make the following +If you choose the `Weave Net` add-on, you must make the following changes because it installs itself in the :file:`/opt/cni/bin` directory. -For using CRI-O and ``Weave Net``, you must complete the following -steps. - -#. Edit the :file:`/etc/crio/crio.conf` file to change `plugin_dir` from: - - .. code-block:: bash - - plugin_dir = "/usr/libexec/cni/" - - to: - - .. code-block:: bash - - plugin_dir = "/opt/bin/cni" +For using CRI-O and ``Weave Net``, complete the following step. #. Add the `loopback` CNI plugin to the plugin path with the command: @@ -233,7 +220,6 @@ period. The values are presented in a format similar to: kubeadm join : --token --discovery-token-ca-cert-hash - **Congratulations!** You've successfully installed and set up Kubernetes in |CL| using CRI-O and @@ -378,7 +364,7 @@ Troubleshooting sudo kubeadm reset --cri-socket=/run/crio/crio.sock - #. Continue below and pass the `-E` in the command. + #. Continue below while pass `-E` in the command as shown. * Missing environment variables. @@ -398,8 +384,6 @@ Troubleshooting .. _Software Update documentation: https://clearlinux.org/documentation/clear-linux/concepts/swupd-about#updating -.. _containers-basic: https://github.com/clearlinux/clr-bundles/blob/master/bundles/containers-basic - .. _cloud-native-basic: https://github.com/clearlinux/clr-bundles/blob/master/bundles/cloud-native-basic .. _preflight check: https://kubernetes.io/docs/reference/setup-tools/kubeadm/implementation-details/#preflight-checks