aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRyan Hallisey <rhallise@redhat.com>2014-12-22 21:40:34 +0000
committerRyan Hallisey <rhallise@redhat.com>2015-01-05 23:26:19 +0000
commit8229c1f6c3448f5b00d04cdf3928ca5776a44ff8 (patch)
tree84890e6c74b70a5b854f9244d64fa2cfd98fda0b /tools
parent31e4fa1937639dd538f2c07d123d972104475cf4 (diff)
downloadkolla-8229c1f6c3448f5b00d04cdf3928ca5776a44ff8.tar.gz
kolla-8229c1f6c3448f5b00d04cdf3928ca5776a44ff8.zip
Start and stop scripts are outdated after Kubernetes update
Kubernetes no longer uses 'kubecfg', but rather 'kubectl'. Therefore, the way that pods and services are being created needs to be changed. In order to create a pod, the parameter 'kind' needs to be set to 'pod' in the yaml file and the api version specified. The stop script now reads from k8s/{pod,service,replication}/ in order to stop all the started pods, services, and replication controllers. Change-Id: Ibd39fa402e9df883df83272c3aefbb69009dfbd2
Diffstat (limited to 'tools')
-rwxr-xr-xtools/start-all-pods2
-rwxr-xr-xtools/start-all-replications3
-rwxr-xr-xtools/start-all-services2
-rwxr-xr-xtools/stop-all-pods21
-rwxr-xr-xtools/stop-all-replications10
-rwxr-xr-xtools/stop-all-services9
6 files changed, 34 insertions, 13 deletions
diff --git a/tools/start-all-pods b/tools/start-all-pods
index 089de7678..72c580781 100755
--- a/tools/start-all-pods
+++ b/tools/start-all-pods
@@ -18,6 +18,6 @@ horizon
'
for pod in $pods; do
- kubecfg -c "k8s/pod/${pod}-pod.yaml" create pods
+ kubectl create -f "k8s/pod/${pod}-pod.yaml"
done
diff --git a/tools/start-all-replications b/tools/start-all-replications
index b88572f4a..a605d4fb7 100755
--- a/tools/start-all-replications
+++ b/tools/start-all-replications
@@ -7,7 +7,6 @@ nova-compute
'
for svc in $services; do
- kubecfg -c "k8s/replication/${svc}-replication.yaml" create \
- replicationControllers
+ kubectl create -f "k8s/replication/${svc}-replication.yaml"
done
diff --git a/tools/start-all-services b/tools/start-all-services
index a78e9b186..3c073465f 100755
--- a/tools/start-all-services
+++ b/tools/start-all-services
@@ -22,6 +22,6 @@ horizon
'
for svc in $services; do
- kubecfg -c "k8s/service/${svc}-service.yaml" create services
+ kubectl create -f "k8s/service/${svc}-service.yaml"
done
diff --git a/tools/stop-all-pods b/tools/stop-all-pods
index 4fe4b80d7..2a2d7d3ab 100755
--- a/tools/stop-all-pods
+++ b/tools/stop-all-pods
@@ -1,6 +1,21 @@
#!/bin/sh
-kubecfg list pods |
- awk 'NR>2 {print $1}' |
- xargs -i kubecfg delete pods/{}
+cd $(git rev-parse --show-toplevel)
+# Delete the replication is not cleaning up its pods
+# These pods need to be deleted according to their UUID
+uuids=$(kubectl get pods -o json | jq '.[][].id' 2>/dev/null | grep -o -E '"[a-fA-F|0-9|\-]*' | cut -c 2- | grep '\-')
+
+for uuid in $uuids; do
+ if [ $uuid ]; then
+ kubectl delete pod $uuid
+ fi
+done
+
+pods=$(kubectl get pods -o json| jq '.[][].id' 2>/dev/null)
+# Removes quotes from jquery
+pods=${pods//\"/}
+
+for pod in $pods; do
+ kubectl delete -f "k8s/pod/${pod}-pod.yaml" 2>/dev/null
+done
diff --git a/tools/stop-all-replications b/tools/stop-all-replications
index aa2dc5954..6bea193fd 100755
--- a/tools/stop-all-replications
+++ b/tools/stop-all-replications
@@ -1,6 +1,10 @@
#!/bin/sh
-kubecfg list replicationControllers |
- awk 'NR>2 {print $1}' |
- xargs -i kubecfg delete replicationControllers/{}
+cd $(git rev-parse --show-toplevel)
+
+replication_ctrs=$(kubectl get replicationController | awk 'NR>1 {print $1}')
+
+for replication_ctr in $replication_ctrs; do
+ kubectl delete -f "k8s/replication/${replication_ctr}-replication.yaml"
+done
diff --git a/tools/stop-all-services b/tools/stop-all-services
index c76c24439..df5ce86d3 100755
--- a/tools/stop-all-services
+++ b/tools/stop-all-services
@@ -1,6 +1,9 @@
#!/bin/sh
-kubecfg list services |
- awk 'NR>2 {print $1}' |
- xargs -i kubecfg delete services/{}
+cd $(git rev-parse --show-toplevel)
+services=$(kubectl get services | awk 'NR>1 {print $1}')
+
+for service in $services; do
+ kubectl delete -f "k8s/service/${service}-service.yaml" 2>/dev/null
+done