= Orchestration Example = == ONAP == The [http://onap.org Open Network Automation Platform (ONAP)] is an open-source software platform that enables the design, creation, and orchestration of networking services. ONAP was formed as a result of a [https://www.lightreading.com/nfv/nfv-mano/open-o-ecomp-combine-to-create-onap/d/d-id/730522 merger of the Linux Foundation’s OPEN-Orchestrator (OPEN-O), and the AT&T ECOMP (Enhanced Control, Orchestration, Management and Policy) projects]. [https://www.onap.org/architecture ONAP architecture] consists of two major architectural frameworks: * design-time environment * run-time environment Both of these environments consist of a numerous separate subsystems. This tutorial simplified deployment no OpenStack only Kubernties; 4 machines: controller and 3 workers Basic set of subsystems: -- Running performant physical server cluster For the purpose of orbit-lab, execute the below script on any of the console node in orbit as below: \\./create-kube-cluster.sh -c "cNode1 cNode2 ... cNodeM" -w "wNode1 wNode2 ... wNodeN" create-kube-cluster.sh {{{ #!/bin/bash rm -f cluster.yml rm -f kube_config_cluster.yml rm -f rke rm -f config omf tell -t all -a offh sleep 60 wget https://github.com/rancher/rke/releases/download/v0.2.1/rke_linux-amd64 mv rke_linux-amd64 rke chmod 754 rke usage () { echo "Usage:" echo " ./$(basename $0) -c \"cNode1 cNode2 ... cnodeN\" -w \"wNode1 wnode2 ... wnodeN\"" echo "Note: controllers hostnames and workers hostnames are to be enclosed in \"\"" exit 0 } if [[ ( $# == "--help") || $# == "-h" ]] then usage exit 0 fi if [ "$#" -lt 2 ]; then echo "Missing Kubernetes control and worker nodes" usage fi echo "# An example of an HA Kubernetes cluster for ONAP" >> cluster.yml echo "nodes:" >> cluster.yml while getopts c:w: option do case "${option}" in c) CONTROLLERS=${OPTARG};; w) WORKERS=${OPTARG};; esac done omf load -i latest-onap-control.ndz -t ${CONTROLLERS// /,} -r 60 sleep 300 omf load -i latest-onap-worker.ndz -t ${WORKERS// /,} -r 60 sleep 300 omf tell -a on -t ${CONTROLLERS// /,},${WORKERS// /,} sleep 300 IFS=' ' read -ra C <<< "$CONTROLLERS" IFS=' ' read -ra W <<< "$WORKERS" echo "Testing node availability. This might take some time" for i in "${C[@]}"; do while ! ping -c 1 -n -w 1 $i &> /dev/null do printf "%c" "." done echo "127.0.0.1 localhost" > hosts echo "`ping $i -c 1 | grep "PING" | grep '('|awk '{gsub(/[()]/,""); print $3}'` ${i}" >> hosts scp hosts root@$i:/etc/hosts done for i in "${W[@]}"; do while ! ping -c 1 -n -w 1 $i &> /dev/null do printf "%c" "." done echo "127.0.0.1 localhost" > hosts echo "`ping $i -c 1 | grep "PING" | grep '('|awk '{gsub(/[()]/,""); print $3}'` ${i}" >> hosts scp hosts root@$i:/etc/hosts done echo "Availability check successful" for i in "${C[@]}"; do echo "- address: `ping $i -c 1 | grep "PING" | grep '('|awk '{gsub(/[()]/,""); print $3}'`" >> cluster.yml echo ' port: "22"' >> cluster.yml echo " role:" >> cluster.yml echo " - controlplane" >> cluster.yml echo " - etcd" >> cluster.yml echo " hostname_override: `ping $i -c 1 | grep 'PING' | awk '{print $2}' | awk -F . '{print $1}'`" >> cluster.yml echo " user: root" >> cluster.yml echo " ssh_key_path: '~/.ssh/id_rsa'" >> cluster.yml done echo "# worker nodes start " >> cluster.yml for i in "${W[@]}"; do echo "- address: `ping $i -c 1 | grep "PING" | grep '('|awk '{gsub(/[()]/,""); print $3}'`" >> cluster.yml echo ' port: "22"' >> cluster.yml echo " role:" >> cluster.yml echo " - worker" >> cluster.yml echo " hostname_override: `ping $i -c 1 | grep 'PING' | awk '{print $2}' | awk -F . '{print $1}'`" >> cluster.yml echo " user: root" >> cluster.yml echo " ssh_key_path: '~/.ssh/id_rsa'" >> cluster.yml done echo 'services: kube-api: service_cluster_ip_range: 10.43.0.0/16 pod_security_policy: false always_pull_images: false kube-controller: cluster_cidr: 10.42.0.0/16 service_cluster_ip_range: 10.43.0.0/16 kubelet: cluster_domain: cluster.local cluster_dns_server: 10.43.0.10 fail_swap_on: false network: plugin: canal authentication: strategy: x509 ssh_key_path: "~/.ssh/id_rsa" ssh_agent_auth: false authorization: mode: rbac ignore_docker_version: false kubernetes_version: "v1.13.5-rancher1-2" private_registries: - url: nexus3.onap.org:10001 user: docker password: docker is_default: true cluster_name: "onap" restore: restore: false snapshot_name: ""' >> cluster.yml ./rke up for i in "${C[@]}"; do scp kube_config_cluster.yml root@$i:~/.kube/config done exit 0 }}} -- Openstack installed -- VM cloud image ubuntu 18.04-server-image