Fix file /etc/kubernetes/admin.conf absent with k3s
This commit is contained in:
parent
2c69995cf9
commit
714868ab71
1 changed files with 13 additions and 0 deletions
|
|
@ -89,6 +89,18 @@
|
||||||
- kubernetes_master|bool
|
- kubernetes_master|bool
|
||||||
- kubernetes_cri == "k3s"
|
- kubernetes_cri == "k3s"
|
||||||
|
|
||||||
|
- name: Make link from /etc/rancher/k3s/k3s.yaml to /etc/kubernetes/admin.conf
|
||||||
|
file:
|
||||||
|
src: "/etc/rancher/k3s/k3s.yaml"
|
||||||
|
state: link
|
||||||
|
dest: "/etc/kubernetes/admin.conf"
|
||||||
|
force: yes
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
when:
|
||||||
|
- kubernetes_master|bool
|
||||||
|
- kubernetes_cri == "k3s"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Manque autoconfig de .kube/config local
|
# Manque autoconfig de .kube/config local
|
||||||
#
|
#
|
||||||
|
|
@ -100,6 +112,7 @@
|
||||||
# when:
|
# when:
|
||||||
# - kubernetes_master|bigip_pool
|
# - kubernetes_master|bigip_pool
|
||||||
|
|
||||||
|
# kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints --no-headers
|
||||||
- name: Check if a node is still tainted
|
- name: Check if a node is still tainted
|
||||||
ansible.builtin.command: kubectl --kubeconfig=/etc/kubernetes/admin.conf get nodes '{{ ansible_hostname | lower }}' -o jsonpath='{.spec.taints}'
|
ansible.builtin.command: kubectl --kubeconfig=/etc/kubernetes/admin.conf get nodes '{{ ansible_hostname | lower }}' -o jsonpath='{.spec.taints}'
|
||||||
register: current_taint
|
register: current_taint
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue