====== ONAP installation ====== Prerequsites: k8s helm Hint * https://onap.readthedocs.io/en/latest/submodules/oom.git/docs/oom_quickstart_guide.html * done here: http://localhost/~dang/wiki/doku.php?id=virtualization:k8s:onap_k8s:0_k8s_installation * quick ref: https://www.baeldung.com/kubernetes-helm * OOM https://wiki.onap.org/display/DW/OOM+Helm+%28un%29Deploy+plugins ===== - Configure Helm charts ===== ==== - ONAP configuration ==== * https://onap.readthedocs.io/en/latest/submodules/oom.git/docs/oom_user_guide.html * ==== - Helm repo ==== osn/onap is not setup by LF yet so omit this step and create a local repo. helm install osn/onap helm repo remove stable # helm repo add stable https://kubernetes-charts.storage.googleapis.com To prepare your system for an installation of ONAP, you’ll need to: git clone -b dublin http://gerrit.onap.org/r/oom cd oom/kubernetes Pull and update submodules (aai, etc) if not cloned with "--recurse-submodules" git submodule update --init --recursive Submodule 'kubernetes/aai' (http://gerrit.onap.org/r/aai/oom) registered for path 'aai' Cloning into '/home/ubuntu/onap/oom/kubernetes/aai'... warning: redirecting to https://gerrit.onap.org/r/aai/oom/ Submodule path 'aai': checked out '6509a172751b3c85995100e3d3a205abe73b116c' ubuntu@onap-k8s-h0:~/onap/oom/kubernetes$ git pull --recurse-submodules warning: redirecting to https://gerrit.onap.org/r/oom/ Fetching submodule kubernetes/aai warning: redirecting to https://gerrit.onap.org/r/aai/oom/ Already up to date. To setup a local Helm server to server up the ONAP charts: helm init helm serve & Note the port number that is listed and use it in the Helm repo add as follows: helm repo add local http://127.0.0.1:8879 To get a list of all of the available Helm chart repositories: helm repo list NAME URL local http://127.0.0.1:8879 Then build your local Helm repository: make all Show all charts in local repo: helm search -l Next, install Helm Plugins required to deploy the ONAP Casablanca release: sudo rm -rf ~/.helm/plubins/* # as user cp -R helm/plugins/ ~/.helm ==== - Config and Deploy ONAP ==== * ONAP project/components and what they do: https://wiki.onap.org/display/DW/Active+and+Available+Inventory+Project * Amsterdam project release dependency: https://wiki.onap.org/download/attachments/8231717/ONAP%20API%20DependenciesV1.pdf?version=1&modificationDate=1501195984000&api=v2 * ONAP components explain: http://localhost/~dang/wiki/doku.php?id=virtualization:k8s:onap_k8s:1.1_onap_subprojects Copy overrides yaml and customize cp -r ~/oom/kubernetes/onap/resources/overrides . cd overrides/ Edit the onap-all.yaml file # Copyright © 2019 Amdocs, Bell Canada # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################### # This override file enables helm charts for all ONAP applications. ################################################################### cassandra: enabled: true mariadb-galera: enabled: true replicaCount: 1 aaf: enabled: true aai: enabled: true appc: enabled: false clamp: enabled: false cli: enabled: false consul: enabled: true contrib: enabled: false dcaegen2: enabled: true dmaap: enabled: true esr: enabled: false log: enabled: true sniro-emulator: enabled: true oof: enabled: true msb: enabled: true multicloud: enabled: false nbi: enabled: false policy: enabled: true pomba: enabled: false portal: enabled: true robot: enabled: true sdc: enabled: false sdnc: enabled: true replicaCount: 3 so: enabled: true uui: enabled: false vfc: enabled: false vid: enabled: false vnfsdk: enabled: false ==== - Deploy ONAP ==== Helm deploy will copy stuffs in ~/.helm/plugins/deploy/* so do not run as root. #helm deploy demo local/onap --namespace onap -f ~/overrides/onap-all.yaml --timeout 300 helm deploy development local/onap --namespace onap -f onap-k8s.yaml For helm 2.7< <3.0 (https://stackoverflow.com/a/51780556/707704): helm deploy dev local/onap --namespace onap -f onap-k8s-5.0.0-td.yaml --force To deploy using charts in folder onap - the onap chart: cd oom/kubernetes make all helm deploy demo ./onap --namespace onap It will install onap with the config in value.yaml. == - onap-k8s.yaml == # Copyright © 2019 Amdocs, Bell Canada # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################### # This override file enables helm charts for all ONAP applications. ################################################################### cassandra: enabled: true mariadb-galera: enabled: true replicaCount: 1 aaf: enabled: true aai: enabled: true appc: enabled: true clamp: enabled: false cli: enabled: true consul: enabled: true contrib: enabled: false dcaegen2: enabled: true dmaap: enabled: true esr: enabled: false log: enabled: true sniro-emulator: enabled: true oof: enabled: true msb: enabled: true multicloud: enabled: true nbi: enabled: true policy: enabled: true pomba: enabled: false portal: enabled: true robot: enabled: true sdc: enabled: true sdnc: enabled: true replicaCount: 3 so: enabled: true uui: enabled: true vfc: enabled: true vid: enabled: true vnfsdk: enabled: false ==== - Check installation ==== kubectl get pods --all-namespaces -o=wide Now, we would like to see which charts are installed as what release. This command lets us query the named releases: helm ls --all NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE hello-world 1 Mon Feb 25 15:29:59 2019 DEPLOYED hello-world-0.1.0 1.0 default ==== - Undeploy ==== helm undeploy dev –purge ==== - Troubleshooting ==== === - Taints & scheduling pods error ==== * https://blog.kstaykov.eu/devops/kubernetes-taint/ ===== - Add K8s site as VIM (alternative to VM)===== * https://onap.readthedocs.io/en/latest/guides/onap-user/cloud_site/index.html * {{ :virtualization:k8s:onap_k8s:onap_ddf_2019_k8s_v3.pdf |slides}} * https://wiki.onap.org/display/DW/Support+for+K8S+%28Kubernetes%29+based+Cloud+regions ==== - Install k8s (KRD) components on VM or baremetal (with OS) ==== 20190916T1352+0000: === Obsolate ?? === * https://github.com/electrocucaracha/krd/blob/master/docs/src/bare_metal_provisioning.rst Down load and run the script: wget -O - https://raw.githubusercontent.com/electrocucaracha/krd/master/aio.sh | bash The KRD_ACTIONS as array can not be parsed by the script aio.sh ([[https://stackoverflow.com/a/57958263/707704|issue here]]) so set the variables inside the aio.sh script KRD_ADDONS=nfd KRD_ACTIONS=(install_k8s install_k8s_addons) === Using multicloud-k8s === git clone https://github.com/onap/multicloud-k8s.git cd /home/ubuntu/multicloud-k8s/kud/hosting_providers/vagrant sudo ./install.sh <------------ install k8s as root **note**: vagrant installation will install the deployment scripts in vm and deploy from there?? I guess. We install directly from the script here and require root. Ideally, k8s should be installed as non root. === - etcd not starting === * https://gravitational.com/blog/kubernetes-and-offline-etcd-upgrades/ * https://raft.github.io/raft.pdf * https://software.danielwatrous.com/using-and-troubleshooting-etcd-in-kubernetes/ k8s not listening on 6443 systemctl status etcd journalctl -xeu etcd --> bump kubespray to 2.11.0 https://jira.onap.org/browse/MULTICLOUD-821 ===== - Similar efforts ===== * https://01.org/blogs/libozhu/2019/using-onap-and-kubernetes-enable-trusted-smart-home * ONAP Architecture overview: https://www.onap.org/wp-content/uploads/sites/20/2018/11/ONAP_CaseSolution_Architecture_112918FNL.pdf * Deploying vFw and EdgeXFoundry Services: https://wiki.onap.org/display/DW/Deploying+vFw+and+EdgeXFoundry+Services+on+Kubernets+Cluster+with+ONAP * K8S based Cloud-region support: https://wiki.onap.org/display/DW/K8S+based+Cloud-region+support+-+Documents * Mocana and EdgeXFoundry press release: https://www.mocana.com/press-releases/topic/edgex