diff --git a/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/aws-cluster-class.yaml b/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/aws-cluster-class.yaml index 3f90da8cf..ca25ad7bd 100644 --- a/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/aws-cluster-class.yaml +++ b/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/aws-cluster-class.yaml @@ -21,42 +21,42 @@ spec: kind: AWSClusterTemplate name: aws-quick-start patches: - - external: - discoverVariablesExtension: awsclusterconfigvars.cluster-api-runtime-extensions-nutanix - generateExtension: awsclusterconfigpatch.cluster-api-runtime-extensions-nutanix - name: cluster-config - - external: - discoverVariablesExtension: awsworkerconfigvars.cluster-api-runtime-extensions-nutanix - generateExtension: awsworkerconfigpatch.cluster-api-runtime-extensions-nutanix - name: worker-config - - definitions: - - jsonPatches: - - op: add - path: /spec/template/spec/identityRef - value: - kind: AWSClusterControllerIdentity - name: default - selector: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSClusterTemplate - matchResources: - infrastructureCluster: true - description: AWSClusterStaticIdentity identityRef to use when creating the cluster - name: identityRef + - external: + discoverVariablesExtension: awsclusterconfigvars.cluster-api-runtime-extensions-nutanix + generateExtension: awsclusterconfigpatch.cluster-api-runtime-extensions-nutanix + name: cluster-config + - external: + discoverVariablesExtension: awsworkerconfigvars.cluster-api-runtime-extensions-nutanix + generateExtension: awsworkerconfigpatch.cluster-api-runtime-extensions-nutanix + name: worker-config + - definitions: + - jsonPatches: + - op: add + path: /spec/template/spec/identityRef + value: + kind: AWSClusterControllerIdentity + name: default + selector: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 + kind: AWSClusterTemplate + matchResources: + infrastructureCluster: true + description: AWSClusterStaticIdentity identityRef to use when creating the cluster + name: identityRef workers: machineDeployments: - - class: default-worker - template: - bootstrap: - ref: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: aws-quick-start-worker-bootstraptemplate - infrastructure: - ref: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSMachineTemplate - name: aws-quick-start-worker-machinetemplate + - class: default-worker + template: + bootstrap: + ref: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: aws-quick-start-worker-bootstraptemplate + infrastructure: + ref: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 + kind: AWSMachineTemplate + name: aws-quick-start-worker-machinetemplate --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSClusterTemplate diff --git a/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/docker-cluster-class.yaml b/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/docker-cluster-class.yaml index 01caafa05..57ff7ff09 100644 --- a/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/docker-cluster-class.yaml +++ b/charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/docker-cluster-class.yaml @@ -21,28 +21,28 @@ spec: kind: DockerClusterTemplate name: docker-quick-start-cluster patches: - - external: - discoverVariablesExtension: dockerclusterconfigvars.cluster-api-runtime-extensions-nutanix - generateExtension: dockerclusterconfigpatch.cluster-api-runtime-extensions-nutanix - name: cluster-config - - external: - discoverVariablesExtension: dockerworkerconfigvars.cluster-api-runtime-extensions-nutanix - generateExtension: dockerworkerconfigpatch.cluster-api-runtime-extensions-nutanix - name: worker-config + - external: + discoverVariablesExtension: dockerclusterconfigvars.cluster-api-runtime-extensions-nutanix + generateExtension: dockerclusterconfigpatch.cluster-api-runtime-extensions-nutanix + name: cluster-config + - external: + discoverVariablesExtension: dockerworkerconfigvars.cluster-api-runtime-extensions-nutanix + generateExtension: dockerworkerconfigpatch.cluster-api-runtime-extensions-nutanix + name: worker-config workers: machineDeployments: - - class: default-worker - template: - bootstrap: - ref: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: docker-quick-start-default-worker-bootstraptemplate - infrastructure: - ref: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: DockerMachineTemplate - name: docker-quick-start-default-worker-machinetemplate + - class: default-worker + template: + bootstrap: + ref: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: docker-quick-start-default-worker-bootstraptemplate + infrastructure: + ref: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: DockerMachineTemplate + name: docker-quick-start-default-worker-machinetemplate --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerClusterTemplate @@ -67,10 +67,10 @@ spec: clusterConfiguration: apiServer: certSANs: - - localhost - - 127.0.0.1 - - 0.0.0.0 - - host.docker.internal + - localhost + - 127.0.0.1 + - 0.0.0.0 + - host.docker.internal controllerManager: extraArgs: enable-hostpath-provisioner: "true" @@ -89,8 +89,8 @@ spec: template: spec: extraMounts: - - containerPath: /var/run/docker.sock - hostPath: /var/run/docker.sock + - containerPath: /var/run/docker.sock + hostPath: /var/run/docker.sock --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerMachineTemplate @@ -102,8 +102,8 @@ spec: template: spec: extraMounts: - - containerPath: /var/run/docker.sock - hostPath: /var/run/docker.sock + - containerPath: /var/run/docker.sock + hostPath: /var/run/docker.sock --- apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate diff --git a/examples/capi-quick-start/aws-cluster-calico-crs.yaml b/examples/capi-quick-start/aws-cluster-calico-crs.yaml index 12606585a..d0bb44005 100644 --- a/examples/capi-quick-start/aws-cluster-calico-crs.yaml +++ b/examples/capi-quick-start/aws-cluster-calico-crs.yaml @@ -8,53 +8,53 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: aws-quick-start controlPlane: replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: ClusterResourceSet - cni: - provider: Calico - strategy: ClusterResourceSet - cpi: {} - csi: - providers: - - name: aws-ebs - nfd: - strategy: ClusterResourceSet - aws: - region: us-west-2 - controlPlane: - aws: - ami: - lookup: - baseOS: ${AMI_LOOKUP_BASEOS} - format: ${AMI_LOOKUP_FORMAT} - org: "${AMI_LOOKUP_ORG}" - - name: workerConfig - value: + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: ClusterResourceSet + cni: + provider: Calico + strategy: ClusterResourceSet + cpi: {} + csi: + providers: + - name: aws-ebs + nfd: + strategy: ClusterResourceSet + aws: + region: us-west-2 + controlPlane: aws: ami: lookup: baseOS: ${AMI_LOOKUP_BASEOS} format: ${AMI_LOOKUP_FORMAT} org: "${AMI_LOOKUP_ORG}" + - name: workerConfig + value: + aws: + ami: + lookup: + baseOS: ${AMI_LOOKUP_BASEOS} + format: ${AMI_LOOKUP_FORMAT} + org: "${AMI_LOOKUP_ORG}" version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml b/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml index 5638bf9ea..de865c0a2 100644 --- a/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml +++ b/examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml @@ -8,53 +8,53 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: aws-quick-start controlPlane: replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: HelmAddon - cni: - provider: Calico - strategy: HelmAddon - cpi: {} - csi: - providers: - - name: aws-ebs - nfd: - strategy: HelmAddon - aws: - region: us-west-2 - controlPlane: - aws: - ami: - lookup: - baseOS: ${AMI_LOOKUP_BASEOS} - format: ${AMI_LOOKUP_FORMAT} - org: "${AMI_LOOKUP_ORG}" - - name: workerConfig - value: + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: HelmAddon + cni: + provider: Calico + strategy: HelmAddon + cpi: {} + csi: + providers: + - name: aws-ebs + nfd: + strategy: HelmAddon + aws: + region: us-west-2 + controlPlane: aws: ami: lookup: baseOS: ${AMI_LOOKUP_BASEOS} format: ${AMI_LOOKUP_FORMAT} org: "${AMI_LOOKUP_ORG}" + - name: workerConfig + value: + aws: + ami: + lookup: + baseOS: ${AMI_LOOKUP_BASEOS} + format: ${AMI_LOOKUP_FORMAT} + org: "${AMI_LOOKUP_ORG}" version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/examples/capi-quick-start/aws-cluster-cilium-crs.yaml b/examples/capi-quick-start/aws-cluster-cilium-crs.yaml index 33ece0d09..582498ec8 100644 --- a/examples/capi-quick-start/aws-cluster-cilium-crs.yaml +++ b/examples/capi-quick-start/aws-cluster-cilium-crs.yaml @@ -8,53 +8,53 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: aws-quick-start controlPlane: replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: ClusterResourceSet - cni: - provider: Cilium - strategy: ClusterResourceSet - cpi: {} - csi: - providers: - - name: aws-ebs - nfd: - strategy: ClusterResourceSet - aws: - region: us-west-2 - controlPlane: - aws: - ami: - lookup: - baseOS: ${AMI_LOOKUP_BASEOS} - format: ${AMI_LOOKUP_FORMAT} - org: "${AMI_LOOKUP_ORG}" - - name: workerConfig - value: + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: ClusterResourceSet + cni: + provider: Cilium + strategy: ClusterResourceSet + cpi: {} + csi: + providers: + - name: aws-ebs + nfd: + strategy: ClusterResourceSet + aws: + region: us-west-2 + controlPlane: aws: ami: lookup: baseOS: ${AMI_LOOKUP_BASEOS} format: ${AMI_LOOKUP_FORMAT} org: "${AMI_LOOKUP_ORG}" + - name: workerConfig + value: + aws: + ami: + lookup: + baseOS: ${AMI_LOOKUP_BASEOS} + format: ${AMI_LOOKUP_FORMAT} + org: "${AMI_LOOKUP_ORG}" version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml b/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml index 501449a9d..c710fa612 100644 --- a/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml +++ b/examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml @@ -8,53 +8,53 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: aws-quick-start controlPlane: replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: HelmAddon - cni: - provider: Cilium - strategy: HelmAddon - cpi: {} - csi: - providers: - - name: aws-ebs - nfd: - strategy: HelmAddon - aws: - region: us-west-2 - controlPlane: - aws: - ami: - lookup: - baseOS: ${AMI_LOOKUP_BASEOS} - format: ${AMI_LOOKUP_FORMAT} - org: "${AMI_LOOKUP_ORG}" - - name: workerConfig - value: + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: HelmAddon + cni: + provider: Cilium + strategy: HelmAddon + cpi: {} + csi: + providers: + - name: aws-ebs + nfd: + strategy: HelmAddon + aws: + region: us-west-2 + controlPlane: aws: ami: lookup: baseOS: ${AMI_LOOKUP_BASEOS} format: ${AMI_LOOKUP_FORMAT} org: "${AMI_LOOKUP_ORG}" + - name: workerConfig + value: + aws: + ami: + lookup: + baseOS: ${AMI_LOOKUP_BASEOS} + format: ${AMI_LOOKUP_FORMAT} + org: "${AMI_LOOKUP_ORG}" version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/examples/capi-quick-start/docker-cluster-calico-crs.yaml b/examples/capi-quick-start/docker-cluster-calico-crs.yaml index 5f8d736f1..69673293e 100644 --- a/examples/capi-quick-start/docker-cluster-calico-crs.yaml +++ b/examples/capi-quick-start/docker-cluster-calico-crs.yaml @@ -8,34 +8,35 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: docker-quick-start controlPlane: metadata: {} replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: ClusterResourceSet - cni: - provider: Calico - strategy: ClusterResourceSet - nfd: - strategy: ClusterResourceSet - docker: {} + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: ClusterResourceSet + cni: + provider: Calico + strategy: ClusterResourceSet + nfd: + strategy: ClusterResourceSet + - name: workerConfig + value: {} version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml b/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml index dd0bba653..459f248a0 100644 --- a/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml +++ b/examples/capi-quick-start/docker-cluster-calico-helm-addon.yaml @@ -8,34 +8,35 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: docker-quick-start controlPlane: metadata: {} replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: HelmAddon - cni: - provider: Calico - strategy: HelmAddon - nfd: - strategy: HelmAddon - docker: {} + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: HelmAddon + cni: + provider: Calico + strategy: HelmAddon + nfd: + strategy: HelmAddon + - name: workerConfig + value: {} version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/examples/capi-quick-start/docker-cluster-cilium-crs.yaml b/examples/capi-quick-start/docker-cluster-cilium-crs.yaml index 8a26aea15..7409544d2 100644 --- a/examples/capi-quick-start/docker-cluster-cilium-crs.yaml +++ b/examples/capi-quick-start/docker-cluster-cilium-crs.yaml @@ -8,34 +8,35 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: docker-quick-start controlPlane: metadata: {} replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: ClusterResourceSet - cni: - provider: Cilium - strategy: ClusterResourceSet - nfd: - strategy: ClusterResourceSet - docker: {} + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: ClusterResourceSet + cni: + provider: Cilium + strategy: ClusterResourceSet + nfd: + strategy: ClusterResourceSet + - name: workerConfig + value: {} version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml b/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml index beaf75ce9..8c2b7ef5e 100644 --- a/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml +++ b/examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml @@ -8,34 +8,35 @@ spec: clusterNetwork: pods: cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} services: cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} + - ${SERVICE_CIDR:-10.128.0.0/12} topology: class: docker-quick-start controlPlane: metadata: {} replicas: ${CONTROL_PLANE_MACHINE_COUNT} variables: - - name: clusterConfig - value: - addons: - clusterAutoscaler: - strategy: HelmAddon - cni: - provider: Cilium - strategy: HelmAddon - nfd: - strategy: HelmAddon - docker: {} + - name: clusterConfig + value: + addons: + clusterAutoscaler: + strategy: HelmAddon + cni: + provider: Cilium + strategy: HelmAddon + nfd: + strategy: HelmAddon + - name: workerConfig + value: {} version: ${KUBERNETES_VERSION} workers: machineDeployments: - - class: default-worker - metadata: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" - name: md-0 + - class: default-worker + metadata: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" + name: md-0 diff --git a/hack/examples/bases/aws/calico/crs/kustomization.yaml.tmpl b/hack/examples/bases/aws/calico/crs/kustomization.yaml.tmpl deleted file mode 100644 index fdb7ac5e1..000000000 --- a/hack/examples/bases/aws/calico/crs/kustomization.yaml.tmpl +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/${CAPA_VERSION}/cluster-template-simple-clusterclass.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-crs-calico" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Calico - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: ClusterResourceSet - -# Delete all ClusterClass related resources to prevent duplicate resources because we use the same resources definition -# above- we only actually want the Cluster resource to mutate here. -- target: - kind: ClusterClass - patch: | - $$patch: delete - apiVersion: cluster.x-k8s.io/v1beta1 - kind: ClusterClass - metadata: - name: quick-start -- target: - kind: AWSClusterTemplate - patch: | - $$patch: delete - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSClusterTemplate - metadata: - name: quick-start -- target: - kind: KubeadmControlPlaneTemplate - patch: | - $$patch: delete - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlaneTemplate - metadata: - name: quick-start-control-plane -- target: - kind: AWSMachineTemplate - patch: | - $$patch: delete - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSMachineTemplate - metadata: - name: quick-start-control-plane -- target: - kind: KubeadmConfigTemplate - patch: | - $$patch: delete - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - metadata: - name: quick-start-worker-bootstraptemplate -- target: - kind: ConfigMap - patch: | - $$patch: delete - apiVersion: v1 - kind: ConfigMap - metadata: - name: cni-$${CLUSTER_NAME}-crs-0 -- target: - kind: ClusterResourceSet - patch: | - $$patch: delete - apiVersion: addons.cluster.x-k8s.io/v1beta1 - kind: ConfigMap - metadata: - name: $${CLUSTER_NAME}-crs-0 diff --git a/hack/examples/bases/aws/calico/helm-addon/kustomization.yaml.tmpl b/hack/examples/bases/aws/calico/helm-addon/kustomization.yaml.tmpl deleted file mode 100644 index e7c8cabd7..000000000 --- a/hack/examples/bases/aws/calico/helm-addon/kustomization.yaml.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/${CAPA_VERSION}/cluster-template-simple-clusterclass.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-helm-addon-calico" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Calico - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: HelmAddon diff --git a/hack/examples/bases/aws/cilium/crs/kustomization.yaml.tmpl b/hack/examples/bases/aws/cilium/crs/kustomization.yaml.tmpl deleted file mode 100644 index 1bb9e7959..000000000 --- a/hack/examples/bases/aws/cilium/crs/kustomization.yaml.tmpl +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/${CAPA_VERSION}/cluster-template-simple-clusterclass.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-crs-cilium" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Cilium - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: ClusterResourceSet - - -# Delete all ClusterClass related resources to prevent duplicate resources because we use the same resources definition -# above- we only actually want the Cluster resource to mutate here. -- target: - kind: ClusterClass - patch: | - $$patch: delete - apiVersion: cluster.x-k8s.io/v1beta1 - kind: ClusterClass - metadata: - name: quick-start -- target: - kind: AWSClusterTemplate - patch: | - $$patch: delete - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSClusterTemplate - metadata: - name: quick-start -- target: - kind: KubeadmControlPlaneTemplate - patch: | - $$patch: delete - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlaneTemplate - metadata: - name: quick-start-control-plane -- target: - kind: AWSMachineTemplate - patch: | - $$patch: delete - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSMachineTemplate - metadata: - name: quick-start-control-plane -- target: - kind: KubeadmConfigTemplate - patch: | - $$patch: delete - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - metadata: - name: quick-start-worker-bootstraptemplate -- target: - kind: ConfigMap - patch: | - $$patch: delete - apiVersion: v1 - kind: ConfigMap - metadata: - name: cni-$${CLUSTER_NAME}-crs-0 -- target: - kind: ClusterResourceSet - patch: | - $$patch: delete - apiVersion: addons.cluster.x-k8s.io/v1beta1 - kind: ConfigMap - metadata: - name: $${CLUSTER_NAME}-crs-0 diff --git a/hack/examples/bases/aws/cilium/helm-addon/kustomization.yaml.tmpl b/hack/examples/bases/aws/cilium/helm-addon/kustomization.yaml.tmpl deleted file mode 100644 index 4287554e2..000000000 --- a/hack/examples/bases/aws/cilium/helm-addon/kustomization.yaml.tmpl +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/${CAPA_VERSION}/cluster-template-simple-clusterclass.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-helm-addon-cilium" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Cilium - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: HelmAddon - -# Delete all ClusterClass related resources to prevent duplicate resources because we use the same resources definition -# above- we only actually want the Cluster resource to mutate here. -- target: - kind: ClusterClass - patch: | - $$patch: delete - apiVersion: cluster.x-k8s.io/v1beta1 - kind: ClusterClass - metadata: - name: quick-start -- target: - kind: AWSClusterTemplate - patch: | - $$patch: delete - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSClusterTemplate - metadata: - name: quick-start -- target: - kind: KubeadmControlPlaneTemplate - patch: | - $$patch: delete - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlaneTemplate - metadata: - name: quick-start-control-plane -- target: - kind: AWSMachineTemplate - patch: | - $$patch: delete - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: AWSMachineTemplate - metadata: - name: quick-start-control-plane -- target: - kind: KubeadmConfigTemplate - patch: | - $$patch: delete - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - metadata: - name: quick-start-worker-bootstraptemplate -- target: - kind: ConfigMap - patch: | - $$patch: delete - apiVersion: v1 - kind: ConfigMap - metadata: - name: cni-$${CLUSTER_NAME}-crs-0 -- target: - kind: ClusterResourceSet - patch: | - $$patch: delete - apiVersion: addons.cluster.x-k8s.io/v1beta1 - kind: ConfigMap - metadata: - name: $${CLUSTER_NAME}-crs-0 diff --git a/hack/examples/bases/aws/cluster/kustomization.yaml.tmpl b/hack/examples/bases/aws/cluster/kustomization.yaml.tmpl new file mode 100644 index 000000000..10c970d1c --- /dev/null +++ b/hack/examples/bases/aws/cluster/kustomization.yaml.tmpl @@ -0,0 +1,99 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/${CAPA_VERSION}/cluster-template-simple-clusterclass.yaml + +sortOptions: + order: fifo + +labels: +- includeSelectors: false + pairs: + cluster.x-k8s.io/provider: aws + +patches: +- target: + kind: Cluster + patch: |- + - op: "add" + path: "/spec/topology/class" + value: "aws-quick-start" + - op: "remove" + path: "/metadata/labels" +- target: + kind: Cluster + path: ../../../patches/initialize-variables.yaml +- target: + kind: Cluster + path: ../../../patches/cluster-network.yaml +- target: + kind: Cluster + path: ../../../patches/cluster-autoscaler.yaml +- target: + kind: Cluster + path: ../../../patches/cpi.yaml +- target: + kind: Cluster + path: ../../../patches/aws/csi.yaml +- target: + kind: Cluster + path: ../../../patches/aws/ami-lookup.yaml +- target: + kind: Cluster + path: ../../../patches/aws/config-var.yaml + +# Delete the clusterclass-specific resources. +- target: + kind: ClusterClass + patch: | + $$patch: delete + kind: ClusterClass + metadata: + name: unused +- target: + kind: AWSClusterTemplate + patch: | + $$patch: delete + kind: AWSClusterTemplate + metadata: + name: unused +- target: + kind: KubeadmControlPlaneTemplate + patch: | + $$patch: delete + kind: KubeadmControlPlaneTemplate + metadata: + name: unused +- target: + kind: AWSMachineTemplate + patch: | + $$patch: delete + kind: AWSMachineTemplate + metadata: + name: unused +- target: + kind: KubeadmConfigTemplate + patch: | + $$patch: delete + kind: KubeadmConfigTemplate + metadata: + name: unused +# Delete the cluster-specific resources that will be created by CAPI runtime extensions. +- target: + kind: ClusterResourceSet + patch: | + $$patch: delete + kind: ClusterResourceSet + metadata: + name: unused +- target: + kind: ConfigMap + patch: | + $$patch: delete + kind: ConfigMap + metadata: + name: unused diff --git a/hack/examples/bases/aws/clusterclass/kustomization.yaml.tmpl b/hack/examples/bases/aws/clusterclass/kustomization.yaml.tmpl new file mode 100644 index 000000000..71b1c102d --- /dev/null +++ b/hack/examples/bases/aws/clusterclass/kustomization.yaml.tmpl @@ -0,0 +1,77 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/${CAPA_VERSION}/cluster-template-simple-clusterclass.yaml + +configurations: + - kustomizeconfig.yaml + +sortOptions: + order: fifo + +namePrefix: aws- + +labels: +- includeSelectors: false + pairs: + cluster.x-k8s.io/provider: aws + +patches: +# Delete the patch and variable definitions. +- target: + kind: ClusterClass + patch: |- + - op: "remove" + path: "/spec/patches" + - op: "remove" + path: "/spec/variables" + +# Enable external cloud provider. +- target: + kind: KubeadmControlPlaneTemplate + patch: |- + - op: "replace" + path: "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/cloud-provider" + value: "external" + - op: "replace" + path: "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/controllerManager/extraArgs/cloud-provider" + value: "external" + - op: "replace" + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider" + value: "external" + - op: "replace" + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider" + value: "external" +- target: + kind: KubeadmConfigTemplate + patch: |- + - op: "replace" + path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cloud-provider" + value: "external" + +# Delete the cluster-specific resources. +- target: + kind: Cluster + patch: | + $$patch: delete + kind: Cluster + metadata: + name: unused +- target: + kind: ClusterResourceSet + patch: | + $$patch: delete + kind: ClusterResourceSet + metadata: + name: unused +- target: + kind: ConfigMap + patch: | + $$patch: delete + kind: ConfigMap + metadata: + name: unused diff --git a/hack/examples/bases/aws/clusterclass/kustomizeconfig.yaml b/hack/examples/bases/aws/clusterclass/kustomizeconfig.yaml new file mode 100644 index 000000000..0fb7a455a --- /dev/null +++ b/hack/examples/bases/aws/clusterclass/kustomizeconfig.yaml @@ -0,0 +1,22 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +nameReference: + - kind: AWSMachineTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/controlPlane/machineInfrastructure/ref/name + - kind: ClusterClass + path: spec/workers/machineDeployments/template/infrastructure/ref/name + - kind: KubeadmControlPlaneTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/controlPlane/ref/name + - kind: AWSClusterTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/infrastructure/ref/name + - kind: KubeadmConfigTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/workers/machineDeployments/template/bootstrap/ref/name diff --git a/hack/examples/bases/docker/calico/crs/kustomization.yaml.tmpl b/hack/examples/bases/docker/calico/crs/kustomization.yaml.tmpl deleted file mode 100644 index fa8cade1b..000000000 --- a/hack/examples/bases/docker/calico/crs/kustomization.yaml.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/cluster-template-development.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-crs-calico" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Calico - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: ClusterResourceSet diff --git a/hack/examples/bases/docker/calico/helm-addon/kustomization.yaml.tmpl b/hack/examples/bases/docker/calico/helm-addon/kustomization.yaml.tmpl deleted file mode 100644 index d5b24ffb8..000000000 --- a/hack/examples/bases/docker/calico/helm-addon/kustomization.yaml.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/cluster-template-development.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-helm-addon-calico" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Calico - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: HelmAddon diff --git a/hack/examples/bases/docker/cilium/crs/kustomization.yaml.tmpl b/hack/examples/bases/docker/cilium/crs/kustomization.yaml.tmpl deleted file mode 100644 index 3825e8df5..000000000 --- a/hack/examples/bases/docker/cilium/crs/kustomization.yaml.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/cluster-template-development.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-crs-cilium" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Cilium - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: ClusterResourceSet - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: ClusterResourceSet diff --git a/hack/examples/bases/docker/cilium/helm-addon/kustomization.yaml.tmpl b/hack/examples/bases/docker/cilium/helm-addon/kustomization.yaml.tmpl deleted file mode 100644 index 8e64b3363..000000000 --- a/hack/examples/bases/docker/cilium/helm-addon/kustomization.yaml.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2024 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/cluster-template-development.yaml - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/metadata/name" - value: "quick-start-helm-addon-cilium" - - op: "add" - path: "/spec/topology/variables" - value: - - name: "clusterConfig" - value: - addons: - cni: - provider: Cilium - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/nfd" - value: - strategy: HelmAddon - - op: "add" - path: "/spec/topology/variables/0/value/addons/clusterAutoscaler" - value: - strategy: HelmAddon diff --git a/hack/examples/bases/docker/cluster/kustomization.yaml.tmpl b/hack/examples/bases/docker/cluster/kustomization.yaml.tmpl new file mode 100644 index 000000000..34bea6a80 --- /dev/null +++ b/hack/examples/bases/docker/cluster/kustomization.yaml.tmpl @@ -0,0 +1,37 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/cluster-template-development.yaml + +sortOptions: + order: fifo + +labels: +- includeSelectors: false + pairs: + cluster.x-k8s.io/provider: docker + +patches: +- target: + kind: Cluster + patch: |- + - op: "remove" + path: "/metadata/namespace" + - op: "replace" + path: "/spec/topology/class" + value: "docker-quick-start" + - op: "remove" + path: "/spec/topology/workers/machinePools" +- target: + kind: Cluster + path: ../../../patches/initialize-variables.yaml +- target: + kind: Cluster + path: ../../../patches/cluster-network.yaml +- target: + kind: Cluster + path: ../../../patches/cluster-autoscaler.yaml diff --git a/hack/examples/bases/docker/clusterclass/kustomization.yaml.tmpl b/hack/examples/bases/docker/clusterclass/kustomization.yaml.tmpl new file mode 100644 index 000000000..bfbef5ac5 --- /dev/null +++ b/hack/examples/bases/docker/clusterclass/kustomization.yaml.tmpl @@ -0,0 +1,44 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/clusterclass-quick-start.yaml + +configurations: + - kustomizeconfig.yaml + +sortOptions: + order: fifo + +namePrefix: docker- + +labels: +- includeSelectors: false + pairs: + cluster.x-k8s.io/provider: docker + +patches: +# Delete the patch and variable definitions. +- target: + kind: ClusterClass + patch: |- + - op: "remove" + path: "/spec/patches" + - op: "remove" + path: "/spec/variables" +# Delete the machinepool related resources. +- target: + kind: DockerMachinePoolTemplate + patch: |- + $$patch: delete + kind: DockerMachinePoolTemplate + metadata: + name: unused +- target: + kind: ClusterClass + patch: |- + - op: "remove" + path: "/spec/workers/machinePools" diff --git a/hack/examples/bases/docker/clusterclass/kustomizeconfig.yaml b/hack/examples/bases/docker/clusterclass/kustomizeconfig.yaml new file mode 100644 index 000000000..0cd821dbb --- /dev/null +++ b/hack/examples/bases/docker/clusterclass/kustomizeconfig.yaml @@ -0,0 +1,22 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +nameReference: + - kind: DockerMachineTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/controlPlane/machineInfrastructure/ref/name + - kind: ClusterClass + path: spec/workers/machineDeployments/template/infrastructure/ref/name + - kind: KubeadmControlPlaneTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/controlPlane/ref/name + - kind: DockerClusterTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/infrastructure/ref/name + - kind: KubeadmConfigTemplate + fieldSpecs: + - kind: ClusterClass + path: spec/workers/machineDeployments/template/bootstrap/ref/name diff --git a/hack/examples/kustomization.yaml.tmpl b/hack/examples/kustomization.yaml.tmpl deleted file mode 100644 index 218ed63bb..000000000 --- a/hack/examples/kustomization.yaml.tmpl +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2023 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -sortOptions: - order: fifo - -resources: -- ./bases/docker -- ./bases/aws - -patches: -- target: - group: cluster.x-k8s.io - kind: Cluster - patch: |- - - op: "add" - path: "/spec/topology/version" - value: "$${KUBERNETES_VERSION}" - - op: "add" - path: "/spec/clusterNetwork/pods" - value: - cidrBlocks: - - "$${POD_CIDR:-192.168.0.0/16}" - - op: "add" - path: "/spec/clusterNetwork/services" - value: - cidrBlocks: - - "$${SERVICE_CIDR:-10.128.0.0/12}" - - op: "add" - path: "/spec/clusterNetwork/serviceDomain" - value: "cluster.local" - - op: "remove" - path: "/spec/topology/workers/machineDeployments/0/replicas" - - op: "add" - path: "/spec/topology/workers/machineDeployments/0/metadata" - value: - annotations: - cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "$${WORKER_MACHINE_COUNT}" - cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "$${WORKER_MACHINE_COUNT}" diff --git a/hack/examples/overlays/clusterclasses/aws/kustomization.yaml.tmpl b/hack/examples/overlays/clusterclasses/aws/kustomization.yaml.tmpl new file mode 100644 index 000000000..aed3dfcb1 --- /dev/null +++ b/hack/examples/overlays/clusterclasses/aws/kustomization.yaml.tmpl @@ -0,0 +1,61 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../bases/aws/clusterclass + +sortOptions: + order: fifo + +patches: + - target: + kind: ClusterClass + patch: |- + - op: "add" + path: "/spec/patches" + value: + - name: "cluster-config" + external: + generateExtension: "awsclusterconfigpatch.cluster-api-runtime-extensions-nutanix" + discoverVariablesExtension: "awsclusterconfigvars.cluster-api-runtime-extensions-nutanix" + - name: "worker-config" + external: + generateExtension: "awsworkerconfigpatch.cluster-api-runtime-extensions-nutanix" + discoverVariablesExtension: "awsworkerconfigvars.cluster-api-runtime-extensions-nutanix" + - name: identityRef + definitions: + - jsonPatches: + - op: add + path: /spec/template/spec/identityRef + value: + kind: AWSClusterControllerIdentity + name: default + selector: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 + kind: AWSClusterTemplate + matchResources: + infrastructureCluster: true + description: AWSClusterStaticIdentity identityRef to use when creating the cluster + - target: + kind: AWSMachineTemplate + patch: |- + - op: "add" + path: "/spec/template/spec/sshKeyName" + value: "" + - target: + kind: AWSMachineTemplate + name: quick-start-worker-machinetemplate + patch: |- + - op: "add" + path: "/spec/template/spec/instanceType" + value: "m5.2xlarge" + - target: + kind: AWSMachineTemplate + name: quick-start-control-plane + patch: |- + - op: "add" + path: "/spec/template/spec/instanceType" + value: "m5.xlarge" diff --git a/hack/examples/overlays/clusterclasses/docker/kustomization.yaml.tmpl b/hack/examples/overlays/clusterclasses/docker/kustomization.yaml.tmpl new file mode 100644 index 000000000..895670c33 --- /dev/null +++ b/hack/examples/overlays/clusterclasses/docker/kustomization.yaml.tmpl @@ -0,0 +1,27 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../bases/docker/clusterclass + +sortOptions: + order: fifo + +patches: + - target: + kind: ClusterClass + patch: |- + - op: "add" + path: "/spec/patches" + value: + - name: "cluster-config" + external: + generateExtension: "dockerclusterconfigpatch.cluster-api-runtime-extensions-nutanix" + discoverVariablesExtension: "dockerclusterconfigvars.cluster-api-runtime-extensions-nutanix" + - name: "worker-config" + external: + generateExtension: "dockerworkerconfigpatch.cluster-api-runtime-extensions-nutanix" + discoverVariablesExtension: "dockerworkerconfigvars.cluster-api-runtime-extensions-nutanix" diff --git a/hack/examples/overlays/clusters/aws/calico/crs/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/aws/calico/crs/kustomization.yaml.tmpl new file mode 100644 index 000000000..674837ce1 --- /dev/null +++ b/hack/examples/overlays/clusters/aws/calico/crs/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/aws/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/calico.yaml + - target: + kind: Cluster + path: ../../../../../patches/crs-strategy.yaml diff --git a/hack/examples/overlays/clusters/aws/calico/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/aws/calico/helm-addon/kustomization.yaml.tmpl new file mode 100644 index 000000000..39f780f21 --- /dev/null +++ b/hack/examples/overlays/clusters/aws/calico/helm-addon/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/aws/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/calico.yaml + - target: + kind: Cluster + path: ../../../../../patches/helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/aws/cilium/crs/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/aws/cilium/crs/kustomization.yaml.tmpl new file mode 100644 index 000000000..bed8eb1f2 --- /dev/null +++ b/hack/examples/overlays/clusters/aws/cilium/crs/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/aws/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/cilium.yaml + - target: + kind: Cluster + path: ../../../../../patches/crs-strategy.yaml diff --git a/hack/examples/overlays/clusters/aws/cilium/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/aws/cilium/helm-addon/kustomization.yaml.tmpl new file mode 100644 index 000000000..1741c0dd0 --- /dev/null +++ b/hack/examples/overlays/clusters/aws/cilium/helm-addon/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/aws/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/cilium.yaml + - target: + kind: Cluster + path: ../../../../../patches/helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/docker/calico/crs/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/docker/calico/crs/kustomization.yaml.tmpl new file mode 100644 index 000000000..e1567bdae --- /dev/null +++ b/hack/examples/overlays/clusters/docker/calico/crs/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/docker/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/calico.yaml + - target: + kind: Cluster + path: ../../../../../patches/crs-strategy.yaml diff --git a/hack/examples/overlays/clusters/docker/calico/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/docker/calico/helm-addon/kustomization.yaml.tmpl new file mode 100644 index 000000000..3f7017cf5 --- /dev/null +++ b/hack/examples/overlays/clusters/docker/calico/helm-addon/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/docker/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/calico.yaml + - target: + kind: Cluster + path: ../../../../../patches/helm-addon-strategy.yaml diff --git a/hack/examples/overlays/clusters/docker/cilium/crs/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/docker/cilium/crs/kustomization.yaml.tmpl new file mode 100644 index 000000000..0034d478a --- /dev/null +++ b/hack/examples/overlays/clusters/docker/cilium/crs/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/docker/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/cilium.yaml + - target: + kind: Cluster + path: ../../../../../patches/crs-strategy.yaml diff --git a/hack/examples/overlays/clusters/docker/cilium/helm-addon/kustomization.yaml.tmpl b/hack/examples/overlays/clusters/docker/cilium/helm-addon/kustomization.yaml.tmpl new file mode 100644 index 000000000..fb915a52b --- /dev/null +++ b/hack/examples/overlays/clusters/docker/cilium/helm-addon/kustomization.yaml.tmpl @@ -0,0 +1,19 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../../../../bases/docker/cluster + +sortOptions: + order: fifo + +patches: + - target: + kind: Cluster + path: ../../../../../patches/cilium.yaml + - target: + kind: Cluster + path: ../../../../../patches/helm-addon-strategy.yaml diff --git a/hack/examples/patches/aws/ami-lookup.yaml b/hack/examples/patches/aws/ami-lookup.yaml new file mode 100644 index 000000000..8fa602fdf --- /dev/null +++ b/hack/examples/patches/aws/ami-lookup.yaml @@ -0,0 +1,21 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/controlPlane" + value: + aws: + ami: + lookup: + baseOS: "${AMI_LOOKUP_BASEOS}" + format: "${AMI_LOOKUP_FORMAT}" + org: "${AMI_LOOKUP_ORG}" +- op: "add" + path: "/spec/topology/variables/1/value" + value: + aws: + ami: + lookup: + baseOS: "${AMI_LOOKUP_BASEOS}" + format: "${AMI_LOOKUP_FORMAT}" + org: "${AMI_LOOKUP_ORG}" diff --git a/hack/examples/patches/aws/config-var.yaml b/hack/examples/patches/aws/config-var.yaml new file mode 100644 index 000000000..568ca47bf --- /dev/null +++ b/hack/examples/patches/aws/config-var.yaml @@ -0,0 +1,7 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/aws" + value: + region: us-west-2 diff --git a/hack/examples/patches/aws/csi.yaml b/hack/examples/patches/aws/csi.yaml new file mode 100644 index 000000000..1d395d192 --- /dev/null +++ b/hack/examples/patches/aws/csi.yaml @@ -0,0 +1,8 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/addons/csi" + value: + providers: + - name: aws-ebs diff --git a/hack/examples/patches/calico.yaml b/hack/examples/patches/calico.yaml new file mode 100644 index 000000000..402508283 --- /dev/null +++ b/hack/examples/patches/calico.yaml @@ -0,0 +1,7 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/addons/cni" + value: + provider: Calico diff --git a/hack/examples/patches/cilium.yaml b/hack/examples/patches/cilium.yaml new file mode 100644 index 000000000..653d3ad7e --- /dev/null +++ b/hack/examples/patches/cilium.yaml @@ -0,0 +1,7 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/addons/cni" + value: + provider: Cilium diff --git a/hack/examples/patches/cluster-autoscaler.yaml b/hack/examples/patches/cluster-autoscaler.yaml new file mode 100644 index 000000000..2a3e5938a --- /dev/null +++ b/hack/examples/patches/cluster-autoscaler.yaml @@ -0,0 +1,11 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "remove" + path: "/spec/topology/workers/machineDeployments/0/replicas" +- op: "add" + path: "/spec/topology/workers/machineDeployments/0/metadata" + value: + annotations: + cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}" + cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}" diff --git a/hack/examples/patches/cluster-network.yaml b/hack/examples/patches/cluster-network.yaml new file mode 100644 index 000000000..919c8e3a3 --- /dev/null +++ b/hack/examples/patches/cluster-network.yaml @@ -0,0 +1,13 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/clusterNetwork" + value: + pods: + cidrBlocks: + - "${POD_CIDR:-192.168.0.0/16}" + services: + cidrBlocks: + - "${SERVICE_CIDR:-10.128.0.0/12}" + serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} diff --git a/hack/examples/patches/cpi.yaml b/hack/examples/patches/cpi.yaml new file mode 100644 index 000000000..dff7b8841 --- /dev/null +++ b/hack/examples/patches/cpi.yaml @@ -0,0 +1,6 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/addons/cpi" + value: {} diff --git a/hack/examples/patches/crs-strategy.yaml b/hack/examples/patches/crs-strategy.yaml new file mode 100644 index 000000000..2a8af996b --- /dev/null +++ b/hack/examples/patches/crs-strategy.yaml @@ -0,0 +1,12 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/addons/clusterAutoscaler/strategy" + value: ClusterResourceSet +- op: "add" + path: "/spec/topology/variables/0/value/addons/cni/strategy" + value: ClusterResourceSet +- op: "add" + path: "/spec/topology/variables/0/value/addons/nfd/strategy" + value: ClusterResourceSet diff --git a/hack/examples/patches/helm-addon-strategy.yaml b/hack/examples/patches/helm-addon-strategy.yaml new file mode 100644 index 000000000..a2d57e038 --- /dev/null +++ b/hack/examples/patches/helm-addon-strategy.yaml @@ -0,0 +1,12 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables/0/value/addons/clusterAutoscaler/strategy" + value: HelmAddon +- op: "add" + path: "/spec/topology/variables/0/value/addons/cni/strategy" + value: HelmAddon +- op: "add" + path: "/spec/topology/variables/0/value/addons/nfd/strategy" + value: HelmAddon diff --git a/hack/examples/patches/initialize-variables.yaml b/hack/examples/patches/initialize-variables.yaml new file mode 100644 index 000000000..0d3f53156 --- /dev/null +++ b/hack/examples/patches/initialize-variables.yaml @@ -0,0 +1,13 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +- op: "add" + path: "/spec/topology/variables" + value: + - name: "clusterConfig" + value: + addons: + clusterAutoscaler: {} + nfd: {} + - name: "workerConfig" + value: {} diff --git a/hack/examples/sync.sh b/hack/examples/sync.sh index bdea964b8..1fffc9ee8 100755 --- a/hack/examples/sync.sh +++ b/hack/examples/sync.sh @@ -19,93 +19,26 @@ mkdir -p "${EXAMPLE_CLUSTERCLASSES_DIR}" readonly EXAMPLE_CLUSTERS_DIR=examples/capi-quick-start mkdir -p "${EXAMPLE_CLUSTERS_DIR}" -# Sync ClusterClasses (including Templates) and Clusters to separate files. -kustomize build ./hack/examples | - tee \ - >( - gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "docker" - and .kind != "Cluster" - and .kind != "DockerMachinePoolTemplate" - )' >"${EXAMPLE_CLUSTERCLASSES_DIR}/docker-cluster-class.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select( - .metadata.labels["cluster.x-k8s.io/provider"] == "docker" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Cilium" - and .spec.topology.variables[0].value.addons.cni.strategy == "ClusterResourceSet" - )' >"${EXAMPLE_CLUSTERS_DIR}/docker-cluster-cilium-crs.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select( - .metadata.labels["cluster.x-k8s.io/provider"] == "docker" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Cilium" - and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" - )' >"${EXAMPLE_CLUSTERS_DIR}/docker-cluster-cilium-helm-addon.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select( - .metadata.labels["cluster.x-k8s.io/provider"] == "docker" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Calico" - and .spec.topology.variables[0].value.addons.cni.strategy == "ClusterResourceSet" - )' >"${EXAMPLE_CLUSTERS_DIR}/docker-cluster-calico-crs.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select( - .metadata.labels["cluster.x-k8s.io/provider"] == "docker" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Calico" - and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" - )' >"${EXAMPLE_CLUSTERS_DIR}/docker-cluster-calico-helm-addon.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "aws" - and .kind != "Cluster" - and .kind != "AWSClusterStaticIdentity" - )' >"${EXAMPLE_CLUSTERCLASSES_DIR}/aws-cluster-class.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "aws" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Calico" - and .spec.topology.variables[0].value.addons.cni.strategy == "ClusterResourceSet" - )' >"${EXAMPLE_CLUSTERS_DIR}/aws-cluster-calico-crs.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "aws" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Calico" - and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" - )' >"${EXAMPLE_CLUSTERS_DIR}/aws-cluster-calico-helm-addon.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "aws" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Cilium" - and .spec.topology.variables[0].value.addons.cni.strategy == "ClusterResourceSet" - )' >"${EXAMPLE_CLUSTERS_DIR}/aws-cluster-cilium-crs.yaml" - ) \ - >( - gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "aws" - and .kind == "Cluster" - and .spec.topology.variables[0].value.addons.cni.provider == "Cilium" - and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" - )' >"${EXAMPLE_CLUSTERS_DIR}/aws-cluster-cilium-helm-addon.yaml" - ) \ - >/dev/null - -#shellcheck disable=SC2016 -sed -i'' 's/^ name: .\+$/ name: ${CLUSTER_NAME}/' "${EXAMPLE_CLUSTERS_DIR}"/*.yaml +kustomize build ./hack/examples/overlays/clusterclasses/aws >"${EXAMPLE_CLUSTERCLASSES_DIR}/aws-cluster-class.yaml" +kustomize build ./hack/examples/overlays/clusterclasses/docker >"${EXAMPLE_CLUSTERCLASSES_DIR}/docker-cluster-class.yaml" + +for provider in "aws" "docker"; do + kustomize build --load-restrictor LoadRestrictionsNone \ + ./hack/examples/overlays/clusterclasses/"${provider}" >"${EXAMPLE_CLUSTERCLASSES_DIR}"/"${provider}"-cluster-class.yaml + + for cni in "calico" "cilium"; do + for strategy in "helm-addon" "crs"; do + kustomize build --load-restrictor LoadRestrictionsNone \ + ./hack/examples/overlays/clusters/"${provider}"/"${cni}"/"${strategy}" \ + >"${EXAMPLE_CLUSTERS_DIR}/${provider}-cluster-${cni}-${strategy}.yaml" + done + done +done # TODO Remove once kustomize supports retaining quotes in what will be numeric values. #shellcheck disable=SC2016 sed -i'' 's/${AMI_LOOKUP_ORG}/"${AMI_LOOKUP_ORG}"/' "${EXAMPLE_CLUSTERS_DIR}"/*.yaml -# TODO Remove once CAPA templates default to using external cloud provider. -sed -i'' 's/cloud-provider:\ aws/cloud-provider:\ external/g' "${EXAMPLE_CLUSTERCLASSES_DIR}/aws-cluster-class.yaml" - # TODO Remove once kustomize supports retaining quotes in what will be numeric values. #shellcheck disable=SC2016 sed -i'' 's/\( cluster.x-k8s.io\/cluster-api-autoscaler-node-group-\(min\|max\)-size\): \(${WORKER_MACHINE_COUNT}\)/\1: "\3"/' "${EXAMPLE_CLUSTERS_DIR}"/*.yaml