Skip to content

CLI

Machine Healthcheck

Users can use RCTL to automate the lifecycle of operations associated with Machine Healthcheck


Add Machine Healthcheck

To add a machine healthcheck via rctl, use the below command

./rctl apply -f <configfile.yaml>

The VMware configuration specification provided below incorporates the addition of Machine Health Check parameters (indicated by highlighting)

apiVersion: infra.k8smgmt.io/v3
kind: Cluster
metadata:
  labels:
    rafay.dev/clusterName: tb-vmware-cluster-9
    rafay.dev/clusterType: vmware_vsphere
    rafay.dev/projectID: 7w2lnkp
    rafay.dev/projectName: demo
  name: tb-vmware-cluster-9
  project: demo
spec:
  blueprint:
    name: default
    version: latest
  cloudCredentials: vmware-creds
  config:
    controlPlane:
      diskGiB: 25
      machineCount: 3
      memoryMiB: 8192
      numCPUs: 2
      version: v1.25.2
    controlPlaneEndpointIP: 10.109.10.68
    datacenter: /SDDC-Datacenter
    datastore: /SDDC-Datacenter/datastore/WorkloadDatastore
    machineHealthChecks:
    - name: mhc1
      selector:
        matchExpressions:
        - key: nodepool
          operator: In
          values:
          - default-nodepool
        matchLabels:
          nodepool: default-nodepool
      unhealthyConditions:
      - status: "False"
        timeout: 400s
        type: Ready
      - status: Unknown
        timeout: 400s
        type: Ready
    network:
      cni:
        name: calico
        version: v3.24.5
      devices:
      - networkName: /SDDC-Datacenter/network/sddc-rafay-k8s
      podCidrBlocks:
      - 192.168.0.0/16
    nodePools:
    - diskGiB: 25
      machineCount: 3
      memoryMiB: 8192
      name: default-nodepool
      numCPUs: 2
      os: linux
      version: v1.25.2
      vmTemplate: ubuntu-2004-kube-v1.25.2
    - diskGiB: 25
      machineCount: 3
      memoryMiB: 8192
      name: nodepool-2
      numCPUs: 2
      os: linux
      version: v1.25.2
      vmTemplate: ubuntu-2004-kube-v1.25.2
    resourcePool: /SDDC-Datacenter/host/Cluster-1/Resources/Compute-ResourcePool
    vmTemplate: ubuntu-2004-kube-v1.25.2
  type: Vmware_vsphere