blob: 428fa59a4e2e52efdea2e353ab06764a115c44a2 [file] [log] [blame]
Roger Maitlandeb412c62018-05-31 14:09:09 -04001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2018 Amdocs, Bell Canada
4
5.. Links
6.. _HELM Best Practices Guide: https://docs.helm.sh/chart_best_practices/#requirements
7.. _kubectl Cheat Sheet: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
8.. _Kubernetes documentation for emptyDir: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
9.. _Docker DevOps: https://wiki.onap.org/display/DW/Docker+DevOps#DockerDevOps-DockerBuild
10.. _http://cd.onap.info:30223/mso/logging/debug: http://cd.onap.info:30223/mso/logging/debug
11.. _Onboarding and Distributing a Vendor Software Product: https://wiki.onap.org/pages/viewpage.action?pageId=1018474
12.. _README.md: https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/README.md
13
14.. figure:: oomLogoV2-medium.png
15 :align: right
16
17.. _onap-on-kubernetes-with-rancher:
18
Mike Elliottf137b2c2019-04-30 16:28:07 -040019ONAP on HA Kubernetes Cluster
20#############################
Roger Maitlandeb412c62018-05-31 14:09:09 -040021
Mike Elliottf137b2c2019-04-30 16:28:07 -040022This guide provides instructions on how to setup a Highly-Available Kubernetes Cluster.
23For this, we are hosting our cluster on OpenStack VMs and using the Rancher Kubernetes Engine (RKE)
24to deploy and manage our Kubernetes Cluster.
Roger Maitlandeb412c62018-05-31 14:09:09 -040025
Mike Elliott474c3502019-05-09 10:56:16 -040026.. contents::
27 :depth: 1
28 :local:
29..
30
Mike Elliottf137b2c2019-04-30 16:28:07 -040031The result at the end of this tutorial will be:
Roger Maitlandeb412c62018-05-31 14:09:09 -040032
Pawel Wieczorek6278d972019-07-10 18:24:42 +020033#. Creation of a Key Pair to use with Open Stack and RKE
Roger Maitlandeb412c62018-05-31 14:09:09 -040034
Pawel Wieczorek6278d972019-07-10 18:24:42 +020035#. Creation of OpenStack VMs to host Kubernetes Control Plane
Roger Maitlandeb412c62018-05-31 14:09:09 -040036
Pawel Wieczorek6278d972019-07-10 18:24:42 +020037#. Creation of OpenStack VMs to host Kubernetes Workers
Roger Maitlandeb412c62018-05-31 14:09:09 -040038
Pawel Wieczorek6278d972019-07-10 18:24:42 +020039#. Installation and configuration of RKE to setup an HA Kubernetes
Roger Maitlandeb412c62018-05-31 14:09:09 -040040
Pawel Wieczorek6278d972019-07-10 18:24:42 +020041#. Installation and configuration of kubectl
Mike Elliottf137b2c2019-04-30 16:28:07 -040042
Pawel Wieczorek6278d972019-07-10 18:24:42 +020043#. Installation and configuration of helm
Mike Elliottf137b2c2019-04-30 16:28:07 -040044
Pawel Wieczorek6278d972019-07-10 18:24:42 +020045#. Creation of an NFS Server to be used by ONAP as shared persistance
Mike Elliottf137b2c2019-04-30 16:28:07 -040046
47There are many ways one can execute the above steps. Including automation through the use of HEAT to setup the OpenStack VMs.
48To better illustrate the steps involved, we have captured the manual creation of such an environment using the ONAP Wind River Open Lab.
49
Mike Elliottf137b2c2019-04-30 16:28:07 -040050Create Key Pair
51===============
52A Key Pair is required to access the created OpenStack VMs and will be used by
53RKE to configure the VMs for Kubernetes.
54
55Use an existing key pair, import one or create a new one to assign.
56
57.. image:: images/keys/key_pair_1.png
58
59.. Note::
60 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".
61
62For the purpose of this guide, we will assume a new local key called "onap-key"
63has been downloaded and is copied into **~/.ssh/**, from which it can be referenced.
64
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +020065Example::
66
Mike Elliott474c3502019-05-09 10:56:16 -040067 > mv onap-key ~/.ssh
Mike Elliottf137b2c2019-04-30 16:28:07 -040068
Mike Elliott474c3502019-05-09 10:56:16 -040069 > chmod 600 ~/.ssh/onap-key
Mike Elliottf137b2c2019-04-30 16:28:07 -040070
71
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +010072Create Network
73==============
74
75An internal network is required in order to deploy our VMs that will host
76Kubernetes.
77
78.. image:: images/network/network_1.png
79
80.. image:: images/network/network_2.png
81
82.. image:: images/network/network_3.png
83
84.. Note::
85 It's better to have one network per deployment and obviously the name of this
86 network should be unique.
87
88Now we need to create a router to attach this network to outside:
89
90.. image:: images/network/network_4.png
91
92Create Security Group
93=====================
94
95A specific security group is also required
96
97.. image:: images/sg/sg_1.png
98
99then click on `manage rules` of the newly created security group.
100And finally click on `Add Rule` and create the following one:
101
102.. image:: images/sg/sg_2.png
103
104.. Note::
105 the security is clearly not good here and the right SG will be proposed in a
106 future version
107
Mike Elliottf137b2c2019-04-30 16:28:07 -0400108Create Kubernetes Control Plane VMs
109===================================
110
111The following instructions describe how to create 3 OpenStack VMs to host the
112Highly-Available Kubernetes Control Plane.
113ONAP workloads will not be scheduled on these Control Plane nodes.
114
115Launch new VM instances
116-----------------------
117
118.. image:: images/cp_vms/control_plane_1.png
119
120Select Ubuntu 18.04 as base image
Roger Maitlandeb412c62018-05-31 14:09:09 -0400121---------------------------------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400122Select "No" for "Create New Volume"
Roger Maitlandeb412c62018-05-31 14:09:09 -0400123
Mike Elliottf137b2c2019-04-30 16:28:07 -0400124.. image:: images/cp_vms/control_plane_2.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400125
126Select Flavor
127-------------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400128The recommended flavor is at least 4 vCPU and 8GB ram.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400129
Mike Elliottf137b2c2019-04-30 16:28:07 -0400130.. image:: images/cp_vms/control_plane_3.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400131
132Networking
133----------
134
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +0100135Use the created network:
136
Mike Elliottf137b2c2019-04-30 16:28:07 -0400137.. image:: images/cp_vms/control_plane_4.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400138
139Security Groups
140---------------
141
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +0100142Use the created security group:
143
Mike Elliottf137b2c2019-04-30 16:28:07 -0400144.. image:: images/cp_vms/control_plane_5.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400145
146Key Pair
147--------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400148Assign the key pair that was created/selected previously (e.g. onap_key).
Roger Maitlandeb412c62018-05-31 14:09:09 -0400149
Mike Elliottf137b2c2019-04-30 16:28:07 -0400150.. image:: images/cp_vms/control_plane_6.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400151
Mike Elliottf137b2c2019-04-30 16:28:07 -0400152Apply customization script for Control Plane VMs
153------------------------------------------------
Roger Maitlandeb412c62018-05-31 14:09:09 -0400154
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +0100155Click :download:`openstack-k8s-controlnode.sh <openstack-k8s-controlnode.sh>`
Mike Elliottf137b2c2019-04-30 16:28:07 -0400156to download the script.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400157
Mike Elliottf137b2c2019-04-30 16:28:07 -0400158.. literalinclude:: openstack-k8s-controlnode.sh
Roger Maitlandeb412c62018-05-31 14:09:09 -0400159 :language: bash
160
161This customization script will:
162
Mike Elliottf137b2c2019-04-30 16:28:07 -0400163* update ubuntu
Roger Maitlandeb412c62018-05-31 14:09:09 -0400164* install docker
Roger Maitlandeb412c62018-05-31 14:09:09 -0400165
Mike Elliottf137b2c2019-04-30 16:28:07 -0400166.. image:: images/cp_vms/control_plane_7.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400167
168Launch Instance
169---------------
170
Mike Elliottf137b2c2019-04-30 16:28:07 -0400171.. image:: images/cp_vms/control_plane_8.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400172
Roger Maitlandeb412c62018-05-31 14:09:09 -0400173
Roger Maitlandeb412c62018-05-31 14:09:09 -0400174
Mike Elliottf137b2c2019-04-30 16:28:07 -0400175Create Kubernetes Worker VMs
176============================
177The following instructions describe how to create OpenStack VMs to host the
178Highly-Available Kubernetes Workers. ONAP workloads will only be scheduled on these nodes.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400179
Mike Elliottf137b2c2019-04-30 16:28:07 -0400180Launch new VM instances
181-----------------------
Roger Maitlandeb412c62018-05-31 14:09:09 -0400182
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +0100183The number and size of Worker VMs is depenedent on the size of the ONAP deployment.
184By default, all ONAP applications are deployed. It's possible to customize the deployment
Mike Elliottf137b2c2019-04-30 16:28:07 -0400185and enable a subset of the ONAP applications. For the purpose of this guide, however,
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +0100186we will deploy 12 Kubernetes Workers that have been sized to handle the entire ONAP
Mike Elliottf137b2c2019-04-30 16:28:07 -0400187application workload.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400188
Mike Elliottf137b2c2019-04-30 16:28:07 -0400189.. image:: images/wk_vms/worker_1.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400190
Mike Elliottf137b2c2019-04-30 16:28:07 -0400191Select Ubuntu 18.04 as base image
Roger Maitlandeb412c62018-05-31 14:09:09 -0400192---------------------------------
193Select "No" on "Create New Volume"
194
Mike Elliottf137b2c2019-04-30 16:28:07 -0400195.. image:: images/wk_vms/worker_2.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400196
197Select Flavor
198-------------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400199The size of Kubernetes hosts depend on the size of the ONAP deployment
200being installed.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400201
Mike Elliottf137b2c2019-04-30 16:28:07 -0400202If a small subset of ONAP applications are being deployed
203(i.e. for testing purposes), then 16GB or 32GB may be sufficient.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400204
Mike Elliottf137b2c2019-04-30 16:28:07 -0400205.. image:: images/wk_vms/worker_3.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400206
207Networking
208-----------
209
Mike Elliottf137b2c2019-04-30 16:28:07 -0400210.. image:: images/wk_vms/worker_4.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400211
212Security Group
213---------------
214
Mike Elliottf137b2c2019-04-30 16:28:07 -0400215.. image:: images/wk_vms/worker_5.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400216
217Key Pair
218--------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400219Assign the key pair that was created/selected previously (e.g. onap_key).
Roger Maitlandeb412c62018-05-31 14:09:09 -0400220
Mike Elliottf137b2c2019-04-30 16:28:07 -0400221.. image:: images/wk_vms/worker_6.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400222
223Apply customization script for Kubernetes VM(s)
224-----------------------------------------------
225
Mike Elliottf137b2c2019-04-30 16:28:07 -0400226Click :download:`openstack-k8s-workernode.sh <openstack-k8s-workernode.sh>` to download the
227script.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400228
Mike Elliottf137b2c2019-04-30 16:28:07 -0400229.. literalinclude:: openstack-k8s-workernode.sh
Roger Maitlandeb412c62018-05-31 14:09:09 -0400230 :language: bash
231
232This customization script will:
233
Mike Elliottf137b2c2019-04-30 16:28:07 -0400234* update ubuntu
Roger Maitlandeb412c62018-05-31 14:09:09 -0400235* install docker
Mike Elliottf137b2c2019-04-30 16:28:07 -0400236* install nfs common
Roger Maitlandeb412c62018-05-31 14:09:09 -0400237
Roger Maitlandeb412c62018-05-31 14:09:09 -0400238
239Launch Instance
240---------------
241
Mike Elliottf137b2c2019-04-30 16:28:07 -0400242.. image:: images/wk_vms/worker_7.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400243
Roger Maitlandeb412c62018-05-31 14:09:09 -0400244
Roger Maitlandeb412c62018-05-31 14:09:09 -0400245
Mike Elliottf137b2c2019-04-30 16:28:07 -0400246
247Assign Floating IP addresses
248----------------------------
249Assign Floating IPs to all Control Plane and Worker VMs.
250These addresses provide external access to the VMs and will be used by RKE
251to configure kubernetes on to the VMs.
252
253Repeat the following for each VM previously created:
254
255.. image:: images/floating_ips/floating_1.png
256
257Resulting floating IP assignments in this example.
258
259.. image:: images/floating_ips/floating_2.png
260
261
262
263
264Configure Rancher Kubernetes Engine (RKE)
265=========================================
266
267Install RKE
268-----------
269Download and install RKE on a VM, desktop or laptop.
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200270Binaries can be found here for Linux and Mac: https://github.com/rancher/rke/releases/tag/v1.0.6
Mike Elliottf137b2c2019-04-30 16:28:07 -0400271
272RKE requires a *cluster.yml* as input. An example file is show below that
273describes a Kubernetes cluster that will be mapped onto the OpenStack VMs
274created earlier in this guide.
275
Mike Elliottf137b2c2019-04-30 16:28:07 -0400276Click :download:`cluster.yml <cluster.yml>` to download the
277configuration file.
278
279.. literalinclude:: cluster.yml
280 :language: yaml
281
282Prepare cluster.yml
283-------------------
284Before this configuration file can be used the external **address**
285and the **internal_address** must be mapped for each control and worker node
286in this file.
287
288Run RKE
289-------
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200290From within the same directory as the cluster.yml file, simply execute::
Mike Elliottf137b2c2019-04-30 16:28:07 -0400291
Mike Elliott474c3502019-05-09 10:56:16 -0400292 > rke up
Mike Elliottf137b2c2019-04-30 16:28:07 -0400293
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200294The output will look something like::
Mike Elliott474c3502019-05-09 10:56:16 -0400295
Mike Elliottf137b2c2019-04-30 16:28:07 -0400296 INFO[0000] Initiating Kubernetes cluster
297 INFO[0000] [certificates] Generating admin certificates and kubeconfig
298 INFO[0000] Successfully Deployed state file at [./cluster.rkestate]
299 INFO[0000] Building Kubernetes cluster
300 INFO[0000] [dialer] Setup tunnel for host [10.12.6.82]
301 INFO[0000] [dialer] Setup tunnel for host [10.12.6.249]
302 INFO[0000] [dialer] Setup tunnel for host [10.12.6.74]
303 INFO[0000] [dialer] Setup tunnel for host [10.12.6.85]
304 INFO[0000] [dialer] Setup tunnel for host [10.12.6.238]
305 INFO[0000] [dialer] Setup tunnel for host [10.12.6.89]
306 INFO[0000] [dialer] Setup tunnel for host [10.12.5.11]
307 INFO[0000] [dialer] Setup tunnel for host [10.12.6.90]
308 INFO[0000] [dialer] Setup tunnel for host [10.12.6.244]
309 INFO[0000] [dialer] Setup tunnel for host [10.12.5.165]
310 INFO[0000] [dialer] Setup tunnel for host [10.12.6.126]
311 INFO[0000] [dialer] Setup tunnel for host [10.12.6.111]
312 INFO[0000] [dialer] Setup tunnel for host [10.12.5.160]
313 INFO[0000] [dialer] Setup tunnel for host [10.12.5.191]
314 INFO[0000] [dialer] Setup tunnel for host [10.12.6.195]
315 INFO[0002] [network] Deploying port listener containers
316 INFO[0002] [network] Pulling image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.85]
317 INFO[0002] [network] Pulling image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.89]
318 INFO[0002] [network] Pulling image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.90]
319 INFO[0011] [network] Successfully pulled image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.89]
320 . . . .
321 INFO[0309] [addons] Setting up Metrics Server
322 INFO[0309] [addons] Saving ConfigMap for addon rke-metrics-addon to Kubernetes
323 INFO[0309] [addons] Successfully saved ConfigMap for addon rke-metrics-addon to Kubernetes
324 INFO[0309] [addons] Executing deploy job rke-metrics-addon
325 INFO[0315] [addons] Metrics Server deployed successfully
326 INFO[0315] [ingress] Setting up nginx ingress controller
327 INFO[0315] [addons] Saving ConfigMap for addon rke-ingress-controller to Kubernetes
328 INFO[0316] [addons] Successfully saved ConfigMap for addon rke-ingress-controller to Kubernetes
329 INFO[0316] [addons] Executing deploy job rke-ingress-controller
330 INFO[0322] [ingress] ingress controller nginx deployed successfully
331 INFO[0322] [addons] Setting up user addons
332 INFO[0322] [addons] no user addons defined
333 INFO[0322] Finished building Kubernetes cluster successfully
334
335Install Kubectl
336===============
337
338Download and install kubectl. Binaries can be found here for Linux and Mac:
339
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200340https://storage.googleapis.com/kubernetes-release/release/v1.15.11/bin/linux/amd64/kubectl
341https://storage.googleapis.com/kubernetes-release/release/v1.15.11/bin/darwin/amd64/kubectl
Mike Elliottf137b2c2019-04-30 16:28:07 -0400342
Sylvain Desbureaux572c8472020-03-12 08:49:41 +0100343You only need to install kubectl where you'll launch kubernetes command. This
344can be any machines of the kubernetes cluster or a machine that has IP access
345to the APIs.
346Usually, we use the first controller as it has also access to internal
347Kubernetes services, which can be convenient.
348
Mike Elliottf137b2c2019-04-30 16:28:07 -0400349Validate deployment
350-------------------
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200351
352::
353
Mike Elliott474c3502019-05-09 10:56:16 -0400354 > cp kube_config_cluster.yml ~/.kube/config.onap
Mike Elliottf137b2c2019-04-30 16:28:07 -0400355
Mike Elliott474c3502019-05-09 10:56:16 -0400356 > export KUBECONFIG=~/.kube/config.onap
Mike Elliottf137b2c2019-04-30 16:28:07 -0400357
Mike Elliott474c3502019-05-09 10:56:16 -0400358 > kubectl config use-context onap
Mike Elliottf137b2c2019-04-30 16:28:07 -0400359
Mike Elliott474c3502019-05-09 10:56:16 -0400360 > kubectl get nodes -o=wide
Mike Elliottf137b2c2019-04-30 16:28:07 -0400361
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200362::
Mike Elliott474c3502019-05-09 10:56:16 -0400363
Mike Elliottf137b2c2019-04-30 16:28:07 -0400364 NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
Mike Elliotta6243a92019-10-01 13:19:31 -0400365 onap-control-1 Ready controlplane,etcd 3h53m v1.15.2 10.0.0.8 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
366 onap-control-2 Ready controlplane,etcd 3h53m v1.15.2 10.0.0.11 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
367 onap-control-3 Ready controlplane,etcd 3h53m v1.15.2 10.0.0.12 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
368 onap-k8s-1 Ready worker 3h53m v1.15.2 10.0.0.14 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
369 onap-k8s-10 Ready worker 3h53m v1.15.2 10.0.0.16 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
370 onap-k8s-11 Ready worker 3h53m v1.15.2 10.0.0.18 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
371 onap-k8s-12 Ready worker 3h53m v1.15.2 10.0.0.7 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
372 onap-k8s-2 Ready worker 3h53m v1.15.2 10.0.0.26 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
373 onap-k8s-3 Ready worker 3h53m v1.15.2 10.0.0.5 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
374 onap-k8s-4 Ready worker 3h53m v1.15.2 10.0.0.6 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
375 onap-k8s-5 Ready worker 3h53m v1.15.2 10.0.0.9 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
376 onap-k8s-6 Ready worker 3h53m v1.15.2 10.0.0.17 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
377 onap-k8s-7 Ready worker 3h53m v1.15.2 10.0.0.20 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
378 onap-k8s-8 Ready worker 3h53m v1.15.2 10.0.0.10 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
379 onap-k8s-9 Ready worker 3h53m v1.15.2 10.0.0.4 <none> Ubuntu 18.04 LTS 4.15.0-22-generic docker://18.9.5
Mike Elliottf137b2c2019-04-30 16:28:07 -0400380
381
382Install Helm
383============
384
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200385Example Helm client install on Linux::
386
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200387 > wget https://get.helm.sh/helm-v2.16.6-linux-amd64.tar.gz
Mike Elliottf137b2c2019-04-30 16:28:07 -0400388
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200389 > tar -zxvf helm-v2.16.6-linux-amd64.tar.gz
Mike Elliottf137b2c2019-04-30 16:28:07 -0400390
Mike Elliott474c3502019-05-09 10:56:16 -0400391 > sudo mv linux-amd64/helm /usr/local/bin/helm
Mike Elliottf137b2c2019-04-30 16:28:07 -0400392
Mike Elliott474c3502019-05-09 10:56:16 -0400393Initialize Kubernetes Cluster for use by Helm
394---------------------------------------------
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200395
396::
397
Mike Elliott474c3502019-05-09 10:56:16 -0400398 > kubectl -n kube-system create serviceaccount tiller
399
400 > kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
401
402 > helm init --service-account tiller
403
404 > kubectl -n kube-system  rollout status deploy/tiller-deploy
Mike Elliottf137b2c2019-04-30 16:28:07 -0400405
406
Roger Maitlandeb412c62018-05-31 14:09:09 -0400407
408Setting up an NFS share for Multinode Kubernetes Clusters
409=========================================================
Roger Maitlandeb412c62018-05-31 14:09:09 -0400410Deploying applications to a Kubernetes cluster requires Kubernetes nodes to
Mike Elliottf137b2c2019-04-30 16:28:07 -0400411share a common, distributed filesystem. In this tutorial, we will setup an
412NFS Master, and configure all Worker nodes a Kubernetes cluster to play
413the role of NFS slaves.
414
415It is recommneded that a separate VM, outside of the kubernetes
416cluster, be used. This is to ensure that the NFS Master does not compete for
417resources with Kubernetes Control Plane or Worker Nodes.
418
419
420Launch new NFS Server VM instance
421---------------------------------
422.. image:: images/nfs_server/nfs_server_1.png
423
424Select Ubuntu 18.04 as base image
425---------------------------------
426Select "No" on "Create New Volume"
427
428.. image:: images/nfs_server/nfs_server_2.png
429
430Select Flavor
431-------------
432
433.. image:: images/nfs_server/nfs_server_3.png
434
435Networking
436-----------
437
438.. image:: images/nfs_server/nfs_server_4.png
439
440Security Group
441---------------
442
443.. image:: images/nfs_server/nfs_server_5.png
444
445Key Pair
446--------
447Assign the key pair that was created/selected previously (e.g. onap_key).
448
449.. image:: images/nfs_server/nfs_server_6.png
450
451Apply customization script for NFS Server VM
452--------------------------------------------
453
454Click :download:`openstack-nfs-server.sh <openstack-nfs-server.sh>` to download the
455script.
456
ksinghn24738a13612020-02-18 17:57:45 +0530457.. literalinclude:: openstack-nfs-server.sh
Mike Elliottf137b2c2019-04-30 16:28:07 -0400458 :language: bash
459
460This customization script will:
461
462* update ubuntu
463* install nfs server
464
465
466Launch Instance
467---------------
468
469.. image:: images/nfs_server/nfs_server_7.png
470
471
472
473Assign Floating IP addresses
474----------------------------
475
476.. image:: images/nfs_server/nfs_server_8.png
477
478Resulting floating IP assignments in this example.
479
480.. image:: images/nfs_server/nfs_server_9.png
481
482
483To properly set up an NFS share on Master and Slave nodes, the user can run the
484scripts below.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400485
Sylvain Desbureaux7fe7b042019-01-31 17:10:12 +0100486Click :download:`master_nfs_node.sh <master_nfs_node.sh>` to download the
487script.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400488
489.. literalinclude:: master_nfs_node.sh
490 :language: bash
491
492Click :download:`slave_nfs_node.sh <slave_nfs_node.sh>` to download the script.
493
494.. literalinclude:: slave_nfs_node.sh
495 :language: bash
496
497The master_nfs_node.sh script runs in the NFS Master node and needs the list of
498NFS Slave nodes as input, e.g.::
499
Mike Elliott474c3502019-05-09 10:56:16 -0400500 > sudo ./master_nfs_node.sh node1_ip node2_ip ... nodeN_ip
Roger Maitlandeb412c62018-05-31 14:09:09 -0400501
502The slave_nfs_node.sh script runs in each NFS Slave node and needs the IP of
503the NFS Master node as input, e.g.::
504
Mike Elliott474c3502019-05-09 10:56:16 -0400505 > sudo ./slave_nfs_node.sh master_node_ip
Roger Maitlandeb412c62018-05-31 14:09:09 -0400506
Roger Maitlandeb412c62018-05-31 14:09:09 -0400507
508ONAP Deployment via OOM
509=======================
510Now that kubernetes and Helm are installed and configured you can prepare to
511deploy ONAP. Follow the instructions in the README.md_ or look at the official
512documentation to get started:
513
514- :ref:`quick-start-label` - deploy ONAP on an existing cloud
515- :ref:`user-guide-label` - a guide for operators of an ONAP instance