Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions roles/calico_master/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
node_version: "{{ calico_node_image | regex_replace('^.*node:v?(.*)$', '\\1') }}"
cnx: "{{ calico_node_image | regex_replace('^.*/(.*)-node:.*$', '\\1') }}"

- name: Calico Master | Set the correct liveness and readiness checks
set_fact:
calico_binary_checks: "{{ (node_version > '3.2.0' and cnx != 'cnx') or (node_version > '2.2.0' and cnx == 'cnx') | bool }}"

- name: Calico Master | Write Calico v2
template:
dest: "{{ mktemp.stdout }}/calico.yml"
Expand Down
11 changes: 11 additions & 0 deletions roles/calico_master/templates/calicov3.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,24 @@ spec:
httpGet:
path: /liveness
port: 9099
{% if calico_binary_checks %}
host: localhost
{% endif %}
periodSeconds: 10
initialDelaySeconds: 10
failureThreshold: 6
readinessProbe:
{% if calico_binary_checks %}
exec:
command:
- /bin/calico-node
- -bird-ready
- -felix-ready
{% else %}
httpGet:
path: /readiness
port: 9099
{% endif %}
periodSeconds: 10
volumeMounts:
- mountPath: /lib/modules
Expand Down