blob: 767b93925eb2f503f745f2e531c4f0028ff9ccc2 [file] [log] [blame]
Eric Debeau993b77b2020-08-19 15:30:00 +02001.. This work is licensed under a Creative Commons Attribution 4.0
2.. International License.
Roger Maitlandeb412c62018-05-31 14:09:09 -04003.. http://creativecommons.org/licenses/by/4.0
Eric Debeau993b77b2020-08-19 15:30:00 +02004.. Copyright 2018-2020 Amdocs, Bell Canada, Orange, Samsung
Roger Maitlandeb412c62018-05-31 14:09:09 -04005
6.. Links
7.. _HELM Best Practices Guide: https://docs.helm.sh/chart_best_practices/#requirements
8.. _kubectl Cheat Sheet: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
9.. _Kubernetes documentation for emptyDir: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
10.. _Docker DevOps: https://wiki.onap.org/display/DW/Docker+DevOps#DockerDevOps-DockerBuild
11.. _http://cd.onap.info:30223/mso/logging/debug: http://cd.onap.info:30223/mso/logging/debug
12.. _Onboarding and Distributing a Vendor Software Product: https://wiki.onap.org/pages/viewpage.action?pageId=1018474
13.. _README.md: https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/README.md
14
efiacor1660a8c2022-05-03 16:24:13 +010015.. figure:: images/oom_logo/oomLogoV2-medium.png
Roger Maitlandeb412c62018-05-31 14:09:09 -040016 :align: right
17
18.. _onap-on-kubernetes-with-rancher:
19
Mike Elliottf137b2c2019-04-30 16:28:07 -040020ONAP on HA Kubernetes Cluster
21#############################
Roger Maitlandeb412c62018-05-31 14:09:09 -040022
Eric Debeau993b77b2020-08-19 15:30:00 +020023This guide provides instructions on how to setup a Highly-Available Kubernetes
24Cluster. For this, we are hosting our cluster on OpenStack VMs and using the
25Rancher Kubernetes Engine (RKE) to deploy and manage our Kubernetes Cluster.
Roger Maitlandeb412c62018-05-31 14:09:09 -040026
Mike Elliott474c3502019-05-09 10:56:16 -040027.. contents::
28 :depth: 1
29 :local:
30..
31
Mike Elliottf137b2c2019-04-30 16:28:07 -040032The result at the end of this tutorial will be:
Roger Maitlandeb412c62018-05-31 14:09:09 -040033
Pawel Wieczorek6278d972019-07-10 18:24:42 +020034#. Creation of a Key Pair to use with Open Stack and RKE
Roger Maitlandeb412c62018-05-31 14:09:09 -040035
Pawel Wieczorek6278d972019-07-10 18:24:42 +020036#. Creation of OpenStack VMs to host Kubernetes Control Plane
Roger Maitlandeb412c62018-05-31 14:09:09 -040037
Pawel Wieczorek6278d972019-07-10 18:24:42 +020038#. Creation of OpenStack VMs to host Kubernetes Workers
Roger Maitlandeb412c62018-05-31 14:09:09 -040039
Pawel Wieczorek6278d972019-07-10 18:24:42 +020040#. Installation and configuration of RKE to setup an HA Kubernetes
Roger Maitlandeb412c62018-05-31 14:09:09 -040041
Pawel Wieczorek6278d972019-07-10 18:24:42 +020042#. Installation and configuration of kubectl
Mike Elliottf137b2c2019-04-30 16:28:07 -040043
Eric Debeau993b77b2020-08-19 15:30:00 +020044#. Installation and configuration of Helm
Mike Elliottf137b2c2019-04-30 16:28:07 -040045
Pawel Wieczorek6278d972019-07-10 18:24:42 +020046#. Creation of an NFS Server to be used by ONAP as shared persistance
Mike Elliottf137b2c2019-04-30 16:28:07 -040047
Eric Debeau993b77b2020-08-19 15:30:00 +020048There are many ways one can execute the above steps. Including automation
49through the use of HEAT to setup the OpenStack VMs. To better illustrate the
50steps involved, we have captured the manual creation of such an environment
51using the ONAP Wind River Open Lab.
Mike Elliottf137b2c2019-04-30 16:28:07 -040052
Mike Elliottf137b2c2019-04-30 16:28:07 -040053Create Key Pair
54===============
55A Key Pair is required to access the created OpenStack VMs and will be used by
56RKE to configure the VMs for Kubernetes.
57
58Use an existing key pair, import one or create a new one to assign.
59
60.. image:: images/keys/key_pair_1.png
61
62.. Note::
Eric Debeau993b77b2020-08-19 15:30:00 +020063 If you're creating a new Key Pair, ensure to create a local copy of the
64 Private Key through the use of "Copy Private Key to Clipboard".
Mike Elliottf137b2c2019-04-30 16:28:07 -040065
66For the purpose of this guide, we will assume a new local key called "onap-key"
Eric Debeau993b77b2020-08-19 15:30:00 +020067has been downloaded and is copied into **~/.ssh/**, from which it can be
68referenced.
Mike Elliottf137b2c2019-04-30 16:28:07 -040069
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +020070Example::
71
Mike Elliott474c3502019-05-09 10:56:16 -040072 > mv onap-key ~/.ssh
Mike Elliottf137b2c2019-04-30 16:28:07 -040073
Mike Elliott474c3502019-05-09 10:56:16 -040074 > chmod 600 ~/.ssh/onap-key
Mike Elliottf137b2c2019-04-30 16:28:07 -040075
76
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +010077Create Network
78==============
79
80An internal network is required in order to deploy our VMs that will host
81Kubernetes.
82
83.. image:: images/network/network_1.png
84
85.. image:: images/network/network_2.png
86
87.. image:: images/network/network_3.png
88
89.. Note::
90 It's better to have one network per deployment and obviously the name of this
91 network should be unique.
92
93Now we need to create a router to attach this network to outside:
94
95.. image:: images/network/network_4.png
96
97Create Security Group
98=====================
99
100A specific security group is also required
101
102.. image:: images/sg/sg_1.png
103
104then click on `manage rules` of the newly created security group.
105And finally click on `Add Rule` and create the following one:
106
107.. image:: images/sg/sg_2.png
108
109.. Note::
110 the security is clearly not good here and the right SG will be proposed in a
111 future version
112
Mike Elliottf137b2c2019-04-30 16:28:07 -0400113Create Kubernetes Control Plane VMs
114===================================
115
116The following instructions describe how to create 3 OpenStack VMs to host the
117Highly-Available Kubernetes Control Plane.
118ONAP workloads will not be scheduled on these Control Plane nodes.
119
120Launch new VM instances
121-----------------------
122
123.. image:: images/cp_vms/control_plane_1.png
124
125Select Ubuntu 18.04 as base image
Roger Maitlandeb412c62018-05-31 14:09:09 -0400126---------------------------------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400127Select "No" for "Create New Volume"
Roger Maitlandeb412c62018-05-31 14:09:09 -0400128
Mike Elliottf137b2c2019-04-30 16:28:07 -0400129.. image:: images/cp_vms/control_plane_2.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400130
131Select Flavor
132-------------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400133The recommended flavor is at least 4 vCPU and 8GB ram.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400134
Mike Elliottf137b2c2019-04-30 16:28:07 -0400135.. image:: images/cp_vms/control_plane_3.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400136
137Networking
138----------
139
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +0100140Use the created network:
141
Mike Elliottf137b2c2019-04-30 16:28:07 -0400142.. image:: images/cp_vms/control_plane_4.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400143
144Security Groups
145---------------
146
Sylvain Desbureaux65e5f082020-03-09 12:06:03 +0100147Use the created security group:
148
Mike Elliottf137b2c2019-04-30 16:28:07 -0400149.. image:: images/cp_vms/control_plane_5.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400150
151Key Pair
152--------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400153Assign the key pair that was created/selected previously (e.g. onap_key).
Roger Maitlandeb412c62018-05-31 14:09:09 -0400154
Mike Elliottf137b2c2019-04-30 16:28:07 -0400155.. image:: images/cp_vms/control_plane_6.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400156
Mike Elliottf137b2c2019-04-30 16:28:07 -0400157Apply customization script for Control Plane VMs
158------------------------------------------------
Roger Maitlandeb412c62018-05-31 14:09:09 -0400159
efiacor1660a8c2022-05-03 16:24:13 +0100160Click :download:`openstack-k8s-controlnode.sh <shell/openstack-k8s-controlnode.sh>`
Mike Elliottf137b2c2019-04-30 16:28:07 -0400161to download the script.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400162
efiacor1660a8c2022-05-03 16:24:13 +0100163.. literalinclude:: shell/openstack-k8s-controlnode.sh
Roger Maitlandeb412c62018-05-31 14:09:09 -0400164 :language: bash
165
166This customization script will:
167
Mike Elliottf137b2c2019-04-30 16:28:07 -0400168* update ubuntu
Roger Maitlandeb412c62018-05-31 14:09:09 -0400169* install docker
Roger Maitlandeb412c62018-05-31 14:09:09 -0400170
Mike Elliottf137b2c2019-04-30 16:28:07 -0400171.. image:: images/cp_vms/control_plane_7.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400172
173Launch Instance
174---------------
175
Mike Elliottf137b2c2019-04-30 16:28:07 -0400176.. image:: images/cp_vms/control_plane_8.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400177
Roger Maitlandeb412c62018-05-31 14:09:09 -0400178
Roger Maitlandeb412c62018-05-31 14:09:09 -0400179
Mike Elliottf137b2c2019-04-30 16:28:07 -0400180Create Kubernetes Worker VMs
181============================
182The following instructions describe how to create OpenStack VMs to host the
Eric Debeau993b77b2020-08-19 15:30:00 +0200183Highly-Available Kubernetes Workers. ONAP workloads will only be scheduled on
184these nodes.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400185
Mike Elliottf137b2c2019-04-30 16:28:07 -0400186Launch new VM instances
187-----------------------
Roger Maitlandeb412c62018-05-31 14:09:09 -0400188
Eric Debeau993b77b2020-08-19 15:30:00 +0200189The number and size of Worker VMs is dependent on the size of the ONAP
190deployment. By default, all ONAP applications are deployed. It's possible to
191customize the deployment and enable a subset of the ONAP applications. For the
192purpose of this guide, however, we will deploy 12 Kubernetes Workers that have
193been sized to handle the entire ONAP application workload.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400194
Mike Elliottf137b2c2019-04-30 16:28:07 -0400195.. image:: images/wk_vms/worker_1.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400196
Mike Elliottf137b2c2019-04-30 16:28:07 -0400197Select Ubuntu 18.04 as base image
Roger Maitlandeb412c62018-05-31 14:09:09 -0400198---------------------------------
199Select "No" on "Create New Volume"
200
Mike Elliottf137b2c2019-04-30 16:28:07 -0400201.. image:: images/wk_vms/worker_2.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400202
203Select Flavor
204-------------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400205The size of Kubernetes hosts depend on the size of the ONAP deployment
206being installed.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400207
Mike Elliottf137b2c2019-04-30 16:28:07 -0400208If a small subset of ONAP applications are being deployed
209(i.e. for testing purposes), then 16GB or 32GB may be sufficient.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400210
Mike Elliottf137b2c2019-04-30 16:28:07 -0400211.. image:: images/wk_vms/worker_3.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400212
213Networking
214-----------
215
Mike Elliottf137b2c2019-04-30 16:28:07 -0400216.. image:: images/wk_vms/worker_4.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400217
218Security Group
219---------------
220
Mike Elliottf137b2c2019-04-30 16:28:07 -0400221.. image:: images/wk_vms/worker_5.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400222
223Key Pair
224--------
Mike Elliottf137b2c2019-04-30 16:28:07 -0400225Assign the key pair that was created/selected previously (e.g. onap_key).
Roger Maitlandeb412c62018-05-31 14:09:09 -0400226
Mike Elliottf137b2c2019-04-30 16:28:07 -0400227.. image:: images/wk_vms/worker_6.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400228
229Apply customization script for Kubernetes VM(s)
230-----------------------------------------------
231
efiacor1660a8c2022-05-03 16:24:13 +0100232Click :download:`openstack-k8s-workernode.sh <shell/openstack-k8s-workernode.sh>` to
Eric Debeau993b77b2020-08-19 15:30:00 +0200233download the script.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400234
efiacor1660a8c2022-05-03 16:24:13 +0100235.. literalinclude:: shell/openstack-k8s-workernode.sh
Roger Maitlandeb412c62018-05-31 14:09:09 -0400236 :language: bash
237
238This customization script will:
239
Mike Elliottf137b2c2019-04-30 16:28:07 -0400240* update ubuntu
Roger Maitlandeb412c62018-05-31 14:09:09 -0400241* install docker
Mike Elliottf137b2c2019-04-30 16:28:07 -0400242* install nfs common
Roger Maitlandeb412c62018-05-31 14:09:09 -0400243
Roger Maitlandeb412c62018-05-31 14:09:09 -0400244
245Launch Instance
246---------------
247
Mike Elliottf137b2c2019-04-30 16:28:07 -0400248.. image:: images/wk_vms/worker_7.png
Roger Maitlandeb412c62018-05-31 14:09:09 -0400249
Roger Maitlandeb412c62018-05-31 14:09:09 -0400250
Roger Maitlandeb412c62018-05-31 14:09:09 -0400251
Mike Elliottf137b2c2019-04-30 16:28:07 -0400252
253Assign Floating IP addresses
254----------------------------
255Assign Floating IPs to all Control Plane and Worker VMs.
256These addresses provide external access to the VMs and will be used by RKE
257to configure kubernetes on to the VMs.
258
259Repeat the following for each VM previously created:
260
261.. image:: images/floating_ips/floating_1.png
262
263Resulting floating IP assignments in this example.
264
265.. image:: images/floating_ips/floating_2.png
266
267
268
269
270Configure Rancher Kubernetes Engine (RKE)
271=========================================
272
273Install RKE
274-----------
275Download and install RKE on a VM, desktop or laptop.
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200276Binaries 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 -0400277
ramagp07e2d452020-08-04 07:24:49 +0000278.. note::
guillaume.lambertf3319a82021-09-26 21:37:50 +0200279 There are several ways to install RKE. Further parts of this documentation
280 assumes that you have rke command available.
ramagp07e2d452020-08-04 07:24:49 +0000281 If you don't know how to install RKE you may follow the below steps:
282
283 * chmod +x ./rke_linux-amd64
284 * sudo mv ./rke_linux-amd64 /user/local/bin/rke
285
Mike Elliottf137b2c2019-04-30 16:28:07 -0400286RKE requires a *cluster.yml* as input. An example file is show below that
287describes a Kubernetes cluster that will be mapped onto the OpenStack VMs
288created earlier in this guide.
289
efiacor1660a8c2022-05-03 16:24:13 +0100290Click :download:`cluster.yml <yaml/cluster.yml>` to download the
Mike Elliottf137b2c2019-04-30 16:28:07 -0400291configuration file.
292
efiacor1660a8c2022-05-03 16:24:13 +0100293.. literalinclude:: yaml/cluster.yml
Mike Elliottf137b2c2019-04-30 16:28:07 -0400294 :language: yaml
295
296Prepare cluster.yml
297-------------------
298Before this configuration file can be used the external **address**
299and the **internal_address** must be mapped for each control and worker node
300in this file.
301
302Run RKE
303-------
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200304From within the same directory as the cluster.yml file, simply execute::
Mike Elliottf137b2c2019-04-30 16:28:07 -0400305
Mike Elliott474c3502019-05-09 10:56:16 -0400306 > rke up
Mike Elliottf137b2c2019-04-30 16:28:07 -0400307
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200308The output will look something like::
Mike Elliott474c3502019-05-09 10:56:16 -0400309
Mike Elliottf137b2c2019-04-30 16:28:07 -0400310 INFO[0000] Initiating Kubernetes cluster
311 INFO[0000] [certificates] Generating admin certificates and kubeconfig
312 INFO[0000] Successfully Deployed state file at [./cluster.rkestate]
313 INFO[0000] Building Kubernetes cluster
314 INFO[0000] [dialer] Setup tunnel for host [10.12.6.82]
315 INFO[0000] [dialer] Setup tunnel for host [10.12.6.249]
316 INFO[0000] [dialer] Setup tunnel for host [10.12.6.74]
317 INFO[0000] [dialer] Setup tunnel for host [10.12.6.85]
318 INFO[0000] [dialer] Setup tunnel for host [10.12.6.238]
319 INFO[0000] [dialer] Setup tunnel for host [10.12.6.89]
320 INFO[0000] [dialer] Setup tunnel for host [10.12.5.11]
321 INFO[0000] [dialer] Setup tunnel for host [10.12.6.90]
322 INFO[0000] [dialer] Setup tunnel for host [10.12.6.244]
323 INFO[0000] [dialer] Setup tunnel for host [10.12.5.165]
324 INFO[0000] [dialer] Setup tunnel for host [10.12.6.126]
325 INFO[0000] [dialer] Setup tunnel for host [10.12.6.111]
326 INFO[0000] [dialer] Setup tunnel for host [10.12.5.160]
327 INFO[0000] [dialer] Setup tunnel for host [10.12.5.191]
328 INFO[0000] [dialer] Setup tunnel for host [10.12.6.195]
329 INFO[0002] [network] Deploying port listener containers
330 INFO[0002] [network] Pulling image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.85]
331 INFO[0002] [network] Pulling image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.89]
332 INFO[0002] [network] Pulling image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.90]
333 INFO[0011] [network] Successfully pulled image [nexus3.onap.org:10001/rancher/rke-tools:v0.1.27] on host [10.12.6.89]
334 . . . .
335 INFO[0309] [addons] Setting up Metrics Server
336 INFO[0309] [addons] Saving ConfigMap for addon rke-metrics-addon to Kubernetes
337 INFO[0309] [addons] Successfully saved ConfigMap for addon rke-metrics-addon to Kubernetes
338 INFO[0309] [addons] Executing deploy job rke-metrics-addon
339 INFO[0315] [addons] Metrics Server deployed successfully
340 INFO[0315] [ingress] Setting up nginx ingress controller
341 INFO[0315] [addons] Saving ConfigMap for addon rke-ingress-controller to Kubernetes
342 INFO[0316] [addons] Successfully saved ConfigMap for addon rke-ingress-controller to Kubernetes
343 INFO[0316] [addons] Executing deploy job rke-ingress-controller
344 INFO[0322] [ingress] ingress controller nginx deployed successfully
345 INFO[0322] [addons] Setting up user addons
346 INFO[0322] [addons] no user addons defined
347 INFO[0322] Finished building Kubernetes cluster successfully
348
349Install Kubectl
350===============
351
352Download and install kubectl. Binaries can be found here for Linux and Mac:
353
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200354https://storage.googleapis.com/kubernetes-release/release/v1.15.11/bin/linux/amd64/kubectl
355https://storage.googleapis.com/kubernetes-release/release/v1.15.11/bin/darwin/amd64/kubectl
Mike Elliottf137b2c2019-04-30 16:28:07 -0400356
Eric Debeau993b77b2020-08-19 15:30:00 +0200357You only need to install kubectl where you'll launch Kubernetes command. This
358can be any machines of the Kubernetes cluster or a machine that has IP access
Sylvain Desbureaux572c8472020-03-12 08:49:41 +0100359to the APIs.
360Usually, we use the first controller as it has also access to internal
361Kubernetes services, which can be convenient.
362
Mike Elliottf137b2c2019-04-30 16:28:07 -0400363Validate deployment
364-------------------
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200365
366::
367
ramagp07e2d452020-08-04 07:24:49 +0000368 > mkdir -p ~/.kube
369
Mike Elliott474c3502019-05-09 10:56:16 -0400370 > cp kube_config_cluster.yml ~/.kube/config.onap
Mike Elliottf137b2c2019-04-30 16:28:07 -0400371
Mike Elliott474c3502019-05-09 10:56:16 -0400372 > export KUBECONFIG=~/.kube/config.onap
Mike Elliottf137b2c2019-04-30 16:28:07 -0400373
Mike Elliott474c3502019-05-09 10:56:16 -0400374 > kubectl config use-context onap
Mike Elliottf137b2c2019-04-30 16:28:07 -0400375
Mike Elliott474c3502019-05-09 10:56:16 -0400376 > kubectl get nodes -o=wide
Mike Elliottf137b2c2019-04-30 16:28:07 -0400377
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200378::
Mike Elliott474c3502019-05-09 10:56:16 -0400379
Mike Elliottf137b2c2019-04-30 16:28:07 -0400380 NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
Mike Elliotta6243a92019-10-01 13:19:31 -0400381 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
382 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
383 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
384 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
385 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
386 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
387 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
388 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
389 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
390 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
391 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
392 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
393 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
394 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
395 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 -0400396
397
398Install Helm
399============
400
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200401Example Helm client install on Linux::
402
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200403 > wget https://get.helm.sh/helm-v2.16.6-linux-amd64.tar.gz
Mike Elliottf137b2c2019-04-30 16:28:07 -0400404
Sylvain Desbureauxcff4b652020-04-20 13:15:36 +0200405 > tar -zxvf helm-v2.16.6-linux-amd64.tar.gz
Mike Elliottf137b2c2019-04-30 16:28:07 -0400406
Mike Elliott474c3502019-05-09 10:56:16 -0400407 > sudo mv linux-amd64/helm /usr/local/bin/helm
Mike Elliottf137b2c2019-04-30 16:28:07 -0400408
Mike Elliott474c3502019-05-09 10:56:16 -0400409Initialize Kubernetes Cluster for use by Helm
410---------------------------------------------
Pawel Wieczorek3fd3e272019-07-10 18:08:19 +0200411
412::
413
Mike Elliott474c3502019-05-09 10:56:16 -0400414 > kubectl -n kube-system create serviceaccount tiller
415
416 > kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
417
418 > helm init --service-account tiller
419
420 > kubectl -n kube-system  rollout status deploy/tiller-deploy
Mike Elliottf137b2c2019-04-30 16:28:07 -0400421
422
Roger Maitlandeb412c62018-05-31 14:09:09 -0400423
424Setting up an NFS share for Multinode Kubernetes Clusters
425=========================================================
Roger Maitlandeb412c62018-05-31 14:09:09 -0400426Deploying applications to a Kubernetes cluster requires Kubernetes nodes to
Mike Elliottf137b2c2019-04-30 16:28:07 -0400427share a common, distributed filesystem. In this tutorial, we will setup an
428NFS Master, and configure all Worker nodes a Kubernetes cluster to play
429the role of NFS slaves.
430
guillaume.lambertb90e8fc2021-09-26 21:28:50 +0200431It is recommended that a separate VM, outside of the kubernetes
Mike Elliottf137b2c2019-04-30 16:28:07 -0400432cluster, be used. This is to ensure that the NFS Master does not compete for
433resources with Kubernetes Control Plane or Worker Nodes.
434
435
436Launch new NFS Server VM instance
437---------------------------------
438.. image:: images/nfs_server/nfs_server_1.png
439
440Select Ubuntu 18.04 as base image
441---------------------------------
442Select "No" on "Create New Volume"
443
444.. image:: images/nfs_server/nfs_server_2.png
445
446Select Flavor
447-------------
448
449.. image:: images/nfs_server/nfs_server_3.png
450
451Networking
452-----------
453
454.. image:: images/nfs_server/nfs_server_4.png
455
456Security Group
457---------------
458
459.. image:: images/nfs_server/nfs_server_5.png
460
461Key Pair
462--------
463Assign the key pair that was created/selected previously (e.g. onap_key).
464
465.. image:: images/nfs_server/nfs_server_6.png
466
467Apply customization script for NFS Server VM
468--------------------------------------------
469
efiacor1660a8c2022-05-03 16:24:13 +0100470Click :download:`openstack-nfs-server.sh <shell/openstack-nfs-server.sh>` to download
Eric Debeau993b77b2020-08-19 15:30:00 +0200471the script.
Mike Elliottf137b2c2019-04-30 16:28:07 -0400472
efiacor1660a8c2022-05-03 16:24:13 +0100473.. literalinclude:: shell/openstack-nfs-server.sh
Mike Elliottf137b2c2019-04-30 16:28:07 -0400474 :language: bash
475
476This customization script will:
477
478* update ubuntu
479* install nfs server
480
481
482Launch Instance
483---------------
484
485.. image:: images/nfs_server/nfs_server_7.png
486
487
488
489Assign Floating IP addresses
490----------------------------
491
492.. image:: images/nfs_server/nfs_server_8.png
493
494Resulting floating IP assignments in this example.
495
496.. image:: images/nfs_server/nfs_server_9.png
497
498
499To properly set up an NFS share on Master and Slave nodes, the user can run the
500scripts below.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400501
efiacor1660a8c2022-05-03 16:24:13 +0100502Click :download:`master_nfs_node.sh <shell/master_nfs_node.sh>` to download the
Sylvain Desbureaux7fe7b042019-01-31 17:10:12 +0100503script.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400504
efiacor1660a8c2022-05-03 16:24:13 +0100505.. literalinclude:: shell/master_nfs_node.sh
Roger Maitlandeb412c62018-05-31 14:09:09 -0400506 :language: bash
507
efiacor1660a8c2022-05-03 16:24:13 +0100508Click :download:`slave_nfs_node.sh <shell/slave_nfs_node.sh>` to download the script.
Roger Maitlandeb412c62018-05-31 14:09:09 -0400509
efiacor1660a8c2022-05-03 16:24:13 +0100510.. literalinclude:: shell/slave_nfs_node.sh
Roger Maitlandeb412c62018-05-31 14:09:09 -0400511 :language: bash
512
513The master_nfs_node.sh script runs in the NFS Master node and needs the list of
514NFS Slave nodes as input, e.g.::
515
Mike Elliott474c3502019-05-09 10:56:16 -0400516 > sudo ./master_nfs_node.sh node1_ip node2_ip ... nodeN_ip
Roger Maitlandeb412c62018-05-31 14:09:09 -0400517
518The slave_nfs_node.sh script runs in each NFS Slave node and needs the IP of
519the NFS Master node as input, e.g.::
520
Mike Elliott474c3502019-05-09 10:56:16 -0400521 > sudo ./slave_nfs_node.sh master_node_ip
Roger Maitlandeb412c62018-05-31 14:09:09 -0400522
Roger Maitlandeb412c62018-05-31 14:09:09 -0400523
524ONAP Deployment via OOM
525=======================
Eric Debeau993b77b2020-08-19 15:30:00 +0200526Now that Kubernetes and Helm are installed and configured you can prepare to
Roger Maitlandeb412c62018-05-31 14:09:09 -0400527deploy ONAP. Follow the instructions in the README.md_ or look at the official
528documentation to get started:
529
530- :ref:`quick-start-label` - deploy ONAP on an existing cloud
531- :ref:`user-guide-label` - a guide for operators of an ONAP instance