Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible role to install OpenEBS using Helm #1372

Merged
merged 1 commit into from Mar 23, 2018
Merged

Ansible role to install OpenEBS using Helm #1372

merged 1 commit into from Mar 23, 2018

Conversation

gprasath
Copy link
Member

Signed-off-by: gprasath giridhara.prasad@cloudbyte.com

What this PR does / why we need it:

Implemented ansible role to install OpenEBS using helm

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #1133

Special notes for your reviewer:

Tasks included in the role are as follows:

  • Install helm
  • Install tiller
  • Check successful installation
  • Update the charts repo
  • Add service account, clusterrolebinding and patch the deployment
  • Install OpenEBS
  • Check if the installation was successful

Test snippet

giri@vagrant-host:~/openebs/e2e/ansible$ ansible-playbook openebs-helm/test-helm.yaml -vv
ansible-playbook 2.4.3.0
  config file = /home/giri/openebs/e2e/ansible/ansible.cfg
  configured module search path = [u'/home/giri/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
Using /home/giri/openebs/e2e/ansible/ansible.cfg as config file

PLAYBOOK: test-helm.yaml ***********************************************************************************************************************************************
1 plays in openebs-helm/test-helm.yaml

PLAY [kubernetes-kubemasters] ******************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************
ok: [kubemaster01]
META: ran handlers

TASK [k8s-openebs-operator-helm : Install helm] ************************************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:2
 [WARNING]: Consider using get_url or uri module rather than running curl

changed: [kubemaster01] => {"changed": true, "cmd": "curl -Lo /tmp/helm-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.6.2-linux-amd64.tar.gz; tar -xvf /tmp/helm-linux-amd64.tar.gz -C /tmp/; chmod +x /tmp/linux-amd64/helm && sudo mv /tmp/linux-amd64/helm /usr/local/bin/", "delta": "0:00:04.571138", "end": "2018-03-22 15:20:00.005185", "rc": 0, "start": "2018-03-22 15:19:55.434047", "stderr": "  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n\r  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r  0 15.5M    0   590    0     0    705      0  6:25:49 --:--:--  6:25:49   705\r 82 15.5M   82 12.7M    0     0  7237k      0  0:00:02  0:00:01  0:00:01 7238k\r100 15.5M  100 15.5M    0     0  8525k      0  0:00:01  0:00:01 --:--:-- 8522k", "stderr_lines": ["  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current", "                                 Dload  Upload   Total   Spent    Left  Speed", "", "  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0", "  0 15.5M    0   590    0     0    705      0  6:25:49 --:--:--  6:25:49   705", " 82 15.5M   82 12.7M    0     0  7237k      0  0:00:02  0:00:01  0:00:01 7238k", "100 15.5M  100 15.5M    0     0  8525k      0  0:00:01  0:00:01 --:--:-- 8522k"], "stdout": "linux-amd64/\nlinux-amd64/helm\nlinux-amd64/LICENSE\nlinux-amd64/README.md", "stdout_lines": ["linux-amd64/", "linux-amd64/helm", "linux-amd64/LICENSE", "linux-amd64/README.md"]}

TASK [k8s-openebs-operator-helm : Tiller setup] ************************************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:16
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "helm init", "delta": "0:00:00.959016", "end": "2018-03-22 15:20:02.080450", "rc": 0, "start": "2018-03-22 15:20:01.121434", "stderr": "", "stderr_lines": [], "stdout": "$HELM_HOME has been configured at /home/ubuntu/.helm.\n\nTiller (the Helm server-side component) has been installed into your Kubernetes Cluster.\nHappy Helming!", "stdout_lines": ["$HELM_HOME has been configured at /home/ubuntu/.helm.", "", "Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.", "Happy Helming!"]}

