Skip to content

Support for ClusterClasses, TalosControlPlaneTemplates #210

@bdrich

Description

@bdrich

Problem

Talos CAPI ControlPlane provider does not currently support a ControlPlaneTemplate type, which can be referenced by a ClusterClass object.

Example 1

apiVersion: cluster.x-k8s.io/v1beta1
kind: ClusterClass
metadata:
  name: talos-gcp-v0.1.0
spec:
  controlPlane:
    ref:
      apiVersion: controlplane.cluster.x-k8s.io/v1beta1
      kind: TalosControlPlaneTemplate
      name: talos-v0.1.0
      namespace: default
    machineInfrastructure:
      ref:
        kind: GCPMachineTemplate
        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
        name: gcp-controlplane-v0.1.0
        namespace: default
  infrastructure:
    ref:
      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
      kind: GCPClusterTemplate
      name: gcp-v0.1.0
      namespace: default
  workers:
    machineDeployments:
    - class: default-worker
      template:
        bootstrap:
          ref:
            apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
            kind: TalosConfigTemplate
            name: talos-worker-v0.1.0
            namespace: default
        infrastructure:
          ref:
            apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
            kind: GCPMachineTemplate
            name: gcp-worker-v0.1.0
            namespace: default

ClusterClasses help define multiple clusters of similar structure, leveraging variables for customization.

Example 2

apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: my-talos-gcp-cluster
spec:
  topology:
    class: talos-gcp-v0.1.0
    version: v1.31.4
    controlPlane:
      replicas: 3
      metadata:
        labels:
          cpLabel: cpLabelValue 
        annotations:
          cpAnnotation: cpAnnotationValue
    workers:
      machineDeployments:
      - class: default-worker
        name: md-0
        replicas: 4
        metadata:
          labels:
            mdLabel: mdLabelValue
          annotations:
            mdAnnotation: mdAnnotationValue
        failureDomain: region
  variables:
  - name: imageRepository
    required: true
    schema:
      openAPIV3Schema:
        type: string
        description: ImageRepository is the container registry to pull images from.
        default: registry.k8s.io
        example: registry.k8s.io

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions