diff options
| author | Ryan Hallisey <rhallise@redhat.com> | 2014-12-22 21:40:34 +0000 |
|---|---|---|
| committer | Ryan Hallisey <rhallise@redhat.com> | 2015-01-05 23:26:19 +0000 |
| commit | 8229c1f6c3448f5b00d04cdf3928ca5776a44ff8 (patch) | |
| tree | 84890e6c74b70a5b854f9244d64fa2cfd98fda0b /tools | |
| parent | 31e4fa1937639dd538f2c07d123d972104475cf4 (diff) | |
| download | kolla-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-x | tools/start-all-pods | 2 | ||||
| -rwxr-xr-x | tools/start-all-replications | 3 | ||||
| -rwxr-xr-x | tools/start-all-services | 2 | ||||
| -rwxr-xr-x | tools/stop-all-pods | 21 | ||||
| -rwxr-xr-x | tools/stop-all-replications | 10 | ||||
| -rwxr-xr-x | tools/stop-all-services | 9 |
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 |
