2022-04-08 01:37:57 +08:00
|
|
|
---
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Kube-vip | Check cluster settings for kube-vip
|
2022-08-30 15:21:02 +08:00
|
|
|
fail:
|
|
|
|
msg: "kube-vip require kube_proxy_strict_arp = true, see https://github.com/kube-vip/kube-vip/blob/main/docs/kubernetes/arp/index.md"
|
|
|
|
when:
|
|
|
|
- kube_proxy_mode == 'ipvs' and not kube_proxy_strict_arp
|
|
|
|
- kube_vip_arp_enabled
|
|
|
|
|
2024-08-11 12:35:58 +08:00
|
|
|
- name: Kube-vip | Check if super-admin.conf exists
|
|
|
|
stat:
|
|
|
|
path: "{{ kube_config_dir }}/super-admin.conf"
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
register: stat_kube_vip_super_admin
|
|
|
|
|
|
|
|
- name: Kube-vip | Check if kubeadm has already run
|
|
|
|
stat:
|
|
|
|
path: "/var/lib/kubelet/config.yaml"
|
|
|
|
get_attributes: no
|
|
|
|
get_checksum: no
|
|
|
|
get_mime: no
|
|
|
|
register: kubeadm_already_run
|
|
|
|
|
|
|
|
- name: Kube-vip | Set admin.conf
|
|
|
|
set_fact:
|
|
|
|
kube_vip_admin_conf: admin.conf
|
|
|
|
|
|
|
|
- name: Kube-vip | Set admin.conf for first Control Plane
|
|
|
|
set_fact:
|
|
|
|
kube_vip_admin_conf: super-admin.conf
|
|
|
|
when:
|
|
|
|
- inventory_hostname == groups['kube_control_plane'] | first
|
|
|
|
- (stat_kube_vip_super_admin.stat.exists and stat_kube_vip_super_admin.stat.isreg) or (not kubeadm_already_run.stat.exists )
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Kube-vip | Write static pod
|
2022-04-08 01:37:57 +08:00
|
|
|
template:
|
|
|
|
src: manifests/kube-vip.manifest.j2
|
|
|
|
dest: "{{ kube_manifest_dir }}/kube-vip.yml"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0640"
|