Skip to content

Commit

Permalink
reverted removal of ccm ca bundle config map and added test
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Jan 2, 2024
1 parent c7359a2 commit c84bc1a
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ list-cc-cluster-resources: generate-cc-cluster-kubeconfig
kubectl -n capx-system get endpoints
kubectl get crd | grep nutanix
kubectl get cluster-api -A
kubectl -n $(TEST_NAMESPACE) get Cluster,NutanixCluster,Machine,NutanixMachine,KubeAdmControlPlane,MachineHealthCheck,nodes
clusterctl describe cluster ${TEST_TOPOLOGY_CLUSTER_NAME} -n ${TEST_NAMESPACE}
kubectl -n $(TEST_NAMESPACE) get Cluster,NutanixCluster,Machine,NutanixMachine,KubeAdmControlPlane,machinedeployments,MachineHealthCheck,nodes
kubectl get ValidatingWebhookConfiguration,MutatingWebhookConfiguration -A
kubectl --kubeconfig ./${TEST_TOPOLOGY_CLUSTER_NAME}.workload.kubeconfig get nodes,ns
kubectl --kubeconfig ./${TEST_TOPOLOGY_CLUSTER_NAME}.workload.kubeconfig get pods -A
Expand Down
9 changes: 9 additions & 0 deletions templates/base-root/nutanix-ccm.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
---
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
9 changes: 9 additions & 0 deletions templates/cluster-template-clusterclass.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
9 changes: 9 additions & 0 deletions templates/cluster-template-csi.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
9 changes: 9 additions & 0 deletions templates/cluster-template.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
68 changes: 68 additions & 0 deletions test/e2e/clusterclass_changes_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//go:build e2e
// +build e2e

/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package e2e

import (
. "github.com/onsi/ginkgo/v2"

capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
)

var _ = Describe("When testing ClusterClass changes [ClusterClass]", Label("clusterclass", "slow", "network"), func() {
capi_e2e.ClusterClassChangesSpec(ctx, func() capi_e2e.ClusterClassChangesSpecInput {
return capi_e2e.ClusterClassChangesSpecInput{
E2EConfig: e2eConfig,
ClusterctlConfigPath: clusterctlConfigPath,
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
Flavor: "clusterclass",
// 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.
ModifyControlPlaneFields: map[string]interface{}{
"spec.machineTemplate.nodeDrainTimeout": "10s",
},
// ModifyMachineDeploymentBootstrapConfigTemplateFields are the fields which will be set on the
// BootstrapConfigTemplate of all MachineDeploymentClasses of the ClusterClass after the initial Cluster creation.
// The test verifies that these fields are rolled out to the MachineDeployments.
ModifyMachineDeploymentBootstrapConfigTemplateFields: map[string]interface{}{
"spec.template.spec.verbosity": int64(4),
},
// ModifyMachineDeploymentInfrastructureMachineTemplateFields are the fields which will be set on the
// InfrastructureMachineTemplate of all MachineDeploymentClasses of the ClusterClass after the initial Cluster creation.
// The test verifies that these fields are rolled out to the MachineDeployments.
ModifyMachineDeploymentInfrastructureMachineTemplateFields: map[string]interface{}{
"spec.template.spec.extraMounts": []interface{}{
map[string]interface{}{
"containerPath": "/var/run/docker.sock",
"hostPath": "/var/run/docker.sock",
},
map[string]interface{}{
// /tmp cannot be used as containerPath as
// it already exists.
"containerPath": "/test",
"hostPath": "/tmp",
},
},
},
}
})
})
4 changes: 4 additions & 0 deletions test/e2e/config/nutanix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ providers:
- sourcePath: "../data/infrastructure-nutanix/v1beta1/cluster-template-csi.yaml"
- sourcePath: "../data/infrastructure-nutanix/v1beta1/cluster-template-failure-domains.yaml"
- sourcePath: "../data/infrastructure-nutanix/ccm-update.yaml"
- sourcePath: "../data/infrastructure-nutanix/v1beta1/cluster-template-clusterclass.yaml"
- sourcePath: "../data/infrastructure-nutanix/v1beta1/clusterclass-e2e.yaml"

variables:
# Default variables for the e2e test; those values could be overridden via env variables, thus
Expand All @@ -277,6 +279,8 @@ variables:
KUBERNETES_VERSION_MANAGEMENT: "v1.23.6"
IP_FAMILY: "IPv4"
CLUSTERCTL_LOG_LEVEL: 10
CLUSTER_TOPOLOGY: "true"
CLUSTER_CLASS_NAME: "e2e"
NUTANIX_PROVIDER: "true"
NUTANIX_ENDPOINT: ""
NUTANIX_USER: ""
Expand Down

0 comments on commit c84bc1a

Please sign in to comment.