Pre-requisite
Assumption
kubectl binary is installed on your host that will run the OOM setup.
https://kubernetes.io/docs/tasks/tools/install-kubectl/
Rancher
Create a plain Ubuntu VM in your cloud infrastructure.
The following specs are enough for Rancher
ID 3 VCPUs 2 RAM 4Go Taille 40Go Setup Rancher stable by running this command:
docker run -d -p 8080:8080 rancher/server:stable
Navigate to Rancher UI
http://<rancher-vm-ip>:8080
- Setup basic access control: Admin → Access Control
- Install Openstack as machine driver: Admin → Machine Drivers
- Create an environment
- Default → Managed Environments
- Click Add Environment
- Fill in the Name and the Description
- Select Kubernetes as Environment Template
- Click Create
- Create an API key: API → Keys
- Click Add Account API Key
- Fill in the Name and the Description
- Click Create
- Backup the Access Key and the Secret Key
We're now all set to create our Kubernetes host.
Kubernetes
- Retrieve your environment ID
- Navigate to the previously created environment
In the browser URL, you should see the following, containing your <env-id>
http://<rancher-vm-ip>:8080/env/<env-id>/kubernetes/dashboard
Create the Kubernetes host. Make sure to fill in the placeholder as follow:
{API_ACCESS_KEY}: The API KEY created in the previous step
{API_SECRET_KEY}: The API Secret created in the previous step
{OPENSTACK_INSTANCE}: The OpenStack Instance Name to give to your K8S VM
{OPENSTACK_IP}: The IP of your OpenStack deployment
{RANCHER_IP}: The IP of the Rancher VM created previously
{k8s-flavor}: The Flavor to use for the kubernetes VM. Recommanded specs:VCPUs 8 RAM 64Go Taille 100Go curl -u "{API_ACCESS_KEY}:{API_SECRET_KEY}" \ -X POST \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "hostname":"{OPENSTACK_INSTANCE}", "engineInstallUrl":"wget https://raw.githubusercontent.com/rancher/install-docker/master/1.12.6.sh", "openstackConfig":{ "authUrl":"http://{OPENSTACK_IP}:5000/v3", "domainName":"Default", "endpointType":"adminURL", "flavorName":"{k8s-flavor}", "imageName":"xenial", "netName":"vlan197_net", "password":"Password123", "sshUser":"ubuntu", "tenantName":"nso-rancher", "username":"nso"} }' \ 'http://{RANCHER_IP}:8080/v2-beta/projects/{ENVIRONMENT_ID}/hosts/'
- Let's wait a few minutes until it's ready.
- Get your kubectl config
- Click Kubernetes → CLI
- Click Generate Config
Copy/Paste in your host, under
~/.kube/config
If you have multiple Kubernetes environments, you can give it a different name, instead of config. Then reference all your kubectl config in your bash_profile as follow
KUBECONFIG=\ /Users/adetalhouet/.kube/k8s.adetalhouet1.env:\ /Users/adetalhouet/.kube/k8s.adetalhouet2.env:\ /Users/adetalhouet/.kube/k8s.adetalhouet3.env export KUBECONFIG
Make your kubectl use this new environment
kubectl config use-context <environment-name>
After a little bit, you're environment should be ready. To verify, use the following command
$ kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system heapster-4285517626-4dst0 1/1 Running 0 4m kube-system kube-dns-638003847-lx9f2 3/3 Running 0 4m kube-system kubernetes-dashboard-716739405-f0kgq 1/1 Running 0 4m kube-system monitoring-grafana-2360823841-0hm22 1/1 Running 0 4m kube-system monitoring-influxdb-2323019309-4mh1k 1/1 Running 0 4m kube-system tiller-deploy-737598192-8nb31 1/1 Running 0 4m
OOM
We will basically follow this guide: http://onap.readthedocs.io/en/latest/submodules/oom.git/docs/OOM%20User%20Guide/oom_user_guide.html?highlight=oom
Clone OOM release-1.1.0 branch
git clone -b release-1.1.0 ssh://adetalhouet@gerrit.onap.org:29418/oom
- Prepare configuration
Edit the onap-parameters.yaml under
oom/kubernetes/config
To have endpoints registering to MSB, add your kubectl config token in kube2msb config, under kubeMasterAuthToken located at
oom/kubernetes/kube2msb/values.yaml
Create the config
cd oom/kubernetes/config ./createConfig.sh -n onap
Deploy ONAP
cd oom/kubernetes/oneclick ./createAll.bash -n onap
- Now, time for a break. This will take arround 30/40 minutes.