Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-1
spec:
prismElementCluster:
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
type: name
subnets:
- name: ${NUTANIX_SUBNET_NAME}
type: name
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-2
spec:
prismElementCluster:
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
type: name
subnets:
- name: ${NUTANIX_SUBNET_NAME}
type: name
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-3
spec:
prismElementCluster:
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
type: name
subnets:
- name: ${NUTANIX_SUBNET_NAME}
type: name
---
apiVersion: v1
kind: Secret
metadata:
Expand Down Expand Up @@ -38,42 +74,6 @@ stringData:
}
]
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-1
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-2
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-3
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
Expand Down Expand Up @@ -201,12 +201,12 @@ spec:
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}"
name: md-0
- class: default-worker
failureDomain: fd-3
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-1
failureDomain: fd-3
variables:
overrides:
- name: workerConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-1
spec:
prismElementCluster:
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
type: name
subnets:
- name: ${NUTANIX_SUBNET_NAME}
type: name
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-2
spec:
prismElementCluster:
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
type: name
subnets:
- name: ${NUTANIX_SUBNET_NAME}
type: name
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-3
spec:
prismElementCluster:
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
type: name
subnets:
- name: ${NUTANIX_SUBNET_NAME}
type: name
---
apiVersion: v1
kind: Secret
metadata:
Expand Down Expand Up @@ -38,42 +74,6 @@ stringData:
}
]
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-1
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-2
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-3
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
Expand All @@ -93,7 +93,9 @@ spec:
topology:
class: nutanix-quick-start
controlPlane:
metadata: {}
metadata:
annotations:
controlplane.cluster.x-k8s.io/skip-kube-proxy: ""
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: clusterConfig
Expand Down Expand Up @@ -198,12 +200,12 @@ spec:
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}"
name: md-0
- class: default-worker
failureDomain: fd-3
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-1
failureDomain: fd-3
variables:
overrides:
- name: workerConfig
Expand Down
39 changes: 39 additions & 0 deletions hack/examples/additional-resources/nutanix/failure-domains.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2025 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-1
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-2
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixFailureDomain
metadata:
name: fd-3
spec:
prismElementCluster:
type: name
name: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
subnets:
- type: name
name: ${NUTANIX_SUBNET_NAME}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2025 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../../../../additional-resources/nutanix/failure-domains.yaml
- ../../../../../bases/nutanix/cluster

sortOptions:
order: fifo

patches:
- target:
kind: Cluster
path: ../../../../../patches/cilium.yaml
- target:
kind: Cluster
path: ../../../../../patches/crs-strategy.yaml
- target:
kind: Cluster
path: ../../../../../patches/nutanix/use-failure-domains.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2025 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../../../../additional-resources/nutanix/failure-domains.yaml
- ../../../../../bases/nutanix/cluster

sortOptions:
order: fifo

patches:
- target:
kind: Cluster
path: ../../../../../patches/cilium.yaml
- target:
kind: Cluster
path: ../../../../../patches/skip-kube-proxy.yaml
- target:
kind: Cluster
path: ../../../../../patches/nutanix/use-failure-domains.yaml
38 changes: 38 additions & 0 deletions hack/examples/patches/nutanix/use-failure-domains.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2025 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

- op: "add"
path: "/spec/topology/variables/0/value/controlPlane/nutanix/failureDomains"
value:
- fd-1
- fd-2
- fd-3
- op: "remove"
path: "/spec/topology/variables/0/value/controlPlane/nutanix/machineDetails/cluster"
- op: "remove"
path: "/spec/topology/variables/0/value/controlPlane/nutanix/machineDetails/subnets"

- op: "add"
path: "/spec/topology/workers/machineDeployments/-"
value:
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-1
failureDomain: fd-3
variables:
overrides:
- name: workerConfig
value:
nutanix:
machineDetails:
bootType: uefi
imageLookup:
baseOS: ${NUTANIX_MACHINE_TEMPLATE_BASE_OS}
format: ${NUTANIX_MACHINE_TEMPLATE_LOOKUP_FORMAT}
memorySize: 4Gi
systemDiskSize: 40Gi
vcpuSockets: 2
vcpusPerSocket: 1
13 changes: 13 additions & 0 deletions hack/examples/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ for provider in "aws" "docker" "nutanix"; do
done
done

# shellcheck disable=SC2043 # Keep the loop for future use.
for provider in "nutanix"; do
for modifier in "failuredomains"; do
for cni in "cilium"; do
for strategy in "helm-addon" "crs"; do
kustomize build --load-restrictor LoadRestrictionsNone \
./hack/examples/overlays/clusters/"${provider}"-with-"${modifier}"/"${cni}"/"${strategy}" \
>"${EXAMPLE_CLUSTERS_DIR}/${provider}-cluster-with-${modifier}-${cni}-${strategy}.yaml"
done
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
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/config/caren.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ providers:
targetName: cluster-template-topology-cilium-helm-addon.yaml
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml"
targetName: cluster-template-topology-cilium-crs.yaml
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-failuredomain-cilium-helm-addon.yaml"
targetName: cluster-template-topology-failuredomain-cilium-helm-addon.yaml
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-failuredomain-cilium-crs.yaml"
targetName: cluster-template-topology-failuredomain-cilium-crs.yaml
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-with-failuredomains-cilium-helm-addon.yaml"
targetName: cluster-template-topology-with-failuredomains-cilium-helm-addon.yaml
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-with-failuredomains-cilium-crs.yaml"
targetName: cluster-template-topology-with-failuredomains-cilium-crs.yaml
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml"
targetName: cluster-template-topology-calico-helm-addon.yaml
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-calico-crs.yaml"
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/quick_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ var _ = Describe("Quick start", func() {
if provider == "Nutanix" && cniProvider == "Cilium" {
flavors = append(
flavors,
fmt.Sprintf("topology-failuredomain-%s-%s", strings.ToLower(cniProvider), strategy),
fmt.Sprintf(
"topology-with-failuredomains-%s-%s",
strings.ToLower(cniProvider),
strategy),
)
}
for _, flavor := range flavors {
Expand Down