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

Enable specifying machine tags for CAPI-MAAS infrastructure cluster template #88

Open vishvikkrishnan opened 6 months ago

vishvikkrishnan commented 6 months ago

The cluster template for MAAS does not allow specifying machine tags to target a node for the cluster deployment; currently it is only possible to specify the resource pool. However, this feature is already available on the infra provider - ref: https://github.com/spectrocloud/cluster-api-provider-maas/commit/bb8204bf85b45495811bd7dcd9a4ee48f3ce7fd7

The cluster template and .rc files for MAAS need to allow specifying machine tags for the control-plane and worker machines. Example for worker machine tag:

cluster-template-maas.rc:

export WORKER_MACHINE_TAGS="cloud,compute"

cluster-template-maas.yaml:

---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasMachineTemplate
metadata:
  name: microk8s-maas-md-0
  namespace: default
spec:
  template:
    spec:
      image: ubuntu/jammy
      minCPU: 1
      minMemory: 2048
      resourcePool: bare-metal-pool
      tags:
      - cloud
      - compute