Skip to content

Commit

Permalink
move job to kube-system
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg May committed Mar 27, 2020
1 parent df366f7 commit 8cbaec6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions node-restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function wait_for_job_completion() {
pod=$1
i=0
while [[ $i -lt 30 ]]; do
status=$(kubectl get job $pod -o "jsonpath={.status.succeeded}" 2>/dev/null)
status=$(kubectl get job $pod -n kube-system -o "jsonpath={.status.succeeded}" 2>/dev/null)
if [[ $status -gt 0 ]]; then
echo "Restart complete after $((i*10)) seconds"
break;
Expand Down Expand Up @@ -144,6 +144,7 @@ apiVersion: batch/v1
kind: Job
metadata:
name: $pod
namespace: kube-system
spec:
backoffLimit: 3
ttlSecondsAfterFinished: 30
Expand Down Expand Up @@ -177,7 +178,7 @@ EOT
echo "kubectl uncordon $node"
else
kubectl uncordon "$node"
kubectl delete job $pod
kubectl delete job $pod -n kube-system
sleep $nodesleep
fi
done
4 changes: 2 additions & 2 deletions node-restart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ kind: Plugin
metadata:
name: node-restart
spec:
version: "v0.0.2"
version: "v1.0.0"
platforms:
- selector:
matchExpressions:
- {key: os, operator: In, values: [darwin, linux]}
uri: https://github.com/MnrGreg/kubectl-node-restart/releases/download/v0.0.2/v0.0.2.zip
uri: https://github.com/MnrGreg/kubectl-node-restart/releases/download/v1.0.0/v1.0.0.zip
sha256: "44db0eee9603085652837d26c5352287864f158b557f78ae19325724640535f8"
files:
- from: "*.sh"
Expand Down

0 comments on commit 8cbaec6

Please sign in to comment.