Skip to content

Commit

Permalink
Fix delete-node.service kubectl service exec's
Browse files Browse the repository at this point in the history
* Fix delete-node service that runs on worker (cloud-only)
shutdown to delete a Kubernetes node. Regressed in #669
(unreleased)
* Use rkt `--exec` to invoke kubectl binary in the kubelet
image
* Use podman `--entrypoint` to invoke the kubectl binary in
the kubelet image
  • Loading branch information
dghubble committed Mar 28, 2020
1 parent a1a5da6 commit fc686c8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions aws/container-linux/kubernetes/workers/cl/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ storage:
docker://quay.io/poseidon/kubelet:v1.18.0 \
--net=host \
--dns=host \
-- \
/usr/local/bin/kubectl --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
--exec=/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
passwd:
users:
- name: core
Expand Down
3 changes: 1 addition & 2 deletions azure/container-linux/kubernetes/workers/cl/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ storage:
docker://quay.io/poseidon/kubelet:v1.18.0 \
--net=host \
--dns=host \
-- \
/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname | tr '[:upper:]' '[:lower:]')
--exec=/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname | tr '[:upper:]' '[:lower:]')
passwd:
users:
- name: core
Expand Down
3 changes: 1 addition & 2 deletions digital-ocean/container-linux/kubernetes/cl/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,4 @@ storage:
docker://quay.io/poseidon/kubelet:v1.18.0 \
--net=host \
--dns=host \
-- \
/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
--exec=/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ storage:
docker://quay.io/poseidon/kubelet:v1.18.0 \
--net=host \
--dns=host \
-- \
/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
--exec=/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
passwd:
users:
- name: core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ systemd:
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/bin/bash -c '/usr/bin/podman run --volume /etc/kubernetes:/etc/kubernetes:ro,z --entrypoint /usr/local/bin/kubectl quay.io/poseidon/kubelet:v1.18.0 kubectl --kubeconfig=/etc/kubernetes/kubeconfig delete node $HOSTNAME'
ExecStop=/bin/bash -c '/usr/bin/podman run --volume /etc/kubernetes:/etc/kubernetes:ro,z --entrypoint /usr/local/bin/kubectl quay.io/poseidon/kubelet:v1.18.0 --kubeconfig=/etc/kubernetes/kubeconfig delete node $HOSTNAME'
[Install]
WantedBy=multi-user.target
storage:
Expand Down

0 comments on commit fc686c8

Please sign in to comment.