713aec6c8ca1e3c8e87426b857d1dfa050608714
[oom.git] / docs / sections / guides / infra_guides / oom_base_optional_addons.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 .. _Prometheus stack README: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#readme
8 .. _ONAP Next Generation Security & Logging Structure: https://wiki.onap.org/pages/viewpage.action?pageId=103417456
9 .. _Istio setup guide: https://istio.io/latest/docs/setup/install/helm/
10 .. _Kiali setup guide: https://kiali.io/docs/installation/installation-guide/example-install/
11 .. _Kserve setup guide: https://kserve.github.io/website/0.10/admin/kubernetes_deployment/
12
13 .. _oom_base_optional_addons:
14
15 OOM Optional Addons
16 ###################
17
18 The following optional applications can be added to your kubernetes environment.
19
20 Install Prometheus Stack
21 ************************
22
23 Prometheus is an open-source systems monitoring and alerting toolkit with
24 an active ecosystem.
25
26 Kube Prometheus Stack is a collection of Kubernetes manifests, Grafana
27 dashboards, and Prometheus rules combined with documentation and scripts to
28 provide easy to operate end-to-end Kubernetes cluster monitoring with
29 Prometheus using the Prometheus Operator. As it includes both Prometheus
30 Operator and Grafana dashboards, there is no need to set up them separately.
31 See the `Prometheus stack README`_ for more information.
32
33 To install the prometheus stack, execute the following:
34
35 - Add the prometheus-community Helm repository::
36
37     > helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
38
39 - Update your local Helm chart repository cache::
40
41     > helm repo update
42
43 - To install prometheus, execute the following, replacing the <recommended-pm-version> with the version defined in the :ref:`versions_table` table::
44
45     > helm install prometheus prometheus-community/kube-prometheus-stack --namespace=prometheus --create-namespace --version=<recommended-pm-version>
46
47 ONAP on Service Mesh
48 ********************
49
50 .. warning::
51     "ONAP on Service Mesh" is not fully supported in "Kohn". Full support is
52     planned for London release to support the
53     `ONAP Next Generation Security & Logging Structure`_
54
55 .. figure:: ../../resources/images/servicemesh/ServiceMesh.png
56    :align: center
57
58 ONAP is currenty planned to support Istio as default ServiceMesh platform.
59 Therefor the following instructions describe the setup of Istio and required tools.
60 Used `Istio setup guide`_
61
62 .. _oom_base_optional_addons_istio_installation:
63
64 Istio Platform Installation
65 ===========================
66
67 Install Istio Basic Platform
68 ----------------------------
69
70 - Configure the Helm repository::
71
72     > helm repo add istio https://istio-release.storage.googleapis.com/charts
73
74     > helm repo update
75
76 - Create a namespace for "mesh-level" configurations::
77
78     > kubectl create namespace istio-config
79
80 - Create a namespace istio-system for Istio components::
81
82     > kubectl create namespace istio-system
83
84 - Install the Istio Base chart which contains cluster-wide resources used by the
85   Istio control plane, replacing the <recommended-istio-version> with the version
86   defined in the :ref:`versions_table` table::
87
88     > helm upgrade -i istio-base istio/base -n istio-system --version <recommended-istio-version>
89
90 - Install the Istio Base Istio Discovery chart which deploys the istiod service, replacing the
91   <recommended-istio-version> with the version defined in the :ref:`versions_table` table
92   (enable the variable to enforce the (sidecar) proxy startup before the container start)::
93
94     > helm upgrade -i istiod istio/istiod -n istio-system --version <recommended-istio-version>
95     --wait --set global.proxy.holdApplicationUntilProxyStarts=true --set meshConfig.rootNamespace=istio-config
96
97 Add an EnvoyFilter for HTTP header case
98 ---------------------------------------
99
100 When handling HTTP/1.1, Envoy will normalize the header keys to be all lowercase.
101 While this is compliant with the HTTP/1.1 spec, in practice this can result in issues
102 when migrating existing systems that might rely on specific header casing.
103 In our case a problem was detected in the SDC client implementation, which relies on
104 uppercase header values. To solve this problem in general we add a EnvoyFilter to keep
105 the uppercase header in the istio-config namespace to apply for all namespaces, but
106 set the context to SIDECAR_INBOUND to avoid problems in the connection between Istio-Gateway and Services
107
108 - Create a EnvoyFilter file (e.g. envoyfilter-case.yaml)
109
110     .. collapse:: envoyfilter-case.yaml
111
112       .. include:: ../../resources/yaml/envoyfilter-case.yaml
113          :code: yaml
114
115 - Apply the change to Istio::
116
117     > kubectl apply -f envoyfilter-case.yaml
118
119 Install Istio Gateway
120 ---------------------
121
122 - Create a namespace istio-ingress for the Istio Ingress gateway
123   and enable istio-injection::
124
125     > kubectl create namespace istio-ingress
126
127     > kubectl label namespace istio-ingress istio-injection=enabled
128
129 - To expose additional ports besides HTTP/S (e.g. for external Kafka access, SDNC-callhome)
130   create an override file (e.g. istio-ingress.yaml)
131
132     .. collapse:: istio-ingress.yaml
133
134       .. include:: ../../resources/yaml/istio-ingress.yaml
135          :code: yaml
136
137 - Install the Istio Gateway chart using the override file, replacing the
138   <recommended-istio-version> with the version defined in
139   the :ref:`versions_table` table::
140
141     > helm upgrade -i istio-ingress istio/gateway -n istio-ingress
142     --version <recommended-istio-version> -f ingress-istio.yaml --wait
143
144 Kiali Installation
145 ==================
146
147 Kiali is used to visualize the Network traffic in a ServiceMesh enabled cluster
148 For setup the kiali operator is used, see `Kiali setup guide`_
149
150 - Install kiali-operator namespace::
151
152     > kubectl create namespace kiali-operator
153
154     > kubectl label namespace kiali-operator istio-injection=enabled
155
156 - Install the kiali-operator::
157
158     > helm repo add kiali https://kiali.org/helm-charts
159
160     > helm repo update kiali
161
162     > helm install --namespace kiali-operator kiali/kiali-operator
163
164 - Create Kiali CR file (e.g. kiali.yaml)
165
166     .. collapse:: kiali.yaml
167
168       .. include:: ../../resources/yaml/kiali.yaml
169          :code: yaml
170
171 - Install kiali::
172
173     > kubectl apply -f kiali.yaml
174
175 - Create Ingress gateway entry for the kiali web interface
176   using the configured Ingress <base-url> (here "simpledemo.onap.org")
177   as described in :ref:`oom_customize_overrides`
178
179     .. collapse:: kiali-ingress.yaml
180
181       .. include:: ../../resources/yaml/kiali-ingress.yaml
182          :code: yaml
183
184 - Add the Ingress entry for Kiali::
185
186     > kubectl -n istio-system apply -f kiali-ingress.yaml
187
188
189 Jaeger Installation
190 ===================
191
192 To be done...
193
194
195 Kserve Installation
196 ********************
197
198 KServe is a standard Model Inference Platform on Kubernetes. It supports RawDeployment mode to enable InferenceService deployment with Kubernetes resources. Comparing to serverless deployment it unlocks Knative limitations such as mounting multiple volumes, on the other hand Scale down and from Zero is not supported in RawDeployment mode.
199
200 This installation is necessary for the ML models to be deployed as inference service. Once deployed, the inference services can be queried for the prediction.
201
202 **Kserve participant component in Policy ACM requires this installation. Kserve participant deploy/undeploy inference services in Kserve.**
203
204 Dependent component version compatibility details and installation instructions can be found at `Kserve setup guide`_
205
206 Kserve installation requires the following components:
207
208 -  Istio. Its installation instructions can be found at :ref:`oom_base_optional_addons_istio_installation`
209
210 -  Cert-Manager. Its installation instructions can be found at :ref:`oom_base_setup_cert_manager`
211
212 Installation instructions as follows,
213
214 - Create kserve namespace::
215
216     > kubectl create namespace kserve
217
218 - Install Kserve::
219
220     > kubectl apply -f https://github.com/kserve/kserve/releases/download/v<recommended-kserve-version>/kserve.yaml
221
222 - Install Kserve default serving runtimes::
223
224     > kubectl apply -f https://github.com/kserve/kserve/releases/download/v<recommended-kserve-version>/kserve-runtimes.yaml
225
226 - Patch ConfigMap inferenceservice-config as follows::
227
228     > kubectl patch configmap/inferenceservice-config -n kserve --type=strategic -p '{"data": {"deploy": "{\"defaultDeploymentMode\": \"RawDeployment\"}"}}'