From a57190fd8acc6ceaeb268aa3b544f1082345da3a Mon Sep 17 00:00:00 2001 From: Gayathri Devi Kathiri Date: Fri, 5 Jun 2020 09:54:13 +0000 Subject: [PATCH] Remove remaining test pods before new test run If the test pod still exists, then the new test run fails with ERROR: pods "abc-test" already exists So, Removing remaining test pods before new test run Change-Id: I3b3ed5ceaf420aa39a669b4a50a838ad154b1fdd Closes-Bug: #1882030 --- tools/deployment/apparmor/030-mariadb.sh | 2 ++ tools/deployment/apparmor/090-elasticsearch.sh | 2 ++ tools/deployment/apparmor/100-fluentbit.sh | 2 ++ tools/deployment/apparmor/110-fluentd-daemonset.sh | 2 ++ tools/deployment/apparmor/140-ceph-radosgateway.sh | 2 ++ tools/deployment/common/010-deploy-docker-registry.sh | 2 ++ tools/deployment/federated-monitoring/060-prometheus.sh | 2 ++ .../federated-monitoring/070-federated-prometheus.sh | 2 ++ tools/deployment/federated-monitoring/090-grafana.sh | 3 +++ tools/deployment/keystone-auth/060-mariadb.sh | 2 ++ tools/deployment/multinode/030-ceph.sh | 6 ++++++ tools/deployment/multinode/035-ceph-ns-activate.sh | 2 ++ tools/deployment/multinode/045-mariadb.sh | 2 ++ tools/deployment/multinode/050-prometheus.sh | 2 ++ tools/deployment/multinode/100-grafana.sh | 2 ++ tools/deployment/multinode/115-radosgw-osh-infra.sh | 2 ++ tools/deployment/multinode/120-elasticsearch.sh | 2 ++ tools/deployment/osh-infra-kafka/050-kafka.sh | 2 ++ tools/deployment/osh-infra-local-storage/040-prometheus.sh | 2 ++ tools/deployment/osh-infra-logging/020-ceph.sh | 5 +++++ tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh | 2 ++ tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh | 2 ++ tools/deployment/osh-infra-logging/050-elasticsearch.sh | 2 ++ tools/deployment/osh-infra-monitoring/045-mariadb.sh | 2 ++ tools/deployment/osh-infra-monitoring/050-prometheus.sh | 2 ++ tools/deployment/osh-infra-monitoring/110-grafana.sh | 2 ++ tools/deployment/osh-infra-monitoring/120-nagios.sh | 2 ++ tools/deployment/tenant-ceph/030-ceph.sh | 5 +++++ tools/deployment/tenant-ceph/060-radosgw-openstack.sh | 2 ++ 29 files changed, 69 insertions(+) diff --git a/tools/deployment/apparmor/030-mariadb.sh b/tools/deployment/apparmor/030-mariadb.sh index 346e69941..434ca972a 100755 --- a/tools/deployment/apparmor/030-mariadb.sh +++ b/tools/deployment/apparmor/030-mariadb.sh @@ -32,5 +32,7 @@ helm upgrade --install mariadb ./mariadb \ #NOTE: Validate Deployment info helm status mariadb +# Delete the test pod if it still exists +kubectl delete pods -l application=mariadb,release_group=mariadb,component=test --namespace=osh-infra --ignore-not-found #NOTE: Validate the deployment helm test mariadb diff --git a/tools/deployment/apparmor/090-elasticsearch.sh b/tools/deployment/apparmor/090-elasticsearch.sh index 79bac722c..987a05f8e 100755 --- a/tools/deployment/apparmor/090-elasticsearch.sh +++ b/tools/deployment/apparmor/090-elasticsearch.sh @@ -77,4 +77,6 @@ helm upgrade --install elasticsearch ./elasticsearch \ #NOTE: Validate Deployment info helm status elasticsearch +# Delete the test pod if it still exists +kubectl delete pods -l application=elasticsearch,release_group=elasticsearch,component=test --namespace=osh-infra --ignore-not-found helm test elasticsearch diff --git a/tools/deployment/apparmor/100-fluentbit.sh b/tools/deployment/apparmor/100-fluentbit.sh index e04cd489a..9e41f106d 100755 --- a/tools/deployment/apparmor/100-fluentbit.sh +++ b/tools/deployment/apparmor/100-fluentbit.sh @@ -35,4 +35,6 @@ helm upgrade --install fluentbit ./fluentbit \ #NOTE: Validate Deployment info helm status fluentbit +# Delete the test pod if it still exists +kubectl delete pods -l application=fluentbit,release_group=fluentbit,component=test --namespace=osh-infra --ignore-not-found helm test fluentbit diff --git a/tools/deployment/apparmor/110-fluentd-daemonset.sh b/tools/deployment/apparmor/110-fluentd-daemonset.sh index e1d1ab295..63de50d2b 100755 --- a/tools/deployment/apparmor/110-fluentd-daemonset.sh +++ b/tools/deployment/apparmor/110-fluentd-daemonset.sh @@ -170,4 +170,6 @@ helm upgrade --install fluentd-daemonset ./fluentd \ #NOTE: Validate Deployment info helm status fluentd-daemonset +# Delete the test pod if it still exists +kubectl delete pods -l application=fluentd,release_group=fluentd-daemonset,component=test --namespace=osh-infra --ignore-not-found helm test fluentd-daemonset diff --git a/tools/deployment/apparmor/140-ceph-radosgateway.sh b/tools/deployment/apparmor/140-ceph-radosgateway.sh index 57dd7a6a5..5518826ef 100755 --- a/tools/deployment/apparmor/140-ceph-radosgateway.sh +++ b/tools/deployment/apparmor/140-ceph-radosgateway.sh @@ -61,4 +61,6 @@ sleep 60 #NOTE(portdirect): Wait for ingress controller to update rules and rest openstack service list openstack endpoint list +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph,release_group=radosgw-openstack,component=rgw-test --namespace=openstack --ignore-not-found helm test radosgw-openstack --timeout 900 \ No newline at end of file diff --git a/tools/deployment/common/010-deploy-docker-registry.sh b/tools/deployment/common/010-deploy-docker-registry.sh index 5d75bd4db..1302c8419 100755 --- a/tools/deployment/common/010-deploy-docker-registry.sh +++ b/tools/deployment/common/010-deploy-docker-registry.sh @@ -57,5 +57,7 @@ helm status docker-registry-nfs-provisioner helm status docker-registry-redis helm status docker-registry +# Delete the test pod if it still exists +kubectl delete pods -l application=redis,release_group=docker-registry-redis,component=test --namespace=docker-registry --ignore-not-found #NOTE: Run helm tests helm test docker-registry-redis diff --git a/tools/deployment/federated-monitoring/060-prometheus.sh b/tools/deployment/federated-monitoring/060-prometheus.sh index 632f262b2..010be3cc3 100755 --- a/tools/deployment/federated-monitoring/060-prometheus.sh +++ b/tools/deployment/federated-monitoring/060-prometheus.sh @@ -62,5 +62,7 @@ for release in prometheus-one prometheus-two prometheus-three; do #NOTE: Validate Deployment info helm status prometheus-$release + # Delete the test pod if it still exists + kubectl delete pods -l application=prometheus,release_group=prometheus-$release,component=test --namespace=osh-infra --ignore-not-found helm test prometheus-$release done diff --git a/tools/deployment/federated-monitoring/070-federated-prometheus.sh b/tools/deployment/federated-monitoring/070-federated-prometheus.sh index 94d3fcdb8..0002bbfa0 100755 --- a/tools/deployment/federated-monitoring/070-federated-prometheus.sh +++ b/tools/deployment/federated-monitoring/070-federated-prometheus.sh @@ -61,4 +61,6 @@ helm upgrade --install federated-prometheus ./prometheus \ #NOTE: Validate Deployment info helm status federated-prometheus +# Delete the test pod if it still exists +kubectl delete pods -l application=prometheus,release_group=federated-prometheus,component=test --namespace=osh-infra --ignore-not-found helm test federated-prometheus diff --git a/tools/deployment/federated-monitoring/090-grafana.sh b/tools/deployment/federated-monitoring/090-grafana.sh index 662d7244f..ae5716579 100755 --- a/tools/deployment/federated-monitoring/090-grafana.sh +++ b/tools/deployment/federated-monitoring/090-grafana.sh @@ -159,6 +159,9 @@ helm upgrade --install grafana ./grafana \ #NOTE: Validate Deployment info helm status grafana +# Delete the test pod if it still exists +kubectl delete pods -l application=grafana,release_group=grafana,component=test --namespace=osh-infra --ignore-not-found + helm test grafana echo "Get list of all configured datasources in Grafana" diff --git a/tools/deployment/keystone-auth/060-mariadb.sh b/tools/deployment/keystone-auth/060-mariadb.sh index 919d935ce..7c78d68e4 100755 --- a/tools/deployment/keystone-auth/060-mariadb.sh +++ b/tools/deployment/keystone-auth/060-mariadb.sh @@ -32,5 +32,7 @@ helm upgrade --install mariadb ./mariadb \ #NOTE: Validate Deployment info helm status mariadb +# Delete the test pod if it still exists +kubectl delete pods -l application=mariadb,release_group=mariadb,component=test --namespace=openstack --ignore-not-found #NOTE: Validate the deployment helm test mariadb diff --git a/tools/deployment/multinode/030-ceph.sh b/tools/deployment/multinode/030-ceph.sh index 57648cb4c..376d5eed1 100755 --- a/tools/deployment/multinode/030-ceph.sh +++ b/tools/deployment/multinode/030-ceph.sh @@ -114,5 +114,11 @@ for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do --no-headers | awk '{ print $1; exit }') kubectl exec -n ceph ${MON_POD} -- ceph -s done + +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph-osd,release_group=ceph-osd,component=test --namespace=ceph --ignore-not-found helm test ceph-osd --timeout 900 + +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph-client,release_group=ceph-client,component=test --namespace=ceph --ignore-not-found helm test ceph-client --timeout 900 diff --git a/tools/deployment/multinode/035-ceph-ns-activate.sh b/tools/deployment/multinode/035-ceph-ns-activate.sh index e8b5c6180..9f1e08d98 100755 --- a/tools/deployment/multinode/035-ceph-ns-activate.sh +++ b/tools/deployment/multinode/035-ceph-ns-activate.sh @@ -55,4 +55,6 @@ helm upgrade --install ceph-osh-infra-config ./ceph-provisioners \ #NOTE: Validate Deployment info helm status ceph-osh-infra-config +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph,release_group=ceph-osh-infra-config,component=provisioner-test --namespace=osh-infra --ignore-not-found helm test ceph-osh-infra-config --timeout 600 diff --git a/tools/deployment/multinode/045-mariadb.sh b/tools/deployment/multinode/045-mariadb.sh index 4de062521..f39f61706 100755 --- a/tools/deployment/multinode/045-mariadb.sh +++ b/tools/deployment/multinode/045-mariadb.sh @@ -33,5 +33,7 @@ helm upgrade --install mariadb ./mariadb \ #NOTE: Validate Deployment info helm status mariadb +# Delete the test pod if it still exists +kubectl delete pods -l application=mariadb,release_group=mariadb,component=test --namespace=osh-infra --ignore-not-found #NOTE: Validate the deployment helm test mariadb diff --git a/tools/deployment/multinode/050-prometheus.sh b/tools/deployment/multinode/050-prometheus.sh index 5c176d782..0a3f8803a 100755 --- a/tools/deployment/multinode/050-prometheus.sh +++ b/tools/deployment/multinode/050-prometheus.sh @@ -33,5 +33,7 @@ helm upgrade --install prometheus ./prometheus \ #NOTE: Validate Deployment info helm status prometheus +# Delete the test pod if it still exists +kubectl delete pods -l application=prometheus,release_group=prometheus,component=test --namespace=osh-infra --ignore-not-found #NOTE: Run helm tests helm test prometheus diff --git a/tools/deployment/multinode/100-grafana.sh b/tools/deployment/multinode/100-grafana.sh index 583c1d433..fceb1c281 100755 --- a/tools/deployment/multinode/100-grafana.sh +++ b/tools/deployment/multinode/100-grafana.sh @@ -33,5 +33,7 @@ helm upgrade --install grafana ./grafana \ #NOTE: Validate Deployment info helm status grafana +# Delete the test pod if it still exists +kubectl delete pods -l application=grafana,release_group=grafana,component=test --namespace=osh-infra --ignore-not-found #NOTE: Run helm tests helm test grafana diff --git a/tools/deployment/multinode/115-radosgw-osh-infra.sh b/tools/deployment/multinode/115-radosgw-osh-infra.sh index 0c9082f9f..824a2ba73 100755 --- a/tools/deployment/multinode/115-radosgw-osh-infra.sh +++ b/tools/deployment/multinode/115-radosgw-osh-infra.sh @@ -69,4 +69,6 @@ helm upgrade --install radosgw-osh-infra ./ceph-rgw \ #NOTE: Validate Deployment info helm status radosgw-osh-infra +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph,release_group=radosgw-osh-infra,component=rgw-test --namespace=osh-infra --ignore-not-found helm test radosgw-osh-infra --timeout 900 diff --git a/tools/deployment/multinode/120-elasticsearch.sh b/tools/deployment/multinode/120-elasticsearch.sh index 790fda11b..3e54dcce6 100755 --- a/tools/deployment/multinode/120-elasticsearch.sh +++ b/tools/deployment/multinode/120-elasticsearch.sh @@ -72,5 +72,7 @@ helm upgrade --install elasticsearch ./elasticsearch \ #NOTE: Validate Deployment info helm status elasticsearch +# Delete the test pod if it still exists +kubectl delete pods -l application=elasticsearch,release_group=elasticsearch,component=test --namespace=osh-infra --ignore-not-found #NOTE: Run helm tests helm test elasticsearch diff --git a/tools/deployment/osh-infra-kafka/050-kafka.sh b/tools/deployment/osh-infra-kafka/050-kafka.sh index 529ff9513..765a5d2c9 100755 --- a/tools/deployment/osh-infra-kafka/050-kafka.sh +++ b/tools/deployment/osh-infra-kafka/050-kafka.sh @@ -27,5 +27,7 @@ helm upgrade --install kafka ./kafka \ #NOTE: Validate deployment info helm status kafka +# Delete the test pod if it still exists +kubectl delete pods -l application=kafka,release_group=kafka,component=test --namespace=osh-infra --ignore-not-found #NOTE: Test deployment helm test kafka diff --git a/tools/deployment/osh-infra-local-storage/040-prometheus.sh b/tools/deployment/osh-infra-local-storage/040-prometheus.sh index 5eb12d94d..c03ce3683 100755 --- a/tools/deployment/osh-infra-local-storage/040-prometheus.sh +++ b/tools/deployment/osh-infra-local-storage/040-prometheus.sh @@ -32,4 +32,6 @@ helm upgrade --install prometheus ./prometheus \ #NOTE: Validate Deployment info helm status prometheus +# Delete the test pod if it still exists +kubectl delete pods -l application=prometheus,release_group=prometheus,component=test --namespace=osh-infra --ignore-not-found helm test prometheus diff --git a/tools/deployment/osh-infra-logging/020-ceph.sh b/tools/deployment/osh-infra-logging/020-ceph.sh index 677caa4bc..3b7df402f 100755 --- a/tools/deployment/osh-infra-logging/020-ceph.sh +++ b/tools/deployment/osh-infra-logging/020-ceph.sh @@ -204,5 +204,10 @@ for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do --no-headers | awk '{ print $1; exit }') kubectl exec -n ceph ${MON_POD} -- ceph -s done + +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph-osd,release_group=ceph-osd,component=test --namespace=ceph --ignore-not-found helm test ceph-osd --timeout 900 +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph-client,release_group=ceph-client,component=test --namespace=ceph --ignore-not-found helm test ceph-client --timeout 900 diff --git a/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh b/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh index de5431831..e5e4c790d 100755 --- a/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh +++ b/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh @@ -51,6 +51,8 @@ helm upgrade --install ceph-osh-infra-config ./ceph-provisioners \ #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph,release_group=ceph-osh-infra-config,component=provisioner-test --namespace=osh-infra --ignore-not-found helm test ceph-osh-infra-config --timeout 600 #NOTE: Validate Deployment info diff --git a/tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh b/tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh index 8dcbfe590..938d565c2 100755 --- a/tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh +++ b/tools/deployment/osh-infra-logging/030-radosgw-osh-infra.sh @@ -57,5 +57,7 @@ helm upgrade --install radosgw-osh-infra ./ceph-rgw \ #NOTE: Validate Deployment info helm status radosgw-osh-infra +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph,release_group=radosgw-osh-infra,component=rgw-test --namespace=osh-infra --ignore-not-found #NOTE: Test Deployment helm test radosgw-osh-infra --timeout 900 diff --git a/tools/deployment/osh-infra-logging/050-elasticsearch.sh b/tools/deployment/osh-infra-logging/050-elasticsearch.sh index 5bbaedd3f..2bbc6cf90 100755 --- a/tools/deployment/osh-infra-logging/050-elasticsearch.sh +++ b/tools/deployment/osh-infra-logging/050-elasticsearch.sh @@ -117,4 +117,6 @@ helm upgrade --install elasticsearch ./elasticsearch \ #NOTE: Validate Deployment info helm status elasticsearch +# Delete the test pod if it still exists +kubectl delete pods -l application=elasticsearch,release_group=elasticsearch,component=test --namespace=osh-infra --ignore-not-found helm test elasticsearch diff --git a/tools/deployment/osh-infra-monitoring/045-mariadb.sh b/tools/deployment/osh-infra-monitoring/045-mariadb.sh index a73e268e5..362b07d09 100755 --- a/tools/deployment/osh-infra-monitoring/045-mariadb.sh +++ b/tools/deployment/osh-infra-monitoring/045-mariadb.sh @@ -33,5 +33,7 @@ helm upgrade --install mariadb ./mariadb \ #NOTE: Validate Deployment info helm status mariadb +# Delete the test pod if it still exists +kubectl delete pods -l application=mariadb,release_group=mariadb,component=test --namespace=osh-infra --ignore-not-found #NOTE: Validate the deployment helm test mariadb diff --git a/tools/deployment/osh-infra-monitoring/050-prometheus.sh b/tools/deployment/osh-infra-monitoring/050-prometheus.sh index 53e0f8e99..4fbb72986 100755 --- a/tools/deployment/osh-infra-monitoring/050-prometheus.sh +++ b/tools/deployment/osh-infra-monitoring/050-prometheus.sh @@ -32,4 +32,6 @@ helm upgrade --install prometheus ./prometheus \ #NOTE: Validate Deployment info helm status prometheus +# Delete the test pod if it still exists +kubectl delete pods -l application=prometheus,release_group=prometheus,component=test --namespace=osh-infra --ignore-not-found helm test prometheus diff --git a/tools/deployment/osh-infra-monitoring/110-grafana.sh b/tools/deployment/osh-infra-monitoring/110-grafana.sh index 302b82e37..6a3c2f8fa 100755 --- a/tools/deployment/osh-infra-monitoring/110-grafana.sh +++ b/tools/deployment/osh-infra-monitoring/110-grafana.sh @@ -32,4 +32,6 @@ helm upgrade --install grafana ./grafana \ #NOTE: Validate Deployment info helm status grafana +# Delete the test pod if it still exists +kubectl delete pods -l application=grafana,release_group=grafana,component=test --namespace=osh-infra --ignore-not-found helm test grafana diff --git a/tools/deployment/osh-infra-monitoring/120-nagios.sh b/tools/deployment/osh-infra-monitoring/120-nagios.sh index 2efd77542..b48f6cff8 100755 --- a/tools/deployment/osh-infra-monitoring/120-nagios.sh +++ b/tools/deployment/osh-infra-monitoring/120-nagios.sh @@ -31,4 +31,6 @@ helm upgrade --install nagios ./nagios \ #NOTE: Validate Deployment info helm status nagios +# Delete the test pod if it still exists +kubectl delete pods -l application=nagios,release_group=nagios,component=test --namespace=osh-infra --ignore-not-found helm test nagios diff --git a/tools/deployment/tenant-ceph/030-ceph.sh b/tools/deployment/tenant-ceph/030-ceph.sh index 72c084f6b..caf6767c9 100755 --- a/tools/deployment/tenant-ceph/030-ceph.sh +++ b/tools/deployment/tenant-ceph/030-ceph.sh @@ -131,5 +131,10 @@ for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do --no-headers | awk '{ print $1; exit }') kubectl exec -n ceph ${MON_POD} -- ceph -s done + +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph-osd,release_group=ceph-osd,component=test --namespace=ceph --ignore-not-found helm test ceph-osd --timeout 900 +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph-client,release_group=ceph-client,component=test --namespace=ceph --ignore-not-found helm test ceph-client --timeout 900 diff --git a/tools/deployment/tenant-ceph/060-radosgw-openstack.sh b/tools/deployment/tenant-ceph/060-radosgw-openstack.sh index bc725866e..67d6bee49 100755 --- a/tools/deployment/tenant-ceph/060-radosgw-openstack.sh +++ b/tools/deployment/tenant-ceph/060-radosgw-openstack.sh @@ -69,4 +69,6 @@ helm upgrade --install radosgw-openstack ./ceph-rgw \ #NOTE: Validate Deployment info helm status radosgw-openstack +# Delete the test pod if it still exists +kubectl delete pods -l application=ceph,release_group=radosgw-openstack,component=rgw-test --namespace=openstack --ignore-not-found helm test radosgw-openstack --timeout 900