canonical / cluster-api-bootstrap-provider-microk8s

This project offers a cluster API bootstrap provider controller that manages the node provision of a MicroK8s cluster.
https://microk8s.io
21 stars 14 forks source link

add new disableDefaultCNI field #109

Closed eaudetcobello closed 1 month ago

eaudetcobello commented 1 month ago

This PR adds a new field to the MicroK8s bootstrap provider called disableDefaultCNI.

When this field is set to true, Calico will be disabled by 1. microk8s kubectl delete -f cni.yaml and 2. renaming the CNI file from cni.yaml to calico.yaml.old

The objective is to disable the default CNI on the control planes so that when workers join the default CNI is not deployed to them. The user is expected to provide a new CNI using postRunCommands.

apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: MicroK8sControlPlane
...
spec:
  controlPlaneConfig:
    initConfiguration:
      joinTokenTTLInSecs: 900000
      IPinIP: true
      addons:
        - dns
        - ingress
      riskLevel: "${SNAP_RISKLEVEL:=}"
      confinement: "${SNAP_CONFINEMENT:=}"
      disableDefaultCNI: true # <-- new field
    clusterConfiguration:
      portCompatibilityRemap: true
  machineTemplate:
...