Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new disableDefaultCNI field #109

Merged
merged 8 commits into from
Jul 30, 2024
Merged

add new disableDefaultCNI field #109

merged 8 commits into from
Jul 30, 2024

Conversation

eaudetcobello
Copy link

@eaudetcobello eaudetcobello commented Jul 26, 2024

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:
...

Copy link

@addyess addyess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits... LGTM though

controllers/cloudinit/scripts/00-disable-default-cni.sh Outdated Show resolved Hide resolved
controllers/cloudinit/controlplane_join.go Outdated Show resolved Hide resolved
controllers/cloudinit/controlplane_init.go Outdated Show resolved Hide resolved
@eaudetcobello eaudetcobello force-pushed the eaudetcobello/KU-1189 branch from d9278ba to 30ba873 Compare July 26, 2024 18:17
@eaudetcobello eaudetcobello force-pushed the eaudetcobello/KU-1189 branch from 1006bf7 to a6aaa02 Compare July 26, 2024 19:07
@eaudetcobello eaudetcobello force-pushed the eaudetcobello/KU-1189 branch from 836b9db to 21373e2 Compare July 29, 2024 18:55
@eaudetcobello eaudetcobello merged commit b2ccc8e into main Jul 30, 2024
4 checks passed
@eaudetcobello eaudetcobello deleted the eaudetcobello/KU-1189 branch July 30, 2024 00:24
eaudetcobello added a commit to canonical/cluster-api-control-plane-provider-microk8s that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants