Steps described in this page are run by "ubuntu", a non-root user.


ONAP deployment in Kubernetes is modeled in the oom project as a one-to-one set of service to pod sets (one pod per docker container).

The following table illustrate the steps that much run (tick) or can be skipped (minus) on the each of the Kubernetes cluster node.

Steps DescriptionKubernetes Node
Masterworker
Install Docker(tick)(tick)
Configure Kubernetes Cluster(tick)(tick)
Install kubectl(tick)(tick)

Install Helm

(expect OOM project will be mounted on the same node)

(tick)(minus)



Install Docker

#PurposeCommand and Example
1

Install Docker 1.12

Check out compartible versions among Rancher, Kubernetes and Docker

curl https://releases.rancher.com/install-docker/1.12.sh | sh

$ curl https://releases.rancher.com/install-docker/1.12.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16609 100 16609 0 0 18977 0 --:--:-- --:--:-- --:--:-- 18960
apparmor is enabled in the kernel and apparmor utils were already installed
+ sudo -E sh -c sleep 3; apt-get update

...

+ sudo -E sh -c docker version
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Tue Jan 10 20:38:45 2017
OS/Arch: linux/amd64

Server:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Tue Jan 10 20:38:45 2017
OS/Arch: linux/amd64

If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

sudo usermod -aG docker ubuntu

Remember that you will have to log out and back in for this to take effect!

$

2

Enable docker command for ubuntu user

as recommend from docker installation

sudo usermod -aG docker ubuntu

logout

log back in and validate docker command is usable by entering "docker"


Configure Kubernetes Cluster

Set up Kubernetes cluster follow steps at Kubernetes Cluster by Rancher.

Install kubectl

kubectl is a command line interface for running commands against Kubernetes clusters.

Follow the steps below to install kubectrl:

#PurposeCommand and Example
1

Download kubectl on the server

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.6/bin/linux/amd64/kubectl

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 49.8M  100 49.8M    0     0  15.3M      0  0:00:03  0:00:03 --:--:-- 15.3M

2

Enable the kubectl command

chmod +x kubectl

sudo mv kubectl /usr/local/bin/kubectl

vi ~/.bashrc

  • append the following to enable kubectl command auto-completion
    • source <(kubectl completion bash)

source ~/.bashrc

3

Generate config from the Rancher UI

From the Rancher UI ( access the Rancher UI through http:<master node host IP>:8880 as specified in Kubernetes Cluster by Rancher),

  • Go to a Kubernetes CLI page through KUBERNETES -> CLI
  • Click on the GenerateConfig button to generate the config

  • The following content will be brought up; click on the Copy to Clipboard button to copy the generated config and use it in next step:

4

Create the kube config on the server

mkdir ~/.kube

vi ~/.kube/config

Paste the generated config from rancher UI (from last step) to this file, then save the file.

5

Validate the kube config

6

Validate the nodes added

kubectl get nodes

$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
sdnc-k8s Ready <none> 15m v1.7.7-rancher1
sdnc-k8s-2 Ready <none> 1m v1.7.7-rancher1
$


Install Helm

Helm is used by OOM for package and configuration management. Hence, we are installing Helm (use 2.3.0 not current 2.6.0) on the server where we have mounted the OOM project. 

Follow the steps below to download and enable Helm on the server:

#PurposeCommand and Example

1

Download the Helm tar file

wget http://storage.googleapis.com/kubernetes-helm/helm-v2.3.0-linux-amd64.tar.gz

$ wget http://storage.googleapis.com/kubernetes-helm/helm-v2.3.0-linux-amd64.tar.gz

--2017-11-08 20:12:30--  http://storage.googleapis.com/kubernetes-helm/helm-v2.3.0-linux-amd64.tar.gz

Resolving storage.googleapis.com (storage.googleapis.com)... 216.58.208.48, 2a00:1450:4001:815::2010

Connecting to storage.googleapis.com (storage.googleapis.com)|216.58.208.48|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 12568314 (12M) [application/x-tar]

Saving to: ‘helm-v2.3.0-linux-amd64.tar.gz’


helm-v2.3.0-linux-amd64.tar.gz                   100%[========================================================================================================>]  11.99M  10.8MB/s    in 1.1s


2017-11-08 20:12:32 (10.8 MB/s) - ‘helm-v2.3.0-linux-amd64.tar.gz’ saved [12568314/12568314]

2

Untar the Helm tar file

tar -zxvf helm-v2.3.0-linux-amd64.tar.gz

$ tar -zxvf helm-v2.3.0-linux-amd64.tar.gz

linux-amd64/

linux-amd64/helm

linux-amd64/LICENSE

linux-amd64/README.md

3

Enable the Helm command

sudo mv linux-amd64/helm /usr/local/bin/helm

 Tip of viewing helm command menu

ubuntu@sdnc-k8s:~$ helm help

The Kubernetes package manager

 

To begin working with Helm, run the 'helm init' command:

 

        $ helm init

 

This will install Tiller to your running Kubernetes cluster.

It will also set up any necessary local configuration.

 

Common actions from this point include:

 

- helm search:    search for charts

- helm fetch:     download a chart to your local directory to view

- helm install:   upload the chart to Kubernetes

- helm list:      list releases of charts

 

Environment:

  $HELM_HOME          set an alternative location for Helm files. By default, these are stored in ~/.helm

  $HELM_HOST          set an alternative Tiller host. The format is host:port

  $HELM_NO_PLUGINS    disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.

  $TILLER_NAMESPACE   set an alternative Tiller namespace (default "kube-namespace")

  $KUBECONFIG         set an alternative Kubernetes configuration file (default "~/.kube/config")

 

Usage:

  helm [command]

 

Available Commands:

  completion  Generate bash autocompletions script

  create      create a new chart with the given name

  delete      given a release name, delete the release from Kubernetes

  dependency  manage a chart's dependencies

  fetch        download a chart from a repository and (optionally) unpack it in local directory

  get          download a named release

  history       fetch release history

  home         displays the location of HELM_HOME

  init         initialize Helm on both client and server

  inspect      inspect a chart

  install     install a chart archive

  lint         examines a chart for possible issues

  list         list releases

  package      package a chart directory into a chart archive

  plugin      add, list, or remove Helm plugins

  repo        add, list, remove, update, and index chart repositories

  reset        uninstalls Tiller from a cluster

  reset        uninstalls Tiller from a cluster

  rollback    roll back a release to a previous revision

  search      search for a keyword in charts

  serve        start a local http web server

  status      displays the status of the named release

  test        test a release

  test        test a release

  upgrade     upgrade a release

  verify      verify that a chart at the given path has been signed and is valid

  version     print the client/server version information

  version      print the client/server version information

 

Flags:

      --debug                     enable verbose output

      --home string                location of your Helm config. Overrides $HELM_HOME (default "/home/ubuntu/.helm")

      --host string               address of tiller. Overrides $HELM_HOST

      --kube-context string        name of the kubeconfig context to use

      --tiller-namespace string   namespace of tiller (default "kube-system")

 

Use "helm [command] --help" for more information about a command.

  • No labels