Skip to content

Commit

Permalink
e2e test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Jan 4, 2024
1 parent 65cb67b commit e3a8112
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 50 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ cluster-e2e-templates-v1beta1: $(KUSTOMIZE) ## Generate cluster templates for v1
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-failure-domains --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-failure-domains.yaml
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass.yaml
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/clusterclass-e2e.yaml
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology.yaml

cluster-e2e-templates-no-kubeproxy: $(KUSTOMIZE) ##Generate cluster templates without kubeproxy
# v1alpha4
Expand All @@ -352,6 +353,7 @@ cluster-e2e-templates-no-kubeproxy: $(KUSTOMIZE) ##Generate cluster templates wi
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-failure-domains --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-failure-domains.yaml
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass.yaml
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/clusterclass-e2e.yaml
$(KUSTOMIZE) build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology.yaml

cluster-templates: $(KUSTOMIZE) ## Generate cluster templates for all flavors
$(KUSTOMIZE) build $(TEMPLATES_DIR)/base > $(TEMPLATES_DIR)/cluster-template.yaml
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/clusterclass_changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var _ = Describe("When testing ClusterClass changes [ClusterClass]", Label("clus
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
Flavor: "clusterclass",
Flavor: "topology",
// ModifyControlPlaneFields are the ControlPlane fields which will be set on the
// ControlPlaneTemplate of the ClusterClass after the initial Cluster creation.
// The test verifies that these fields are rolled out to the ControlPlane.
Expand Down Expand Up @@ -65,4 +65,4 @@ var _ = Describe("When testing ClusterClass changes [ClusterClass]", Label("clus
},
}
})
})
})
1 change: 1 addition & 0 deletions test/e2e/config/nutanix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ providers:
- sourcePath: "../data/infrastructure-nutanix/ccm-update.yaml"
- sourcePath: "../data/infrastructure-nutanix/v1beta1/cluster-template-clusterclass.yaml"
- sourcePath: "../data/infrastructure-nutanix/v1beta1/clusterclass-e2e.yaml"
- sourcePath: "../data/infrastructure-nutanix/v1beta1/cluster-template-topology.yaml"

variables:
# Default variables for the e2e test; those values could be overridden via env variables, thus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
bases:
- ../../../../../../templates/clusterclass/
- ../../../../../../templates/topology/

patchesStrategicMerge:
- ../base/cni-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bases:
- ../../../../../../templates/topology/

patchesStrategicMerge:
- ../base/cni-patch.yaml
176 changes: 132 additions & 44 deletions test/e2e/data/infrastructure-nutanix/v1beta1/clusterclass-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ metadata:
apiVersion: v1
data:
nutanix-ccm.yaml: |
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ${CLUSTER_NAME}-pc-trusted-ca-bundle
namespace: kube-system
binaryData:
ca.crt: ${NUTANIX_ADDITIONAL_TRUST_BUNDLE=""}
---
# Source: nutanix-cloud-provider/templates/rbac.yaml
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -279,49 +288,6 @@ spec:
verbosity: 10
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
cni: ${CLUSTER_NAME}-crs-cni
name: ${CLUSTER_NAME}
namespace: ${NAMESPACE}
spec:
clusterNetwork:
pods:
cidrBlocks:
- 172.20.0.0/16
serviceDomain: cluster.local
services:
cidrBlocks:
- 172.19.0.0/16
topology:
class: ${CLUSTER_CLASS_NAME}
controlPlane:
metadata: {}
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: sshKey
value: ${NUTANIX_SSH_AUTHORIZED_KEY}
- name: controlPlaneEndpoint
value:
IP: ${CONTROL_PLANE_ENDPOINT_IP}
port: ${CONTROL_PLANE_ENDPOINT_PORT=6443}
- name: prismCentralEndpoint
value:
address: ${NUTANIX_ENDPOINT}
insecure: ${NUTANIX_INSECURE=false}
port: ${NUTANIX_PORT=9440}
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: ClusterClass
metadata:
name: ${CLUSTER_CLASS_NAME}
Expand Down Expand Up @@ -415,7 +381,7 @@ spec:
kind: NutanixClusterTemplate
matchResources:
infrastructureCluster: true
name: add-control-plane-endpoint
name: update-control-plane-endpoint
- definitions:
- jsonPatches:
- op: add
Expand All @@ -437,6 +403,84 @@ spec:
matchResources:
infrastructureCluster: true
name: add-pc-endpoint-and-creds
- definitions:
- jsonPatches:
- op: replace
path: /spec/template/spec/bootType
valueFrom:
variable: controlPlaneMachineDetails.bootType
- op: replace
path: /spec/template/spec/vcpusPerSocket
valueFrom:
variable: controlPlaneMachineDetails.vcpusPerSocket
- op: replace
path: /spec/template/spec/memorySize
valueFrom:
variable: controlPlaneMachineDetails.memorySize
- op: replace
path: /spec/template/spec/systemDiskSize
valueFrom:
variable: controlPlaneMachineDetails.systemDiskSize
- op: replace
path: /spec/template/spec/image/name
valueFrom:
variable: controlPlaneMachineDetails.imageName
- op: replace
path: /spec/template/spec/cluster/name
valueFrom:
variable: controlPlaneMachineDetails.clusterName
- op: replace
path: /spec/template/spec/subnet
valueFrom:
template: |
- type: name
name: {{ .controlPlaneMachineDetails.subnetName }}
selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixMachineTemplate
matchResources:
controlPlane: true
name: update-control-plane-machine-template
- definitions:
- jsonPatches:
- op: replace
path: /spec/template/spec/bootType
valueFrom:
variable: workerMachineDetails.bootType
- op: replace
path: /spec/template/spec/vcpusPerSocket
valueFrom:
variable: workerMachineDetails.vcpusPerSocket
- op: replace
path: /spec/template/spec/memorySize
valueFrom:
variable: workerMachineDetails.memorySize
- op: replace
path: /spec/template/spec/systemDiskSize
valueFrom:
variable: workerMachineDetails.systemDiskSize
- op: replace
path: /spec/template/spec/image/name
valueFrom:
variable: workerMachineDetails.imageName
- op: replace
path: /spec/template/spec/cluster/name
valueFrom:
variable: workerMachineDetails.clusterName
- op: replace
path: /spec/template/spec/subnet
valueFrom:
template: |
- type: name
name: {{ .controlPlaneMachineDetails.subnetName }}
selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixMachineTemplate
matchResources:
machineDeploymentClass:
names:
- ${CLUSTER_CLASS_NAME}-worker
name: update-worker-machine-template
variables:
- name: sshKey
required: true
Expand Down Expand Up @@ -466,6 +510,50 @@ spec:
port:
type: integer
type: object
- name: controlPlaneMachineDetails
required: true
schema:
openAPIV3Schema:
properties:
bootType:
type: string
clusterName:
type: string
imageName:
type: string
memorySize:
type: string
subnetName:
type: string
systemDiskSize:
type: string
vcpuSockets:
type: integer
vcpusPerSocket:
type: integer
type: object
- name: workerMachineDetails
required: true
schema:
openAPIV3Schema:
properties:
bootType:
type: string
clusterName:
type: string
imageName:
type: string
memorySize:
type: string
subnetName:
type: string
systemDiskSize:
type: string
vcpuSockets:
type: integer
vcpusPerSocket:
type: integer
type: object
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
Expand Down

0 comments on commit e3a8112

Please sign in to comment.