TASK [k8s-openebs-operator-helm : Check if tiller is configured] *******************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:25
FAILED - RETRYING: Check if tiller is configured (3 retries left).
changed: [kubemaster01] => {"attempts": 2, "changed": true, "cmd": "helm version", "delta": "0:00:01.312164", "end": "2018-03-22 15:20:20.446929", "rc": 0, "start": "2018-03-22 15:20:19.134765", "stderr": "", "stderr_lines": [], "stdout": "Client: &version.Version{SemVer:\"v2.6.2\", GitCommit:\"be3ae4ea91b2960be98c07e8f73754e67e87963c\", GitTreeState:\"clean\"}\nServer: &version.Version{SemVer:\"v2.6.2\", GitCommit:\"be3ae4ea91b2960be98c07e8f73754e67e87963c\", GitTreeState:\"clean\"}", "stdout_lines": ["Client: &version.Version{SemVer:\"v2.6.2\", GitCommit:\"be3ae4ea91b2960be98c07e8f73754e67e87963c\", GitTreeState:\"clean\"}", "Server: &version.Version{SemVer:\"v2.6.2\", GitCommit:\"be3ae4ea91b2960be98c07e8f73754e67e87963c\", GitTreeState:\"clean\"}"]}

TASK [k8s-openebs-operator-helm : Creating service account] ************************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:34
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "kubectl -n kube-system create sa tiller", "delta": "0:00:00.652020", "end": "2018-03-22 15:20:21.848479", "rc": 0, "start": "2018-03-22 15:20:21.196459", "stderr": "", "stderr_lines": [], "stdout": "serviceaccount \"tiller\" created", "stdout_lines": ["serviceaccount \"tiller\" created"]}

TASK [k8s-openebs-operator-helm : Create cluster rolebinding] **********************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:43
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller", "delta": "0:00:00.749011", "end": "2018-03-22 15:20:23.401093", "rc": 0, "start": "2018-03-22 15:20:22.652082", "stderr": "", "stderr_lines": [], "stdout": "clusterrolebinding \"tiller\" created", "stdout_lines": ["clusterrolebinding \"tiller\" created"]}

TASK [k8s-openebs-operator-helm : Getting home directory in kubernetes master] *****************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:52
changed: [kubemaster01] => {"changed": true, "cmd": "source ~/.profile; echo $HOME", "delta": "0:00:00.029705", "end": "2018-03-22 15:20:24.363362", "rc": 0, "start": "2018-03-22 15:20:24.333657", "stderr": "", "stderr_lines": [], "stdout": "/home/ubuntu", "stdout_lines": ["/home/ubuntu"]}

TASK [k8s-openebs-operator-helm : Copy yaml file to kubernetes master] *************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:58
ok: [kubemaster01] => {"changed": false, "checksum": "6e4809589a615f2dff209cc087f25ad683e55025", "gid": 1000, "group": "ubuntu", "mode": "0664", "owner": "ubuntu", "path": "/home/ubuntu/update.json", "size": 111, "state": "file", "uid": 1000}

TASK [k8s-openebs-operator-helm : Update the deployment] ***************************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:63
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "kubectl -n kube-system patch deploy/tiller-deploy -p \"$(cat update.json)\"", "delta": "0:00:00.995067", "end": "2018-03-22 15:20:28.703038", "rc": 0, "start": "2018-03-22 15:20:27.707971", "stderr": "", "stderr_lines": [], "stdout": "deployment \"tiller-deploy\" patched", "stdout_lines": ["deployment \"tiller-deploy\" patched"]}

TASK [k8s-openebs-operator-helm : Adding OpenEBS charts to repo] *******************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:72
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "helm repo add openebs-charts \"https://openebs.github.io/charts/\"", "delta": "0:00:01.124743", "end": "2018-03-22 15:20:30.402895", "rc": 0, "start": "2018-03-22 15:20:29.278152", "stderr": "", "stderr_lines": [], "stdout": "\"openebs-charts\" has been added to your repositories", "stdout_lines": ["\"openebs-charts\" has been added to your repositories"]}

TASK [k8s-openebs-operator-helm : Update the repo] *********************************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:81
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "helm repo update", "delta": "0:00:01.665622", "end": "2018-03-22 15:20:32.918656", "rc": 0, "start": "2018-03-22 15:20:31.253034", "stderr": "", "stderr_lines": [], "stdout": "Hang tight while we grab the latest from your chart repositories...\n...Skip local chart repository\n...Successfully got an update from the \"openebs-charts\" chart repository\n...Successfully got an update from the \"stable\" chart repository\nUpdate Complete. ⎈ Happy Helming!⎈ ", "stdout_lines": ["Hang tight while we grab the latest from your chart repositories...", "...Skip local chart repository", "...Successfully got an update from the \"openebs-charts\" chart repository", "...Successfully got an update from the \"stable\" chart repository", "Update Complete. ⎈ Happy Helming!⎈ "]}

TASK [k8s-openebs-operator-helm : Install openebs] *********************************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:90
FAILED - RETRYING: Install openebs (3 retries left).
changed: [kubemaster01] => {"attempts": 2, "changed": true, "cmd": "helm install openebs-charts/openebs", "delta": "0:00:11.754541", "end": "2018-03-22 15:20:56.541206", "rc": 0, "start": "2018-03-22 15:20:44.786665", "stderr": "", "stderr_lines": [], "stdout": "NAME:   banking-stingeray\nLAST DEPLOYED: Thu Mar 22 15:20:46 2018\nNAMESPACE: default\nSTATUS: DEPLOYED\n\nRESOURCES:\n==> v1beta1/ClusterRole\nNAME                   AGE\nopenebs-maya-operator  3s\n\n==> v1beta1/ClusterRoleBinding\nNAME                   AGE\nopenebs-maya-operator  3s\n\n==> v1/Namespace\nNAME     STATUS  AGE\nopenebs  Active  3s\n\n==> v1/ConfigMap\nNAME                                           DATA  AGE\nbanking-stingeray-openebs-prometheus-config    1     3s\nbanking-stingeray-openebs-prometheus-tunables  1     3s\n\n==> v1/StorageClass\nNAME                TYPE\nopenebs-cassandra   openebs.io/provisioner-iscsi  \nopenebs-es-data-sc  openebs.io/provisioner-iscsi  \nopenebs-jupyter     openebs.io/provisioner-iscsi  \nopenebs-kafka       openebs.io/provisioner-iscsi  \nopenebs-mongodb     openebs.io/provisioner-iscsi  \nopenebs-percona     openebs.io/provisioner-iscsi  \nopenebs-redis       openebs.io/provisioner-iscsi  \nopenebs-standalone  openebs.io/provisioner-iscsi  \nopenebs-standard    openebs.io/provisioner-iscsi  \nopenebs-zk          openebs.io/provisioner-iscsi  \n\n==> v1/ServiceAccount\nNAME                   SECRETS  AGE\nopenebs-maya-operator  1        3s\n\n==> v1/Service\nNAME                                          CLUSTER-IP      EXTERNAL-IP  PORT(S)         AGE\nbanking-stingeray-openebs-maya-apiservice     10.98.249.91    <none>       5656/TCP        3s\nbanking-stingeray-openebs-grafana             10.106.180.193  <nodes>      3000:32515/TCP  3s\nbanking-stingeray-openebs-prometheus-service  10.108.79.26    <nodes>      80:32514/TCP    3s\n\n==> v1beta1/Deployment\nNAME                                      DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE\nbanking-stingeray-openebs-maya-apiserver  2        2        2           0          3s\nbanking-stingeray-openebs-provisioner     2        2        2           0          3s\nbanking-stingeray-openebs-grafana         1        1        1           0          2s\nbanking-stingeray-openebs-prometheus      1        1        1           0          2s\n\n==> v1beta1/CustomResourceDefinition\nNAME                          KIND\nstoragepools.openebs.io       CustomResourceDefinition.v1beta1.apiextensions.k8s.io\nstoragepoolclaims.openebs.io  CustomResourceDefinition.v1beta1.apiextensions.k8s.io\n\n\nNOTES:\nThe OpenEBS has been installed. Check its status by running:\n  kubectl get pods -l \"name=maya-apiserver\"\n\nTo use OpenEBS Volumes, your nodes should have the iSCSI initiator installed. \nPlease visit http://openebs.readthedocs.io/en/latest/getting_started/quick_install.html for instructions", "stdout_lines": ["NAME:   banking-stingeray", "LAST DEPLOYED: Thu Mar 22 15:20:46 2018", "NAMESPACE: default", "STATUS: DEPLOYED", "", "RESOURCES:", "==> v1beta1/ClusterRole", "NAME                   AGE", "openebs-maya-operator  3s", "", "==> v1beta1/ClusterRoleBinding", "NAME                   AGE", "openebs-maya-operator  3s", "", "==> v1/Namespace", "NAME     STATUS  AGE", "openebs  Active  3s", "", "==> v1/ConfigMap", "NAME                                           DATA  AGE", "banking-stingeray-openebs-prometheus-config    1     3s", "banking-stingeray-openebs-prometheus-tunables  1     3s", "", "==> v1/StorageClass", "NAME                TYPE", "openebs-cassandra   openebs.io/provisioner-iscsi  ", "openebs-es-data-sc  openebs.io/provisioner-iscsi  ", "openebs-jupyter     openebs.io/provisioner-iscsi  ", "openebs-kafka       openebs.io/provisioner-iscsi  ", "openebs-mongodb     openebs.io/provisioner-iscsi  ", "openebs-percona     openebs.io/provisioner-iscsi  ", "openebs-redis       openebs.io/provisioner-iscsi  ", "openebs-standalone  openebs.io/provisioner-iscsi  ", "openebs-standard    openebs.io/provisioner-iscsi  ", "openebs-zk          openebs.io/provisioner-iscsi  ", "", "==> v1/ServiceAccount", "NAME                   SECRETS  AGE", "openebs-maya-operator  1        3s", "", "==> v1/Service", "NAME                                          CLUSTER-IP      EXTERNAL-IP  PORT(S)         AGE", "banking-stingeray-openebs-maya-apiservice     10.98.249.91    <none>       5656/TCP        3s", "banking-stingeray-openebs-grafana             10.106.180.193  <nodes>      3000:32515/TCP  3s", "banking-stingeray-openebs-prometheus-service  10.108.79.26    <nodes>      80:32514/TCP    3s", "", "==> v1beta1/Deployment", "NAME                                      DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE", "banking-stingeray-openebs-maya-apiserver  2        2        2           0          3s", "banking-stingeray-openebs-provisioner     2        2        2           0          3s", "banking-stingeray-openebs-grafana         1        1        1           0          2s", "banking-stingeray-openebs-prometheus      1        1        1           0          2s", "", "==> v1beta1/CustomResourceDefinition", "NAME                          KIND", "storagepools.openebs.io       CustomResourceDefinition.v1beta1.apiextensions.k8s.io", "storagepoolclaims.openebs.io  CustomResourceDefinition.v1beta1.apiextensions.k8s.io", "", "", "NOTES:", "The OpenEBS has been installed. Check its status by running:", "  kubectl get pods -l \"name=maya-apiserver\"", "", "To use OpenEBS Volumes, your nodes should have the iSCSI initiator installed. ", "Please visit http://openebs.readthedocs.io/en/latest/getting_started/quick_install.html for instructions"]}

TASK [k8s-openebs-operator-helm : Check if provisioner is deployed] ****************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:99
FAILED - RETRYING: Check if provisioner is deployed (5 retries left).
changed: [kubemaster01] => {"attempts": 2, "changed": true, "cmd": "kubectl get pods -n \"openebs\" | grep \"openebs-provisioner\"", "delta": "0:00:01.438398", "end": "2018-03-22 15:21:10.055723", "rc": 0, "start": "2018-03-22 15:21:08.617325", "stderr": "", "stderr_lines": [], "stdout": "banking-stingeray-openebs-provisioner-659cd884bb-69kxv      1/1       Running   0          16s\nbanking-stingeray-openebs-provisioner-659cd884bb-dlqxq      1/1       Running   0          16s", "stdout_lines": ["banking-stingeray-openebs-provisioner-659cd884bb-69kxv      1/1       Running   0          16s", "banking-stingeray-openebs-provisioner-659cd884bb-dlqxq      1/1       Running   0          16s"]}

TASK [k8s-openebs-operator-helm : Check if maya-apiserver is deployed] *************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:108
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "kubectl get pods -n \"openebs\" | grep \"openebs-maya-apiserver\"", "delta": "0:00:00.848567", "end": "2018-03-22 15:21:11.646891", "rc": 0, "start": "2018-03-22 15:21:10.798324", "stderr": "", "stderr_lines": [], "stdout": "banking-stingeray-openebs-maya-apiserver-7bc57696b6-kwnk8   1/1       Running   0          17s\nbanking-stingeray-openebs-maya-apiserver-7bc57696b6-n6lb6   1/1       Running   0          17s", "stdout_lines": ["banking-stingeray-openebs-maya-apiserver-7bc57696b6-kwnk8   1/1       Running   0          17s", "banking-stingeray-openebs-maya-apiserver-7bc57696b6-n6lb6   1/1       Running   0          17s"]}

