Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

delete-node.service cannot access kubeconfig when using tls bootstrap #917

Closed
surajssd opened this issue Sep 8, 2020 · 2 comments · Fixed by #946
Closed

delete-node.service cannot access kubeconfig when using tls bootstrap #917

surajssd opened this issue Sep 8, 2020 · 2 comments · Fixed by #946
Labels
bug Something isn't working platform/aws AWS-related platform/packet Packet-related

Comments

@surajssd
Copy link
Member

surajssd commented Sep 8, 2020

Here is the script that runs under in delete-node.service:

- path: /etc/kubernetes/delete-node
filesystem: root
mode: 0744
contents:
inline: |
#!/bin/bash
set -e
exec /usr/bin/rkt run \
--trust-keys-from-https \
--volume config,kind=host,source=/etc/kubernetes \
--mount volume=config,target=/etc/kubernetes \
--insecure-options=image \
docker://quay.io/poseidon/kubelet:v1.18.8 \
--net=host \
--dns=host \
-- \
%{~ if enable_tls_bootstrap ~}
kubectl --kubeconfig=/var/lib/kubelet/kubeconfig delete node $(hostname)
%{~ else ~}
kubectl --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
%{ endif }

As you can see only one volume is mounted here /etc/kubernetes and not the /var/lib/kubelet/ so kubectl will fail in such a case.

@surajssd surajssd added bug Something isn't working platform/aws AWS-related platform/packet Packet-related labels Sep 8, 2020
@invidian
Copy link
Member

Does #946 address that?

@surajssd
Copy link
Member Author

@invidian yes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working platform/aws AWS-related platform/packet Packet-related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants