Skip to content

chore: run addon enabling script on joining control plane nodes - #123

Merged
rapour merged 1 commit into
mainfrom
KU-3797/enable-addons-on-joining-control-planes
Jul 31, 2025
Merged

chore: run addon enabling script on joining control plane nodes#123
rapour merged 1 commit into
mainfrom
KU-3797/enable-addons-on-joining-control-planes

Conversation

@rapour

@rapour rapour commented Jul 16, 2025

Copy link
Copy Markdown

Addresses #122

This PR suggests running microk8s enable <addons> on control plane nodes that are joining the cluster. A few considerations:

  • Microk8s itself is assumed to safeguard against duplicate execution of addons with lock files.
  • This change allows node specific addons like cis-hardening to be run on each control plane node joining the cluster
  • It doesn't add default addons to the list as apposed to the first node initializing the cluster, which adds dns as a default addon.

Signed-off-by: rapour <reza.abbasalipour@canonical.com>

@berkayoz berkayoz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The changes LGTM, one question related to the design/use-case.

// IPinIP defines whether Calico will use IPinIP mode for cluster networking.
IPinIP bool
// Addons is the list of addons to enable.
Addons []string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How does this handle the addon parameters? What's our strategy for that use-case?

@rapour rapour Jul 21, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Let's assume the user lists the addons they want to enable as part of their manifests:

...
  controlPlaneConfig:
    initConfiguration:
      joinTokenTTLInSecs: 9000
      addons:
      - dns
      - ingress
...

The provider used to run microk8s enable dns ingress on the first CP node of the cluster (as part of the cloud-init scripts). This change make it so it runs microk8s enable dns ingress on all the subsequent joining CP nodes. This is particularly useful for addons like cis-hardening that needs to be run on each node individually.

@rapour
rapour requested a review from berkayoz July 21, 2025 12:07

@berkayoz berkayoz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, we can leave addon parameters out of scope for this one.

@rapour
rapour merged commit 71682d3 into main Jul 31, 2025
5 checks passed
@rapour
rapour deleted the KU-3797/enable-addons-on-joining-control-planes branch July 31, 2025 13:41
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