X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=docs%2Foom_setup_kubernetes_rancher.rst;h=767b93925eb2f503f745f2e531c4f0028ff9ccc2;hb=1660a8c5518c45b8a424b15b8c63b71ae0b39c69;hp=428fa59a4e2e52efdea2e353ab06764a115c44a2;hpb=24f8f1de1f261317def33a7f7bc2eb06003e7194;p=oom.git diff --git a/docs/oom_setup_kubernetes_rancher.rst b/docs/oom_setup_kubernetes_rancher.rst index 428fa59a4e..767b93925e 100644 --- a/docs/oom_setup_kubernetes_rancher.rst +++ b/docs/oom_setup_kubernetes_rancher.rst @@ -1,6 +1,7 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. This work is licensed under a Creative Commons Attribution 4.0 +.. International License. .. http://creativecommons.org/licenses/by/4.0 -.. Copyright 2018 Amdocs, Bell Canada +.. Copyright 2018-2020 Amdocs, Bell Canada, Orange, Samsung .. Links .. _HELM Best Practices Guide: https://docs.helm.sh/chart_best_practices/#requirements @@ -11,7 +12,7 @@ .. _Onboarding and Distributing a Vendor Software Product: https://wiki.onap.org/pages/viewpage.action?pageId=1018474 .. _README.md: https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/README.md -.. figure:: oomLogoV2-medium.png +.. figure:: images/oom_logo/oomLogoV2-medium.png :align: right .. _onap-on-kubernetes-with-rancher: @@ -19,9 +20,9 @@ ONAP on HA Kubernetes Cluster ############################# -This guide provides instructions on how to setup a Highly-Available Kubernetes Cluster. -For this, we are hosting our cluster on OpenStack VMs and using the Rancher Kubernetes Engine (RKE) -to deploy and manage our Kubernetes Cluster. +This guide provides instructions on how to setup a Highly-Available Kubernetes +Cluster. 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 @@ -40,12 +41,14 @@ The result at the end of this tutorial will be: #. Installation and configuration of kubectl -#. Installation and configuration of helm +#. Installation and configuration of Helm #. 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. +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. Create Key Pair =============== @@ -57,10 +60,12 @@ Use an existing key pair, import one or create a new one to assign. .. image:: images/keys/key_pair_1.png .. Note:: - If you're creating a new Key Pair, ensure to create a local copy of the Private Key through the use of "Copy Private Key to Clipboard". + If you're creating a new Key Pair, ensure to create a local copy of the + Private Key through the use of "Copy Private Key to Clipboard". 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. +has been downloaded and is copied into **~/.ssh/**, from which it can be +referenced. Example:: @@ -152,10 +157,10 @@ Assign the key pair that was created/selected previously (e.g. onap_key). Apply customization script for Control Plane VMs ------------------------------------------------ -Click :download:`openstack-k8s-controlnode.sh ` +Click :download:`openstack-k8s-controlnode.sh ` to download the script. -.. literalinclude:: openstack-k8s-controlnode.sh +.. literalinclude:: shell/openstack-k8s-controlnode.sh :language: bash This customization script will: @@ -175,16 +180,17 @@ Launch Instance Create Kubernetes Worker VMs ============================ The following instructions describe how to create OpenStack VMs to host the -Highly-Available Kubernetes Workers. ONAP workloads will only be scheduled on these nodes. +Highly-Available Kubernetes Workers. ONAP workloads will only be scheduled on +these nodes. Launch new VM instances ----------------------- -The number and size of Worker VMs is depenedent on the size of the ONAP deployment. -By default, all ONAP applications are deployed. It's possible to customize the deployment -and enable a subset of the ONAP applications. For the purpose of this guide, however, -we will deploy 12 Kubernetes Workers that have been sized to handle the entire ONAP -application workload. +The number and size of Worker VMs is dependent on the size of the ONAP +deployment. By default, all ONAP applications are deployed. It's possible to +customize the deployment and enable a subset of the ONAP applications. For the +purpose of this guide, however, we will deploy 12 Kubernetes Workers that have +been sized to handle the entire ONAP application workload. .. image:: images/wk_vms/worker_1.png @@ -223,10 +229,10 @@ Assign the key pair that was created/selected previously (e.g. onap_key). Apply customization script for Kubernetes VM(s) ----------------------------------------------- -Click :download:`openstack-k8s-workernode.sh ` to download the -script. +Click :download:`openstack-k8s-workernode.sh ` to +download the script. -.. literalinclude:: openstack-k8s-workernode.sh +.. literalinclude:: shell/openstack-k8s-workernode.sh :language: bash This customization script will: @@ -269,14 +275,22 @@ Install RKE Download and install RKE on a VM, desktop or laptop. Binaries can be found here for Linux and Mac: https://github.com/rancher/rke/releases/tag/v1.0.6 +.. note:: + There are several ways to install RKE. Further parts of this documentation + assumes that you have rke command available. + If you don't know how to install RKE you may follow the below steps: + + * chmod +x ./rke_linux-amd64 + * sudo mv ./rke_linux-amd64 /user/local/bin/rke + RKE requires a *cluster.yml* as input. An example file is show below that describes a Kubernetes cluster that will be mapped onto the OpenStack VMs created earlier in this guide. -Click :download:`cluster.yml ` to download the +Click :download:`cluster.yml ` to download the configuration file. -.. literalinclude:: cluster.yml +.. literalinclude:: yaml/cluster.yml :language: yaml Prepare cluster.yml @@ -340,8 +354,8 @@ Download and install kubectl. Binaries can be found here for Linux and Mac: https://storage.googleapis.com/kubernetes-release/release/v1.15.11/bin/linux/amd64/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.15.11/bin/darwin/amd64/kubectl -You only need to install kubectl where you'll launch kubernetes command. This -can be any machines of the kubernetes cluster or a machine that has IP access +You only need to install kubectl where you'll launch Kubernetes command. This +can be any machines of the Kubernetes cluster or a machine that has IP access to the APIs. Usually, we use the first controller as it has also access to internal Kubernetes services, which can be convenient. @@ -351,6 +365,8 @@ Validate deployment :: + > mkdir -p ~/.kube + > cp kube_config_cluster.yml ~/.kube/config.onap > export KUBECONFIG=~/.kube/config.onap @@ -412,7 +428,7 @@ share a common, distributed filesystem. In this tutorial, we will setup an NFS Master, and configure all Worker nodes a Kubernetes cluster to play the role of NFS slaves. -It is recommneded that a separate VM, outside of the kubernetes +It is recommended that a separate VM, outside of the kubernetes cluster, be used. This is to ensure that the NFS Master does not compete for resources with Kubernetes Control Plane or Worker Nodes. @@ -451,10 +467,10 @@ Assign the key pair that was created/selected previously (e.g. onap_key). Apply customization script for NFS Server VM -------------------------------------------- -Click :download:`openstack-nfs-server.sh ` to download the -script. +Click :download:`openstack-nfs-server.sh ` to download +the script. -.. literalinclude:: openstack-nfs-server.sh +.. literalinclude:: shell/openstack-nfs-server.sh :language: bash This customization script will: @@ -483,15 +499,15 @@ Resulting floating IP assignments in this example. To properly set up an NFS share on Master and Slave nodes, the user can run the scripts below. -Click :download:`master_nfs_node.sh ` to download the +Click :download:`master_nfs_node.sh ` to download the script. -.. literalinclude:: master_nfs_node.sh +.. literalinclude:: shell/master_nfs_node.sh :language: bash -Click :download:`slave_nfs_node.sh ` to download the script. +Click :download:`slave_nfs_node.sh ` to download the script. -.. literalinclude:: slave_nfs_node.sh +.. literalinclude:: shell/slave_nfs_node.sh :language: bash The master_nfs_node.sh script runs in the NFS Master node and needs the list of @@ -507,7 +523,7 @@ the NFS Master node as input, e.g.:: ONAP Deployment via OOM ======================= -Now that kubernetes and Helm are installed and configured you can prepare to +Now that Kubernetes and Helm are installed and configured you can prepare to deploy ONAP. Follow the instructions in the README.md_ or look at the official documentation to get started: