add support for workload-cluster with multiple providers

Starting from the article One cluster - multiple providers from metal3 blo, I have made a test to deploy an hybrid kubeadm workload-cluster with control plane deployed on openstack using openstack provider and workers on baremetal using metal3

this test made it possible to deploy functional hybrid workloadcluster.

We should add capability to sylva-capi-cluster charts to support multiple providers

what have been done:

  • First i have create the cluster definition with OpenstackCluster as infra provider
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: ${CLUSTER_NAME}
  namespace: default
spec:
  clusterNetwork:
    services:
      cidrBlocks: ["10.43.0.0/16"]
    pods:
      cidrBlocks: ["10.42.0.0/16"]
    serviceDomain: cluster.local
  controlPlaneRef:
    apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    kind: KubeadmControlPlane
    name: ${CLUSTER_NAME}-control-plane
  infrastructureRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
    kind: OpenStackCluster
    name: ${CLUSTER_NAME}

then the OpenStackCluster:

apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
kind: OpenStackCluster
metadata:
  name: ${CLUSTER_NAME}
  namespace: default
spec:
  cloudName: capo_cloud
  externalNetworkId: ${CAPO_NETWORK_ID}
  network:
    id: ${CAPO_NETWORK_ID}
  apiServerFixedIP: ${CLUSTER_EXTERNAL_IP}
  identityRef:
    kind: Secret
    name: management-cluster-cloud-config
  managedSecurityGroups: true
  disableAPIServerFloatingIP: true
  allowAllInClusterTraffic: true
  tags:
  - ${CAPO_TAG}

and the needed elements to define the control plane: KubeadmControlPlane, OpenStackMachineTemplate,

then the metal3Cluster with controlPlaneEndpoint host pointing at the CLUSTER_EXTERNAL_IP defined for the OpenstackCluster by the workload-capo-cluster-resources

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: Metal3Cluster
metadata:
  name: ${CLUSTER_NAME}
  namespace: default
spec:
  controlPlaneEndpoint:
    host: ${CLUSTER_EXTERNAL_IP}
    port: 6443
  noCloudProvider: true

and finally the needed elements to define the metal3 worker: Metal3MachineTemplate, Metal3DataTemplate, IPPool, KubeadmConfigTemplate and MachineDeployment

Edited by Thomas Morin