From 69e75fa7e7e7bcfaeae594d138ed47cade153907 Mon Sep 17 00:00:00 2001 From: deepakm-ntnx Date: Tue, 27 Feb 2024 10:37:32 -0800 Subject: [PATCH] patches --- .../nutanix-cluster-calico-helm-addon.yaml | 114 ---------------- .../nutanix-cluster-cilium-helm-addon.yaml | 114 ---------------- .../nutanix-final-example.yaml | 124 ++++++++++++++++++ hack/examples/sync.sh | 8 +- make/clusterctl.mk | 2 +- 5 files changed, 129 insertions(+), 233 deletions(-) create mode 100644 examples/capi-quick-start/nutanix-final-example.yaml diff --git a/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml b/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml index 6b0fdb89f..b955797bd 100644 --- a/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml +++ b/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml @@ -1,119 +1,5 @@ apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster -metadata: - labels: - ccm: nutanix - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - cluster.x-k8s.io/provider: infrastructure-nutanix - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local - services: - cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} - topology: - class: test-cre - controlPlane: - metadata: {} - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - variables: - - name: clusterConfig - value: - addons: - cni: - provider: Cilium - strategy: ClusterResourceSet - nutanix: {} - version: ${KUBERNETES_VERSION} - workers: - machineDeployments: - - class: ${CLUSTER_CLASS_NAME}-worker - metadata: {} - name: md-0 - replicas: ${WORKER_MACHINE_COUNT} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - labels: - ccm: nutanix - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - cluster.x-k8s.io/provider: infrastructure-nutanix - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local - services: - cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} - topology: - class: test-cre - controlPlane: - metadata: {} - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - variables: - - name: clusterConfig - value: - addons: - cni: - provider: Cilium - strategy: HelmAddon - nutanix: {} - version: ${KUBERNETES_VERSION} - workers: - machineDeployments: - - class: ${CLUSTER_CLASS_NAME}-worker - metadata: {} - name: md-0 - replicas: ${WORKER_MACHINE_COUNT} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - labels: - ccm: nutanix - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - cluster.x-k8s.io/provider: infrastructure-nutanix - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local - services: - cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} - topology: - class: test-cre - controlPlane: - metadata: {} - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - variables: - - name: clusterConfig - value: - addons: - cni: - provider: Calico - strategy: ClusterResourceSet - nutanix: {} - version: ${KUBERNETES_VERSION} - workers: - machineDeployments: - - class: ${CLUSTER_CLASS_NAME}-worker - metadata: {} - name: md-0 - replicas: ${WORKER_MACHINE_COUNT} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster metadata: labels: ccm: nutanix diff --git a/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml b/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml index 6b0fdb89f..8bc89c57d 100644 --- a/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml +++ b/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml @@ -26,120 +26,6 @@ spec: addons: cni: provider: Cilium - strategy: ClusterResourceSet - nutanix: {} - version: ${KUBERNETES_VERSION} - workers: - machineDeployments: - - class: ${CLUSTER_CLASS_NAME}-worker - metadata: {} - name: md-0 - replicas: ${WORKER_MACHINE_COUNT} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - labels: - ccm: nutanix - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - cluster.x-k8s.io/provider: infrastructure-nutanix - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local - services: - cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} - topology: - class: test-cre - controlPlane: - metadata: {} - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - variables: - - name: clusterConfig - value: - addons: - cni: - provider: Cilium - strategy: HelmAddon - nutanix: {} - version: ${KUBERNETES_VERSION} - workers: - machineDeployments: - - class: ${CLUSTER_CLASS_NAME}-worker - metadata: {} - name: md-0 - replicas: ${WORKER_MACHINE_COUNT} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - labels: - ccm: nutanix - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - cluster.x-k8s.io/provider: infrastructure-nutanix - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local - services: - cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} - topology: - class: test-cre - controlPlane: - metadata: {} - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - variables: - - name: clusterConfig - value: - addons: - cni: - provider: Calico - strategy: ClusterResourceSet - nutanix: {} - version: ${KUBERNETES_VERSION} - workers: - machineDeployments: - - class: ${CLUSTER_CLASS_NAME}-worker - metadata: {} - name: md-0 - replicas: ${WORKER_MACHINE_COUNT} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - labels: - ccm: nutanix - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - cluster.x-k8s.io/provider: infrastructure-nutanix - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - ${POD_CIDR:-192.168.0.0/16} - serviceDomain: cluster.local - services: - cidrBlocks: - - ${SERVICE_CIDR:-10.128.0.0/12} - topology: - class: test-cre - controlPlane: - metadata: {} - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - variables: - - name: clusterConfig - value: - addons: - cni: - provider: Calico strategy: HelmAddon nutanix: {} version: ${KUBERNETES_VERSION} diff --git a/examples/capi-quick-start/nutanix-final-example.yaml b/examples/capi-quick-start/nutanix-final-example.yaml new file mode 100644 index 000000000..4d4e908ff --- /dev/null +++ b/examples/capi-quick-start/nutanix-final-example.yaml @@ -0,0 +1,124 @@ +apiVersion: cluster.x-k8s.io/v1beta1 +kind: Cluster +metadata: + labels: + ccm: nutanix + cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} + cluster.x-k8s.io/provider: infrastructure-nutanix + name: ${CLUSTER_NAME} +spec: + clusterNetwork: + pods: + cidrBlocks: + - ${POD_CIDR:-192.168.0.0/16} + serviceDomain: cluster.local + services: + cidrBlocks: + - ${SERVICE_CIDR:-10.128.0.0/12} + topology: + class: test-cre + controlPlane: + metadata: {} + replicas: ${CONTROL_PLANE_MACHINE_COUNT} + variables: + - name: clusterConfig + value: + etcd: + image: + repository: my-registry.io/my-org/my-repo + tag: "v3.5.99_custom.0" + extraAPIServerCertSANs: + - a.b.c.example.com + - d.e.f.example.com + globalImageRegistryMirror: + url: https://example.com + credentials: + secretRef: + name: my-mirror-ca-cert + proxy: + http: http://example.com + https: http://example.com + additionalNo: + - no-proxy-1.example.com + - no-proxy-2.example.com + imageRegistries: + - url: https://my-registry.io + credentials: + secretRef: + name: my-registry-credentials + kubernetesImageRepository: "my-registry.io/my-org/my-repo" + prismCentralEndpoint: + address: "PC-ip-fqdn" + port: 9440 + insecure: false + additionalTrustBundle: "trust-bundle-root-ca" + controlPlane: + nutanix: + endpoint: + host: "api-server-ip-fqdn" + port: 6443 + users: + - name: capxuser + sshKey: ssh-key-expample-1 + bootType: legacy + cluster: + name: PE1 + type: name + image: + name: image1 + type: name + memorySize: 4Gi + systemDiskSize: 40Gi + vcpuSockets: 2 + vcpusPerSocket: 1 + subnet: + name: subnet1 + type: name + project: prj1 + additionalCategories: + - key1: value1 + - key2: value2 + gpus: + - type: name + name: gpu1 + - type: name + name: gpu2 + addons: + cni: + provider: Cilium + strategy: HelmAddon + csi: {} + nfd: {} + - name: workerConfig + value: + nutanix: + bootType: legacy + cluster: + name: PE1 + type: name + image: + name: image1 + type: name + memorySize: 4Gi + systemDiskSize: 40Gi + vcpuSockets: 2 + vcpusPerSocket: 1 + subnet: + name: subnet1 + type: name + project: prj1 + additionalCategories: + - key1: value1 + - key2: value2 + gpus: + - type: name + name: gpu1 + - type: name + name: gpu2 + version: ${KUBERNETES_VERSION} + workers: + machineDeployments: + - class: ${CLUSTER_CLASS_NAME}-worker + metadata: {} + name: md-0 + replicas: ${WORKER_MACHINE_COUNT} diff --git a/hack/examples/sync.sh b/hack/examples/sync.sh index 3d53cc2b4..004b0fb13 100755 --- a/hack/examples/sync.sh +++ b/hack/examples/sync.sh @@ -111,8 +111,8 @@ kustomize build ./hack/examples | >( gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "infrastructure-nutanix" and .kind == "Cluster" - # and .spec.topology.variables[0].value.addons.cni.provider == "Calico" - # and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" + and .spec.topology.variables[0].value.addons.cni.provider == "Calico" + and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" )' >"${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-calico-helm-addon.yaml" ) \ >( @@ -126,8 +126,8 @@ kustomize build ./hack/examples | >( gojq --yaml-input --yaml-output 'select(.metadata.labels["cluster.x-k8s.io/provider"] == "infrastructure-nutanix" and .kind == "Cluster" - # and .spec.topology.variables[0].value.addons.cni.provider == "Cilium" - # and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" + and .spec.topology.variables[0].value.addons.cni.provider == "Cilium" + and .spec.topology.variables[0].value.addons.cni.strategy == "HelmAddon" )' >"${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-cilium-helm-addon.yaml" ) \ >/dev/null diff --git a/make/clusterctl.mk b/make/clusterctl.mk index d131e5cfd..fc406e57e 100644 --- a/make/clusterctl.mk +++ b/make/clusterctl.mk @@ -10,7 +10,7 @@ clusterctl.init: AWS_B64ENCODED_CREDENTIALS= \ clusterctl init \ --kubeconfig=$(KIND_KUBECONFIG) \ - --infrastructure docker,aws \ + --infrastructure docker,aws,nutanix \ --addon helm \ --wait-providers