kubernetes-sigs / cluster-api-provider-aws

Kubernetes Cluster API Provider AWS provides consistent deployment and day 2 operations of "self-managed" and EKS Kubernetes clusters on AWS.
http://cluster-api-aws.sigs.k8s.io/
Apache License 2.0
637 stars 561 forks source link

Template examples for MachineHealthCheck missing #3814

Closed cablunar closed 1 year ago

cablunar commented 1 year ago

/kind feature

The cluster-api-provider-aws should accomodate self healing kubeadmcontrolplane template examples, in the tempaltes folder.

Proposing to add the following code to cluster-template-machinepool.yaml, this enables kubeadmcontrolplanes to heal itself if an instance is taken down or otherwise unhealthy. This is crutual information for at least production scenarios, where a clusters controlplane could be destroyed thought the aws console.

apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineHealthCheck
metadata:
  name: "${CLUSTER_NAME}-kcp-unhealthy-5m"
spec:
  clusterName: "${CLUSTER_NAME}"
  maxUnhealthy: 100%
  selector:
    matchLabels:
      cluster.x-k8s.io/control-plane: ""
  unhealthyConditions:
    - type: Ready
      status: Unknown
      timeout: 300s
    - type: Ready
      status: "False"
      timeout: 300s
Skarlso commented 1 year ago

/triage accepted