X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=docs%2Foom_setup_kubernetes_rancher.rst;h=f703c068b3de062a93330b0e0fbddd48337b64fa;hb=5a497debc75a095133c2e7dd9829d356c2e5fd84;hp=ebc44e6a96f32dc42ffff8a884fe3871cb7e127c;hpb=d2eff370d0c15727568e9d977bd737e59b2e1141;p=oom.git diff --git a/docs/oom_setup_kubernetes_rancher.rst b/docs/oom_setup_kubernetes_rancher.rst index ebc44e6a96..f703c068b3 100644 --- a/docs/oom_setup_kubernetes_rancher.rst +++ b/docs/oom_setup_kubernetes_rancher.rst @@ -23,30 +23,30 @@ This guide provides instructions on how to setup a Highly-Available Kubernetes C For this, we are hosting our cluster on OpenStack VMs and using the Rancher Kubernetes Engine (RKE) to deploy and manage our Kubernetes Cluster. +.. contents:: + :depth: 1 + :local: +.. + The result at the end of this tutorial will be: -*1.* Creation of a Key Pair to use with Open Stack and RKE +#. Creation of a Key Pair to use with Open Stack and RKE -*2.* Creation of OpenStack VMs to host Kubernetes Control Plane +#. Creation of OpenStack VMs to host Kubernetes Control Plane -*3.* Creation of OpenStack VMs to host Kubernetes Workers +#. Creation of OpenStack VMs to host Kubernetes Workers -*4.* Installation and configuration of RKE to setup an HA Kubernetes +#. Installation and configuration of RKE to setup an HA Kubernetes -*5.* Installation and configuration of kubectl +#. Installation and configuration of kubectl -*5.* Installation and configuration of helm +#. Installation and configuration of helm -*7.* Creation of an NFS Server to be used by ONAP as shared persistance +#. Creation of an NFS Server to be used by ONAP as shared persistance There are many ways one can execute the above steps. Including automation through the use of HEAT to setup the OpenStack VMs. To better illustrate the steps involved, we have captured the manual creation of such an environment using the ONAP Wind River Open Lab. -.. contents:: - :depth: 1 - :local: -.. - Create Key Pair =============== A Key Pair is required to access the created OpenStack VMs and will be used by @@ -62,10 +62,11 @@ Use an existing key pair, import one or create a new one to assign. For the purpose of this guide, we will assume a new local key called "onap-key" has been downloaded and is copied into **~/.ssh/**, from which it can be referenced. -Example: - $ mv onap-key ~/.ssh +Example:: - $ chmod 600 ~/.ssh/onap-key + > mv onap-key ~/.ssh + + > chmod 600 ~/.ssh/onap-key Create Kubernetes Control Plane VMs @@ -250,13 +251,12 @@ in this file. Run RKE ------- -From within the same directory as the cluster.yml file, simply execute: +From within the same directory as the cluster.yml file, simply execute:: - $ rke up + > rke up -The output will look something like: +The output will look something like:: -.. code-block:: INFO[0000] Initiating Kubernetes cluster INFO[0000] [certificates] Generating admin certificates and kubeconfig INFO[0000] Successfully Deployed state file at [./cluster.rkestate] @@ -301,48 +301,65 @@ Install Kubectl Download and install kubectl. Binaries can be found here for Linux and Mac: -https://storage.googleapis.com/kubernetes-release/release/v1.13.5/bin/linux/amd64/kubectl -https://storage.googleapis.com/kubernetes-release/release/v1.13.5/bin/darwin/amd64/kubectl +https://storage.googleapis.com/kubernetes-release/release/v1.15.2/bin/linux/amd64/kubectl +https://storage.googleapis.com/kubernetes-release/release/v1.15.2/bin/darwin/amd64/kubectl Validate deployment ------------------- - $ cp kube_config_cluster.yml ~/.kube/config.onap - $ export KUBECONFIG=~/.kube/config.onap +:: + + > cp kube_config_cluster.yml ~/.kube/config.onap + + > export KUBECONFIG=~/.kube/config.onap - $ kubectl config use-context onap + > kubectl config use-context onap - $ kubectl get nodes -o=wide + > kubectl get nodes -o=wide + +:: -.. code-block:: NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME - onap-control-1 Ready controlplane,etcd 3h53m v1.13.5 10.0.0.8 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-control-2 Ready controlplane,etcd 3h53m v1.13.5 10.0.0.11 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-control-3 Ready controlplane,etcd 3h53m v1.13.5 10.0.0.12 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-1 Ready worker 3h53m v1.13.5 10.0.0.14 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-10 Ready worker 3h53m v1.13.5 10.0.0.16 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-11 Ready worker 3h53m v1.13.5 10.0.0.18 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-12 Ready worker 3h53m v1.13.5 10.0.0.7 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-2 Ready worker 3h53m v1.13.5 10.0.0.26 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-3 Ready worker 3h53m v1.13.5 10.0.0.5 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-4 Ready worker 3h53m v1.13.5 10.0.0.6 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-5 Ready worker 3h53m v1.13.5 10.0.0.9 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-6 Ready worker 3h53m v1.13.5 10.0.0.17 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-7 Ready worker 3h53m v1.13.5 10.0.0.20 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-8 Ready worker 3h53m v1.13.5 10.0.0.10 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 - onap-k8s-9 Ready worker 3h53m v1.13.5 10.0.0.4 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-control-1 Ready controlplane,etcd 3h53m v1.15.2 10.0.0.8 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-control-2 Ready controlplane,etcd 3h53m v1.15.2 10.0.0.11 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-control-3 Ready controlplane,etcd 3h53m v1.15.2 10.0.0.12 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-1 Ready worker 3h53m v1.15.2 10.0.0.14 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-10 Ready worker 3h53m v1.15.2 10.0.0.16 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-11 Ready worker 3h53m v1.15.2 10.0.0.18 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-12 Ready worker 3h53m v1.15.2 10.0.0.7 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-2 Ready worker 3h53m v1.15.2 10.0.0.26 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-3 Ready worker 3h53m v1.15.2 10.0.0.5 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-4 Ready worker 3h53m v1.15.2 10.0.0.6 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-5 Ready worker 3h53m v1.15.2 10.0.0.9 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-6 Ready worker 3h53m v1.15.2 10.0.0.17 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-7 Ready worker 3h53m v1.15.2 10.0.0.20 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-8 Ready worker 3h53m v1.15.2 10.0.0.10 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 + onap-k8s-9 Ready worker 3h53m v1.15.2 10.0.0.4 Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5 Install Helm ============ - $ kubectl -n kube-system create serviceaccount tiller +Example Helm client install on Linux:: + + > wget http://storage.googleapis.com/kubernetes-helm/helm-v2.14.2-linux-amd64.tar.gz + + > tar -zxvf helm-v2.14.2-linux-amd64.tar.gz + + > sudo mv linux-amd64/helm /usr/local/bin/helm + +Initialize Kubernetes Cluster for use by Helm +--------------------------------------------- + +:: + + > kubectl -n kube-system create serviceaccount tiller - $ kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller + > kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller - $ helm init --service-account tiller + > helm init --service-account tiller - $ kubectl -n kube-system  rollout status deploy/tiller-deploy + > kubectl -n kube-system  rollout status deploy/tiller-deploy @@ -438,12 +455,12 @@ Click :download:`slave_nfs_node.sh ` to download the script. The master_nfs_node.sh script runs in the NFS Master node and needs the list of NFS Slave nodes as input, e.g.:: - $ sudo ./master_nfs_node.sh node1_ip node2_ip ... nodeN_ip + > sudo ./master_nfs_node.sh node1_ip node2_ip ... nodeN_ip The slave_nfs_node.sh script runs in each NFS Slave node and needs the IP of the NFS Master node as input, e.g.:: - $ sudo ./slave_nfs_node.sh master_node_ip + > sudo ./slave_nfs_node.sh master_node_ip ONAP Deployment via OOM