kubernetes-sigs / cluster-api-provider-kubevirt

Cluster API Provider for KubeVirt
Apache License 2.0
108 stars 61 forks source link

Add support of CAPI ClusterClass feature #250

Closed aamoyel closed 10 months ago

aamoyel commented 11 months ago

What steps did you take and what happened: When using the ClusterClass feature with Cluster API, the capi-controller-manager want an InfraClusterTemplate resource in order to use variables in the "Cluster" resource and render the KubevirtCluster manifest (in our case). Here you can find the spec : https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api/cluster.x-k8s.io/ClusterClass/v1beta1@v1.4.4#spec-infrastructure

I could see that there was no KubevirtClusterTemplate resource in CAPK, so the ClusterClass feature cannot be used at the moment.

Here you can find a valid example of a ClusterClass manifest (with CAPK) :

apiVersion: cluster.x-k8s.io/v1beta1
kind: ClusterClass
metadata:
  name: my-class
  namespace: xxx
spec:
  infrastructure:
    ref:
      apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
      kind: KubevirtClusterTemplate
      name: template
      namespace: xxx
  controlPlane:
    ref:
      apiVersion: controlplane.cluster.x-k8s.io/v1beta1
      kind: KubeadmControlPlaneTemplate
...

Environment:

/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/labels?q=area for the list of labels]

agradouski commented 11 months ago

@davidvossel note, this is an alpha feature of CAPI, any objections to support it in CAPK at this time?