This guide describes the installation of A&AI via OOM on a clean Ubuntu 16.04 machine. It creates a local kubernetes cluster on the machine and starts the A&AI services using OOM (A&AI services are represented as Helm Charts inside OOM).

Note: the guide could be out-of-sync with the installation procedure anytime as OOM changes versions and dependencies and the changes might not be reflected here.

In order to install A&AI on a barebone Ubuntu 16.04 machine we have to install these apps:

  1. Docker
  2. Kubernetes
  3. Helm
  4. OOM

1. Docker installation

This is just a run-of-the-mill docker installation:

sudo apt-get remove docker docker-engine docker.io
sudo apt-get install     apt-transport-https     ca-certificates     curl     software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
sudo apt-get install docker-ce

2. Kubernetes Installation

We install kubernetes with flannel and (in the last step) make master schedulable:

sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo add-apt-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
sudo apt-get update
#if the next step fails, verify that a file named /etc/apt/sources.list.d/kubernetes.list exists and contains this line: deb http://apt.kubernetes.io/ kubernetes-xenial main
sudo apt-get install kubelet kubeadm kubectl kubernetes-cni
# check that you have enough disk space under /var/lib/docker
# perform the preflight action
sudo kubeadm config images pull
#if the next step fails with an error about swap, do the following: sudo swapoff -a
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl taint nodes --all node-role.kubernetes.io/master-

3. Hel(l)m

We need a specific version of helm (so don't install the newest), we also need to create a service account (otherwise we are unable to install from the local helm repository), we install tiller and add the repository itself:

wget http://storage.googleapis.com/kubernetes-helm/helm-v2.9.1-linux-amd64.tar.gz
tar -zxvf helm-v2.9.1-linux-amd64.tar.gz
sudo mv linux-amd64/helm /usr/local/bin/helm
helm version
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
helm init
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec": {"serviceAccount":"tiller"}}}}'
helm serve &
helm repo add local http://127.0.0.1:8879

4. OOM

The installation is as follows:

git clone "https://gerrit.onap.org/r/oom"
cd oom
git submodule init
git submodule update
sudo cp -R ~/oom/kubernetes/helm/plugins/ ~/.helm


Before running A&AI we must customize what projects should be enabled in the oom/kubernetes/onap/values.yaml file. As we want to run A&AI, we should have:

aai:
  enabled: true

and on all other ONAP projects enabled should be set to false (i.e. "enabled: false"). After we modify the values.yaml file we should be good to go:

cd oom/kubernetes
make all
sudo helm deploy demo ./onap --namespace onap

When you do

kubectl get pods --all-namespaces

you should see kubernetes and A&AI pods running.

To remove everything, execute:

helm undeploy demo --purge
  • No labels

6 Comments

  1. I ran this command: 
    jimmy@z800-kube:~$ kubectl taint nodes --all node-role.kubernetes.io/master-
    and got this output:
    node/z800-kube untainted

    But still seeing this in the tiller pod:


    jimmy@z800-kube:~/src/oom$ kubectl --namespace kube-system describe pod tiller-deploy-694dc94c65-9hkwk
    Name:               tiller-deploy-694dc94c65-9hkwk
    Namespace:          kube-system
    Priority:           0
    PriorityClassName:  <none>
    Node:               <none>
    Labels:             app=helm
                        name=tiller
                        pod-template-hash=694dc94c65
    Annotations:        <none>
    Status:             Pending
    IP:                 
    Controlled By:      ReplicaSet/tiller-deploy-694dc94c65
    Containers:
      tiller:
        Image:       gcr.io/kubernetes-helm/tiller:v2.9.1
        Ports:       44134/TCP, 44135/TCP
        Host Ports:  0/TCP, 0/TCP
        Liveness:    http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
        Readiness:   http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
        Environment:
          TILLER_NAMESPACE:    kube-system
          TILLER_HISTORY_MAX:  0
        Mounts:
          /var/run/secrets/kubernetes.io/serviceaccount from tiller-token-w46tz (ro)
    Conditions:
      Type           Status
      PodScheduled   False 
    Volumes:
      tiller-token-w46tz:
        Type:        Secret (a volume populated by a Secret)
        SecretName:  tiller-token-w46tz
        Optional:    false
    QoS Class:       BestEffort
    Node-Selectors:  <none>
    Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                     node.kubernetes.io/unreachable:NoExecute for 300s
    Events:
      Type     Reason            Age                 From               Message
      ----     ------            ----                ----               -------
      Warning  FailedScheduling  32s (x92 over 15m)  default-scheduler  0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.
      • You "untainted" the master before installing tiller?
      • What version of kubeadm and kubectl do you have?
      • I tried to reset my k8s cluster and reinstall and it worked for me, can I somehow access your machine?
  2. Hi, Pavel Paroulek - I followed the steps as above; just making sure you knew that I ran the untaint step and was still getting the error about the taint check.


    jimmy@z800-kube:~$ kubeadm version

    kubeadm version: &version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T17:02:38Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}


    jimmy@z800-kube:~$ kubectl version

    Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T17:05:32Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}

    Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T16:55:41Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}

    I'm going to reset and see if I can get it to work.  If it fails again I'll see if I can set up so you can have access.

    1. or we can do a quick zoom session, maybe that would be the easiest

    2. Looks like this is due to the flannel version being too old for Kubernetes 1.12.0. Running the following should fix it:

      kubectl delete -f https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml
      kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

      (The kubectl delete step is only needed if you installed the flannel version from the original instructions).

  3. Hi Pavel Paroulek, I was following the guide but getting the following error when executing the "make all" command



    waseem@mp-onap-aai:~/oom/kubernetes$ make all
    Using Helm binary helm which is helm version v2.9.1
    
    [common]
    make[1]: Entering directory '/home/waseem/oom/kubernetes'
    make[2]: Entering directory '/home/waseem/oom/kubernetes/common'
    
    [common]
    make[3]: Entering directory '/home/waseem/oom/kubernetes/common'
    ==> Linting common
    [INFO] Chart.yaml: icon is recommended
    [ERROR] templates/: parse error in "common/templates/_utils.tpl": template: common/templates/_utils.tpl:40: function "mergeOverwrite" not defined
    
    Error: 1 chart(s) linted, 1 chart(s) failed
    make[3]: *** [Makefile:46: lint-common] Error 1
    make[3]: Leaving directory '/home/waseem/oom/kubernetes/common'
    make[2]: *** [Makefile:37: common] Error 2
    make[2]: Leaving directory '/home/waseem/oom/kubernetes/common'
    make[1]: *** [Makefile:73: make-common] Error 2
    make[1]: Leaving directory '/home/waseem/oom/kubernetes'
    make: *** [Makefile:56: common] Error 2


    any idea how can I resolve this? or is the any updated documents that you can point me? 


    Thank you!