Skip to content

Commit

Permalink
Set machine healthcheck per machine set (#261)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Stejskal <[email protected]>
  • Loading branch information
Frawless authored Oct 30, 2023
1 parent 2fa129b commit e281a00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@
kubeconfig: "{{ kubeconfig_path }}/{{ worker.name }}"
state: present
verify_ssl: no
template: "templates/worker-nodes-health-check.yaml"
template: "templates/worker-nodes-health-check.yaml.j2"
loop: "{{ worker.machine_pools }}"
loop_control:
loop_var: machine_pool
vars:
node_type: "{{ machine_pool.node_type }}"
max_unhealthy: "{{ machine_pool.max_unhealthy }}"
clusterName: "{{ worker.name }}"
clusterId: "{{ get_cluster_id_out.stdout }}"

- name: "Set anonymous pull rights on {{ worker.name }}"
shell: "oc patch --type=merge --patch='{ \"spec\": { \"registrySources\": { \"insecureRegistries\": [ \"default-route-openshift-image-registry.apps.{{ worker.name }}.{{ cluster_domain }}\" ] } } }' image.config.openshift.io/cluster"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
apiVersion: machine.openshift.io/v1beta1
kind: MachineHealthCheck
metadata:
name: worker-machines-health-check
name: worker-{{ node_type }}-machines-health-check
namespace: openshift-machine-api
spec:
selector:
matchLabels:
machine.openshift.io/cluster-api-machine-role: worker
machine.openshift.io/cluster-api-machine-type: worker
machine.openshift.io/cluster-api-machineset: {{ clusterId }}-{{ node_type }}-worker-0
unhealthyConditions:
- type: Ready
status: Unknown
timeout: 600s
- type: Ready
status: 'False'
timeout: 600s
maxUnhealthy: 80%
nodeStartupTimeout: 20m
maxUnhealthy: {{ max_unhealthy }}
Binary file modified install/secrets/clusters.yaml
Binary file not shown.

0 comments on commit e281a00

Please sign in to comment.