-
Notifications
You must be signed in to change notification settings - Fork 25
/
91-add-worker-08-post.yml
33 lines (29 loc) · 939 Bytes
/
91-add-worker-08-post.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
- hosts: new-worker
gather_facts: false
roles:
- post
- hosts: new-worker
gather_facts: false
tasks:
- block:
- name: Get ClusterIP of kube-dns
shell: "{{ bin_dir }}/kubectl get svc -n kube-system | grep kube-dns | grep -v upstream | awk '{ print $3 }'"
register: kube_dns_clusterip
run_once: true
- name: Modify the kubelet config file
lineinfile:
path: "/var/lib/kubelet/config.yaml"
regexp: '- {{ kube_dns_clusterip.stdout }}'
line: "- {{ pillar_local_dns }}"
- name: Restart kubelet
service:
name: kubelet
state: restarted
when:
- kube_proxy_mode == "ipvs"
- enable_dns_cache == "enable"
- component_created_by == "cluster"
- hosts: kube-master[0]
gather_facts: false
roles:
- { role: plugins/gpu/gpu-operator, when: "container_runtime == 'docker' and enable_gpu == 'enable' and component_created_by == 'cluster'" }