TASK [k8s-openebs-operator-helm : Check if storage classes are created] ************************************************************************************************
task path: /home/giri/openebs/e2e/ansible/roles/k8s-openebs-operator-helm/tasks/main.yaml:117
changed: [kubemaster01] => {"attempts": 1, "changed": true, "cmd": "kubectl get sc", "delta": "0:00:00.694224", "end": "2018-03-22 15:21:13.051480", "rc": 0, "start": "2018-03-22 15:21:12.357256", "stderr": "", "stderr_lines": [], "stdout": "NAME                 PROVISIONER\nopenebs-cassandra    openebs.io/provisioner-iscsi\nopenebs-es-data-sc   openebs.io/provisioner-iscsi\nopenebs-jupyter      openebs.io/provisioner-iscsi\nopenebs-kafka        openebs.io/provisioner-iscsi\nopenebs-mongodb      openebs.io/provisioner-iscsi\nopenebs-percona      openebs.io/provisioner-iscsi\nopenebs-redis        openebs.io/provisioner-iscsi\nopenebs-standalone   openebs.io/provisioner-iscsi\nopenebs-standard     openebs.io/provisioner-iscsi\nopenebs-zk           openebs.io/provisioner-iscsi", "stdout_lines": ["NAME                 PROVISIONER", "openebs-cassandra    openebs.io/provisioner-iscsi", "openebs-es-data-sc   openebs.io/provisioner-iscsi", "openebs-jupyter      openebs.io/provisioner-iscsi", "openebs-kafka        openebs.io/provisioner-iscsi", "openebs-mongodb      openebs.io/provisioner-iscsi", "openebs-percona      openebs.io/provisioner-iscsi", "openebs-redis        openebs.io/provisioner-iscsi", "openebs-standalone   openebs.io/provisioner-iscsi", "openebs-standard     openebs.io/provisioner-iscsi", "openebs-zk           openebs.io/provisioner-iscsi"]}
META: ran handlers
META: ran handlers

PLAY RECAP *************************************************************************************************************************************************************
kubemaster01               : ok=15   changed=13   unreachable=0    failed=0

Signed-off-by: gprasath <giridhara.prasad@cloudbyte.com>
@kmova kmova added the Review Must review label Mar 22, 2018
@gprasath
Copy link
Member Author

@ksatchit Can you please review this

Copy link
Member

@ksatchit ksatchit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gprasath , let us see if we can list desired
pods, deployments by their labels wherever possible.

Otherwise, LGTM 🆗

@ksatchit ksatchit merged commit 63c5b3c into openebs:master Mar 23, 2018
@kmova kmova removed the Review Must review label Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include ansible task files to perform helm install of OpenEBS
3 participants