Skip to content

Commit

Permalink
Added PVC deletion check in test-storage-pool and openebs-percona-own…
Browse files Browse the repository at this point in the history
…namespace in playbooks

Signed-off-by: swarna <swarnalatha@cloudbyte.com>
  • Loading branch information
Swarnalatha-K committed Apr 23, 2018
1 parent b6a85a0 commit 1686007
Show file tree
Hide file tree
Showing 7 changed files with 331 additions and 156 deletions.
Original file line number Diff line number Diff line change
@@ -1,35 +1,51 @@
- hosts: localhost

vars_files:
- openebs-ns-vars.yml

tasks:


- name: Delete percona mysql pod
shell: source ~/.profile; kubectl delete -f "{{ openebs_percona }}"
shell: source ~/.profile; kubectl delete -f "{{ percona_file }}" -n percona
args:
executable: /bin/bash
delegate_to: "{{groups['kubernetes-kubemasters'].0}}"

- name: Confirm percona pod has been deleted
shell: source ~/.profile; kubectl get pods
shell: source ~/.profile; kubectl get pods --all-namespaces -l name=percona
args:
executable: /bin/bash
delegate_to: "{{groups['kubernetes-kubemasters'].0}}"
register: result
until: "'percona' not in result.stdout"
delay: 30
retries: 10

- name: Get pvc name to verify successful pvc deletion
shell: source ~/.profile; kubectl get pvc --all-namespaces | grep {{ replace_with.0 }} | awk {'print $3'}
args:
executable: /bin/bash
delegate_to: "{{groups['kubernetes-kubemasters'].0}}"
register: pvc

- name: Confirm percona pvc pod has been deleted
shell: source ~/.profile; kubectl get pods --all-namespaces | grep {{ pvc.stdout }}
args:
executable: /bin/bash
delegate_to: "{{groups['kubernetes-kubemasters'].0}}"
register: result
until: "'percona' not in result.stdout"
delay: 120
retries: 6
failed_when: "'pvc' and 'Running' in result.stdout"
delay: 30
retried: 10

- name: Delete the openebs operator
shell: source ~/.profile; kubectl delete -f "{{ openebs_operator }}"
args:
executable: /bin/bash
delegate_to: "{{groups['kubernetes-kubemasters'].0}}"

ignore_errors: true

- name: Confirm pod has been deleted
shell: source ~/.profile; kubectl get pods
shell: source ~/.profile; kubectl get pods --all-namespaces
args:
executable: /bin/bash
register: result
Expand All @@ -39,3 +55,11 @@
delegate_to: "{{groups['kubernetes-kubemasters'].0}}"


- name: Remove test artifacts artifcats
shell: rm -rf {{ percona_file }}; rm -rf {{ openebs_operator }}
args:
executable: /bin/bash
delegate_to: "{{groups['kubernetes-kubemasters'].0}}"



Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,34 @@ openebs_operator_alias: openebs-operator.yaml

openebs_storageclass: openebs-storageclasses.yaml

openebs_percona: percona-ns-percona-sc-percona.yaml

openebs_storageclasses_link: https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-storageclasses.yaml

percona_loadgen: sql-loadgen.yaml

openebs_storageclasses_alias: openebs-storageclasses.yaml

percona_mysql_plugin_link: https://raw.githubusercontent.com/openebs/openebs/master/k8s/demo/percona/demo-percona-mysql-pvc.yaml

# Image tag for openebs containers
# Accepted entries (ci, latest): Default: latest
test_tag: latest

percona_links:
- https://raw.githubusercontent.com/openebs/elves/master/e2e/percona-liveness/percona.yaml
- https://raw.githubusercontent.com/openebs/elves/master/e2e/percona-liveness/sql-test.sh

pod_yaml_alias: demo-percona-mysql-pvc.yaml
percona_file: demo-percona-mysql-pvc.yaml

percona_mysql_vol_size: 5G
replace_item:
- demo-vol1-claim
- demo-vol1

replace_with:
- percona-diffns-claim
- percona-diffns

test_name: deploy openebs and percona with its own namespace

deb_packages:
- python-pip

test_pod_regex: maya*|openebs*|pvc*|percona*

test_log_path: setup/logs/openebs-percona-ownnamespace.log
Loading

0 comments on commit 1686007

Please sign in to comment.