965da2b0227740f012642253dbe31a84ee4ab458
[nonrtric.git] / test / usecases / oruclosedlooprecovery / scriptversion / docker-compose-controlloop / README.md
1 This docker-compose will create a control loop that will deploy all components of the closed loop recovery use case into a k8s cluster using the k8s participant from CLAMP in ONAP.
2
3 It will also bring up the chartmuseum registry that will be used by helm when deploying the charts.
4 The script named chartmuseum_init.sh will push all the charts into the chartmuseum.
5 This script is mounted into the k8s-participant docker container but can also be run locally.
6
7 Depending on the type of k8s cluster and the operating system being used, different settings might need to be done for the k8s-participant docker container. For example, in case of minikube, the following should be added under k8s-participant (assuming that kube-config file of the host machine has been copied into the config directory):
8
9 volumes:
10  - ./config/kube-config:/home/policy/.kube/config:ro
11  - ~/.minikube/profiles/minikube:/home/policy/.minikube/profiles/minikube
12
13 This will mount the kube-config file into the k8s-participant docker container so that it is able to deploy services into the minikube instance running in the host machine. The minikube directory contains the client-certificate and client-key.
14
15 Since the kube-api server is running in the host machine instead of the k8s-participant docker container, some extra steps are needed:
16
17 1) Linux
18
19 Run the following command in the host machine so that the localhost referred to in the kube-config file points to the host machine:
20
21 iptables -A INPUT -i docker0 -j ACCEPT
22
23 2) Mac
24
25 Mac OS does not seem to have the iptables command. However, in order to refer to the host machine from inside the docker container, one may use "host.docker.internal" but this gives rise to another problem:
26
27 Unable to connect to the server: x509: certificate is valid for minikubeCA, control-plane.minikube.internal, kubernetes.default.svc.cluster.local, kubernetes.default.svc, kubernetes.default, kubernetes, localhost, not host.docker.internal
28
29 As a workaround, the TLS can be disabled. So, the following part should be modified in the kube-config file:
30
31 - cluster:
32     server: https://host.docker.internal:<PORT>
33     insecure-skip-tls-verify: true
34
35
36 ## License
37
38 Copyright (C) 2021 Nordix Foundation.
39 Licensed under the Apache License, Version 2.0 (the "License")
40 you may not use this file except in compliance with the License.
41 You may obtain a copy of the License at
42
43       http://www.apache.org/licenses/LICENSE-2.0
44
45 Unless required by applicable law or agreed to in writing, software
46 distributed under the License is distributed on an "AS IS" BASIS,
47 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48 See the License for the specific language governing permissions and
49 limitations under the License.