c32bec34bc
The local kube-vip readiness probe used an unquoted jsonpath predicate, which made kubectl treat Ready as an identifier instead of a string. Use a quoted jsonpath via shell so bootstrap can detect the primary kube-vip pod properly before waiting on the API VIP.
30 lines
819 B
YAML
30 lines
819 B
YAML
---
|
|
- name: Render kube-vip control plane manifest
|
|
template:
|
|
src: kube-vip-control-plane.yaml.j2
|
|
dest: /tmp/kube-vip-control-plane.yaml
|
|
mode: "0644"
|
|
|
|
- name: Apply kube-vip control plane manifest
|
|
command: kubectl apply -f /tmp/kube-vip-control-plane.yaml
|
|
changed_when: true
|
|
|
|
- name: Wait for local kube-vip pod to be ready
|
|
shell: >-
|
|
kubectl -n kube-system get pods
|
|
-l app.kubernetes.io/name=kube-vip
|
|
--field-selector spec.nodeName={{ inventory_hostname }}
|
|
-o jsonpath='{.items[0].status.conditions[?(@.type=="Ready")].status}'
|
|
register: kube_vip_pod_ready
|
|
changed_when: false
|
|
until: kube_vip_pod_ready.stdout == "True"
|
|
retries: 18
|
|
delay: 10
|
|
|
|
- name: Wait for API VIP on 6443
|
|
wait_for:
|
|
host: "{{ kube_vip_address }}"
|
|
port: 6443
|
|
state: started
|
|
timeout: 180
|