[DCAEGEN2] Update PMSH image version
[oom.git] / docs / sections / guides / infra_guides / oom_base_config_setup.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. Copyright (C) 2022 Nordix Foundation
5
6 .. Links
7 .. _HELM Best Practices Guide: https://docs.helm.sh/chart_best_practices/#requirements
8 .. _helm installation guide: https://helm.sh/docs/intro/install/
9 .. _kubectl installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
10 .. _Curated applications for Kubernetes: https://github.com/kubernetes/charts
11 .. _Cert-Manager Installation documentation: https://cert-manager.io/docs/installation/kubernetes/
12 .. _Cert-Manager kubectl plugin documentation: https://cert-manager.io/docs/usage/kubectl-plugin/
13 .. _Strimzi Apache Kafka Operator helm Installation documentation: https://strimzi.io/docs/operators/in-development/deploying.html#deploying-cluster-operator-helm-chart-str
14
15 .. _oom_base_setup_guide:
16
17 OOM Base Platform
18 #################
19
20 As part of the initial base setup of the host Kubernetes cluster,
21 the following mandatory installation and configuration steps must be completed.
22
23 .. contents::
24    :backlinks: top
25    :depth: 1
26    :local:
27 ..
28
29 For additional platform add-ons, see the :ref:`oom_base_optional_addons` section.
30
31 Install & configure kubectl
32 ***************************
33 The Kubernetes command line interface used to manage a Kubernetes cluster needs to be installed
34 and configured to run as non root.
35
36 For additional information regarding kubectl installation and configuration see the `kubectl installation guide`_
37
38 To install kubectl, execute the following, replacing the <recommended-kubectl-version> with the version defined
39 in the :ref:`versions_table` table::
40
41     > curl -LO https://dl.k8s.io/release/v<recommended-kubectl-version>/bin/linux/amd64/kubectl
42
43     > chmod +x ./kubectl
44
45     > sudo mv ./kubectl /usr/local/bin/kubectl
46
47     > mkdir ~/.kube
48
49     > cp kube_config_cluster.yml ~/.kube/config.onap
50
51     > export KUBECONFIG=~/.kube/config.onap
52
53     > kubectl config use-context onap
54
55 Validate the installation::
56
57     > kubectl get nodes
58
59 ::
60
61   NAME             STATUS   ROLES               AGE     VERSION
62   onap-control-1   Ready    controlplane,etcd   3h53m   v1.23.8
63   onap-control-2   Ready    controlplane,etcd   3h53m   v1.23.8
64   onap-k8s-1       Ready    worker              3h53m   v1.23.8
65   onap-k8s-2       Ready    worker              3h53m   v1.23.8
66   onap-k8s-3       Ready    worker              3h53m   v1.23.8
67   onap-k8s-4       Ready    worker              3h53m   v1.23.8
68   onap-k8s-5       Ready    worker              3h53m   v1.23.8
69   onap-k8s-6       Ready    worker              3h53m   v1.23.8
70
71
72 Install & configure helm
73 ************************
74 Helm is used for package and configuration management of the relevant helm charts.
75 For additional information, see the `helm installation guide`_
76
77 To install helm, execute the following, replacing the <recommended-helm-version> with the version defined
78 in the :ref:`versions_table` table::
79
80     > wget https://get.helm.sh/helm-v<recommended-helm-version>-linux-amd64.tar.gz
81
82     > tar -zxvf helm-v<recommended-helm-version>-linux-amd64.tar.gz
83
84     > sudo mv linux-amd64/helm /usr/local/bin/helm
85
86 Verify the helm version with::
87
88     > helm version
89
90 Helm's default CNCF provided `Curated applications for Kubernetes`_ repository called
91 *stable* can be removed to avoid confusion::
92
93     > helm repo remove stable
94
95 Install the additional OOM plugins required to un/deploy the OOM helm charts::
96
97     > git clone http://gerrit.onap.org/r/oom
98
99     > helm plugin install ~/oom/kubernetes/helm/plugins/deploy
100
101     > helm plugin install ~/oom/kubernetes/helm/plugins/undeploy
102
103 Verify the plugins are installed::
104
105     > helm plugin ls
106
107 ::
108
109     NAME        VERSION   DESCRIPTION
110     deploy      1.0.0     install (upgrade if release exists) parent charty and all subcharts as separate but related releases
111     undeploy    1.0.0     delete parent chart and subcharts that were deployed as separate releases
112
113
114 Install the strimzi kafka operator
115 **********************************
116 Strimzi Apache Kafka provides a way to run an Apache Kafka cluster on Kubernetes
117 in various deployment configurations by using kubernetes operators.
118 Operators are a method of packaging, deploying, and managing Kubernetes applications.
119
120 Strimzi Operators extend the Kubernetes functionality, automating common
121 and complex tasks related to a Kafka deployment. By implementing
122 knowledge of Kafka operations in code, the Kafka administration
123 tasks are simplified and require less manual intervention.
124
125 The Strimzi cluster operator is deployed using helm to install the parent chart
126 containing all of the required custom resource definitions. This should be done
127 by a kubernetes administrator to allow for deployment of custom resources in to
128 any kubernetes namespace within the cluster.
129
130 Full installation instructions can be found in the
131 `Strimzi Apache Kafka Operator helm Installation documentation`_.
132
133 To add the required helm repository, execute the following::
134
135     > helm repo add strimzi https://strimzi.io/charts/
136
137 To install the strimzi kafka operator, execute the following, replacing the <recommended-strimzi-version> with the version defined
138 in the :ref:`versions_table` table::
139
140     > helm install strimzi-kafka-operator strimzi/strimzi-kafka-operator --namespace strimzi-system --version <recommended-strimzi-version> --set watchAnyNamespace=true --create-namespace
141
142 Verify the installation::
143
144     > kubectl get po -n strimzi-system
145
146 ::
147
148     NAME                                        READY   STATUS    RESTARTS       AGE
149     strimzi-cluster-operator-7f7d6b46cf-mnpjr   1/1     Running   0              2m
150
151
152 .. _oom_base_setup_cert_manager:
153
154 Install Cert-Manager
155 ********************
156
157 Cert-Manager is a native Kubernetes certificate management controller.
158 It can help with issuing certificates from a variety of sources, such as
159 Let’s Encrypt, HashiCorp Vault, Venafi, a simple signing key pair, self
160 signed or external issuers. It ensures certificates are valid and up to
161 date, and attempt to renew certificates at a configured time before expiry.
162
163 Cert-Manager is deployed using regular YAML manifests which include all
164 the needed resources (the CustomResourceDefinitions, cert-manager,
165 namespace, and the webhook component).
166
167 Full installation instructions, including details on how to configure extra
168 functionality in Cert-Manager can be found in the
169 `Cert-Manager Installation documentation`_.
170
171 There is also a kubectl plugin (kubectl cert-manager) that can help you
172 to manage cert-manager resources inside your cluster. For installation
173 steps, please refer to `Cert-Manager kubectl plugin documentation`_.
174
175
176 To install cert-manager, execute the following, replacing the <recommended-cm-version> with the version defined
177 in the :ref:`versions_table` table::
178
179     > kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v<recommended-cm-version>/cert-manager.yaml
180
181 Verify the installation::
182
183     > kubectl get po -n cert-manager
184
185 ::
186
187     NAME                                       READY   STATUS    RESTARTS      AGE
188     cert-manager-776c4cfcb6-vgnpw              1/1     Running   0             2m
189     cert-manager-cainjector-7d9668978d-hdxf7   1/1     Running   0             2m
190     cert-manager-webhook-66c8f6c75-dxmtz       1/1     Running   0             2m
191