diff --git a/.gitignore b/.gitignore index 02c3b4d9..a46e1d80 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ cluster-api # Ignore output of Makefile sed operations created when generating manifests. config/default/manager_image_patch_edited.yaml +# Ignore output of e2e kustomization of templates. +test/e2e/data/infrastructure-cloudstack/v1beta*/*yaml + # Test binary, build with `go test -c` *.test diff --git a/Makefile b/Makefile index b25e4b5c..8ef80206 100644 --- a/Makefile +++ b/Makefile @@ -188,6 +188,7 @@ clean: ## Clean. rm -rf $(RELEASE_DIR) rm -rf bin rm -rf cluster-api + rm -rf test/e2e/data/infrastructure-cloudstack/*/*yaml ##@ Testing @@ -223,8 +224,7 @@ cluster-api/tilt-settings.json: hack/tilt-settings.json cluster-api cp ./hack/tilt-settings.json cluster-api ##@ End-to-End Testing - -CLUSTER_TEMPLATES_INPUT_FILES=$(shell find test/e2e/data/infrastructure-cloudstack/v1beta2/*/cluster-template*/* test/e2e/data/infrastructure-cloudstack/*/bases/* -type f) +CLUSTER_TEMPLATES_INPUT_FILES=$(shell find test/e2e/data/infrastructure-cloudstack/v1beta*/*/cluster-template* test/e2e/data/infrastructure-cloudstack/*/bases/* -type f) CLUSTER_TEMPLATES_OUTPUT_FILES=$(shell find test/e2e/data/infrastructure-cloudstack -type d -name "cluster-template*" -exec echo {}.yaml \;) .PHONY: e2e-cluster-templates e2e-cluster-templates: $(CLUSTER_TEMPLATES_OUTPUT_FILES) ## Generate cluster template files for e2e testing. diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go index d5488c10..4b8835e5 100644 --- a/api/v1beta1/zz_generated.conversion.go +++ b/api/v1beta1/zz_generated.conversion.go @@ -73,16 +73,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*CloudStackClusterList)(nil), (*v1beta2.CloudStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CloudStackClusterList_To_v1beta2_CloudStackClusterList(a.(*CloudStackClusterList), b.(*v1beta2.CloudStackClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.CloudStackClusterList)(nil), (*CloudStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_CloudStackClusterList_To_v1beta1_CloudStackClusterList(a.(*v1beta2.CloudStackClusterList), b.(*CloudStackClusterList), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*CloudStackIsolatedNetwork)(nil), (*v1beta2.CloudStackIsolatedNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_CloudStackIsolatedNetwork_To_v1beta2_CloudStackIsolatedNetwork(a.(*CloudStackIsolatedNetwork), b.(*v1beta2.CloudStackIsolatedNetwork), scope) }); err != nil { @@ -415,48 +405,6 @@ func Convert_v1beta2_CloudStackAffinityGroupStatus_To_v1beta1_CloudStackAffinity return autoConvert_v1beta2_CloudStackAffinityGroupStatus_To_v1beta1_CloudStackAffinityGroupStatus(in, out, s) } -func autoConvert_v1beta1_CloudStackClusterList_To_v1beta2_CloudStackClusterList(in *CloudStackClusterList, out *v1beta2.CloudStackClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.CloudStackCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_CloudStackCluster_To_v1beta2_CloudStackCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_CloudStackClusterList_To_v1beta2_CloudStackClusterList is an autogenerated conversion function. -func Convert_v1beta1_CloudStackClusterList_To_v1beta2_CloudStackClusterList(in *CloudStackClusterList, out *v1beta2.CloudStackClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_CloudStackClusterList_To_v1beta2_CloudStackClusterList(in, out, s) -} - -func autoConvert_v1beta2_CloudStackClusterList_To_v1beta1_CloudStackClusterList(in *v1beta2.CloudStackClusterList, out *CloudStackClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CloudStackCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta2_CloudStackCluster_To_v1beta1_CloudStackCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_CloudStackClusterList_To_v1beta1_CloudStackClusterList is an autogenerated conversion function. -func Convert_v1beta2_CloudStackClusterList_To_v1beta1_CloudStackClusterList(in *v1beta2.CloudStackClusterList, out *CloudStackClusterList, s conversion.Scope) error { - return autoConvert_v1beta2_CloudStackClusterList_To_v1beta1_CloudStackClusterList(in, out, s) -} - func autoConvert_v1beta1_CloudStackIsolatedNetwork_To_v1beta2_CloudStackIsolatedNetwork(in *CloudStackIsolatedNetwork, out *v1beta2.CloudStackIsolatedNetwork, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1beta1_CloudStackIsolatedNetworkSpec_To_v1beta2_CloudStackIsolatedNetworkSpec(&in.Spec, &out.Spec, s); err != nil { @@ -547,7 +495,7 @@ func autoConvert_v1beta2_CloudStackIsolatedNetworkSpec_To_v1beta1_CloudStackIsol out.Name = in.Name out.ID = in.ID out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - // INFO: in.FailureDomain opted out of conversion generation + // INFO: in.FailureDomainName opted out of conversion generation return nil } diff --git a/api/v1beta2/cloudstackfailuredomain_types.go b/api/v1beta2/cloudstackfailuredomain_types.go index cd70b7f5..054da326 100644 --- a/api/v1beta2/cloudstackfailuredomain_types.go +++ b/api/v1beta2/cloudstackfailuredomain_types.go @@ -17,10 +17,21 @@ limitations under the License. package v1beta2 import ( + "crypto/md5" // #nosec G501 -- weak cryptographic primitive doesn't matter here. Not security related. + "fmt" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// FailureDomainHashedMetaName returns an MD5 name generated from the FailureDomain and Cluster name. +// FailureDomains must have a unique name even when potentially sharing a namespace with other clusters. +// In the future we may remove the ability to run multiple clusters in a single namespace, but today +// this is a consequence of being upstream of EKS-A which does run multiple clusters in a single namepace. +func FailureDomainHashedMetaName(fdName, clusterName string) string { + return fmt.Sprintf("%x", md5.Sum([]byte(fdName+clusterName))) // #nosec G401 -- weak cryptographic primitive doesn't matter here. Not security related. +} + const ( FailureDomainFinalizer = "cloudstackfailuredomain.infrastructure.cluster.x-k8s.io" FailureDomainLabelName = "cloudstackfailuredomain.infrastructure.cluster.x-k8s.io/name" @@ -70,8 +81,9 @@ type CloudStackFailureDomainSpec struct { // CloudStack domain. // +optional Domain string `json:"domain,omitempty"` + // Apache CloudStack Endpoint secret reference. - ACSEndpoint corev1.SecretReference `json:"acsendpoint"` + ACSEndpoint corev1.SecretReference `json:"acsEndpoint"` } // CloudStackFailureDomainStatus defines the observed state of CloudStackFailureDomain diff --git a/api/v1beta2/cloudstackisolatednetwork_types.go b/api/v1beta2/cloudstackisolatednetwork_types.go index 70ffafd2..88ddeb85 100644 --- a/api/v1beta2/cloudstackisolatednetwork_types.go +++ b/api/v1beta2/cloudstackisolatednetwork_types.go @@ -40,8 +40,8 @@ type CloudStackIsolatedNetworkSpec struct { ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` //+k8s:conversion-gen=false - // FailureDomain -- the FailureDomain the network is placed in. - FailureDomain CloudStackFailureDomainSpec `json:"failureDomain"` + // FailureDomainName -- the FailureDomain the network is placed in. + FailureDomainName string `json:"failureDomainName"` } // CloudStackIsolatedNetworkStatus defines the observed state of CloudStackIsolatedNetwork diff --git a/api/v1beta2/cloudstackmachine_types.go b/api/v1beta2/cloudstackmachine_types.go index d44943ca..ceeaa9f1 100644 --- a/api/v1beta2/cloudstackmachine_types.go +++ b/api/v1beta2/cloudstackmachine_types.go @@ -63,7 +63,7 @@ type CloudStackMachineSpec struct { // Optional affinitygroupids for deployVirtualMachine // +optional - AffinityGroupIDs []string `json:"affinitygroupids,omitempty"` + AffinityGroupIDs []string `json:"affinityGroupIDs,omitempty"` // Mutually exclusive parameter with AffinityGroupIDs. // Defaults to `no`. Can be `pro` or `anti`. Will create an affinity group per machine set. @@ -73,7 +73,7 @@ type CloudStackMachineSpec struct { // Mutually exclusive parameter with AffinityGroupIDs. // Is a reference to a CloudStack affinity group CRD. // +optional - AffinityGroupRef *corev1.ObjectReference `json:"cloudstackaffinityref,omitempty"` + AffinityGroupRef *corev1.ObjectReference `json:"cloudstackAffinityRef,omitempty"` // The CS specific unique identifier. Of the form: fmt.Sprintf("cloudstack:///%s", CS Machine ID) // +optional diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 1cde3338..d86d4131 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -372,7 +372,6 @@ func (in *CloudStackIsolatedNetworkList) DeepCopyObject() runtime.Object { func (in *CloudStackIsolatedNetworkSpec) DeepCopyInto(out *CloudStackIsolatedNetworkSpec) { *out = *in out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - out.FailureDomain = in.FailureDomain } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudStackIsolatedNetworkSpec. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackclusters.yaml index 44f5470d..8c86c33d 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackclusters.yaml @@ -223,7 +223,7 @@ spec: account: description: CloudStack account. type: string - acsendpoint: + acsEndpoint: description: Apache CloudStack Endpoint secret reference. properties: name: @@ -272,7 +272,7 @@ spec: - network type: object required: - - acsendpoint + - acsEndpoint - name - zone type: object diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackfailuredomains.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackfailuredomains.yaml index a226d919..46e8ac85 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackfailuredomains.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackfailuredomains.yaml @@ -41,7 +41,7 @@ spec: account: description: CloudStack account. type: string - acsendpoint: + acsEndpoint: description: Apache CloudStack Endpoint secret reference. properties: name: @@ -89,7 +89,7 @@ spec: - network type: object required: - - acsendpoint + - acsEndpoint - name - zone type: object diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackisolatednetworks.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackisolatednetworks.yaml index f25bf474..5be0935f 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackisolatednetworks.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackisolatednetworks.yaml @@ -118,66 +118,10 @@ spec: - host - port type: object - failureDomain: - description: FailureDomain -- the FailureDomain the network is placed - in. - properties: - account: - description: CloudStack account. - type: string - acsendpoint: - description: Apache CloudStack Endpoint secret reference. - properties: - name: - description: Name is unique within a namespace to reference - a secret resource. - type: string - namespace: - description: Namespace defines the space within which the - secret name must be unique. - type: string - type: object - domain: - description: CloudStack domain. - type: string - name: - description: The failure domain unique name. - type: string - zone: - description: The ACS Zone for this failure domain. - properties: - id: - description: ID. - type: string - name: - description: Name. - type: string - network: - description: The network within the Zone to use. - properties: - id: - description: Cloudstack Network ID the cluster is built - in. - type: string - name: - description: Cloudstack Network Name the cluster is built - in. - type: string - type: - description: Cloudstack Network Type the cluster is built - in. - type: string - required: - - name - type: object - required: - - network - type: object - required: - - acsendpoint - - name - - zone - type: object + failureDomainName: + description: FailureDomainName -- the FailureDomain the network is + placed in. + type: string id: description: ID. type: string @@ -186,7 +130,7 @@ spec: type: string required: - controlPlaneEndpoint - - failureDomain + - failureDomainName type: object status: description: CloudStackIsolatedNetworkStatus defines the observed state diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachines.yaml index 1d3adffe..3074480b 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachines.yaml @@ -301,12 +301,12 @@ spec: to `no`. Can be `pro` or `anti`. Will create an affinity group per machine set. type: string - affinitygroupids: + affinityGroupIDs: description: Optional affinitygroupids for deployVirtualMachine items: type: string type: array - cloudstackaffinityref: + cloudstackAffinityRef: description: Mutually exclusive parameter with AffinityGroupIDs. Is a reference to a CloudStack affinity group CRD. properties: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachinetemplates.yaml index f0bf9018..a2563474 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackmachinetemplates.yaml @@ -251,12 +251,12 @@ spec: Defaults to `no`. Can be `pro` or `anti`. Will create an affinity group per machine set. type: string - affinitygroupids: + affinityGroupIDs: description: Optional affinitygroupids for deployVirtualMachine items: type: string type: array - cloudstackaffinityref: + cloudstackAffinityRef: description: Mutually exclusive parameter with AffinityGroupIDs. Is a reference to a CloudStack affinity group CRD. properties: diff --git a/controllers/cloudstackaffinitygroup_controller.go b/controllers/cloudstackaffinitygroup_controller.go index 48384146..80ff10a1 100644 --- a/controllers/cloudstackaffinitygroup_controller.go +++ b/controllers/cloudstackaffinitygroup_controller.go @@ -20,7 +20,6 @@ import ( "context" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" infrav1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2" @@ -60,9 +59,7 @@ func (reconciler *CloudStackAffinityGroupReconciler) Reconcile(ctx context.Conte r := NewCSAGReconciliationRunner() r.UsingBaseReconciler(reconciler.ReconcilerBase).ForRequest(req).WithRequestCtx(ctx) r.WithAdditionalCommonStages( - r.GetObjectByName("placeholder", r.FailureDomain, - func() string { return r.ReconciliationSubject.Spec.FailureDomainName }), - r.CheckPresent(map[string]client.Object{"CloudStackFailureDomain": r.FailureDomain}), + r.GetFailureDomainByName(func() string { return r.ReconciliationSubject.Spec.FailureDomainName }, r.FailureDomain), r.AsFailureDomainUser(&r.FailureDomain.Spec)) return r.RunBaseReconciliationStages() } diff --git a/controllers/cloudstackaffinitygroup_controller_test.go b/controllers/cloudstackaffinitygroup_controller_test.go index 14c68fce..06f34a10 100644 --- a/controllers/cloudstackaffinitygroup_controller_test.go +++ b/controllers/cloudstackaffinitygroup_controller_test.go @@ -34,8 +34,7 @@ var _ = Describe("CloudStackAffinityGroupReconciler", func() { It("Should patch back the affinity group as ready after calling GetOrCreateAffinityGroup.", func() { // Modify failure domain name the same way the cluster controller would. - dummies.CSFailureDomain1.Name = dummies.CSFailureDomain1.Name + "-" + dummies.CSCluster.Name - dummies.CSAffinityGroup.Spec.FailureDomainName = dummies.CSFailureDomain1.Name + dummies.CSAffinityGroup.Spec.FailureDomainName = dummies.CSFailureDomain1.Spec.Name Ω(k8sClient.Create(ctx, dummies.CSFailureDomain1)) Ω(k8sClient.Create(ctx, dummies.CSAffinityGroup)).Should(Succeed()) diff --git a/controllers/cloudstackcluster_controller.go b/controllers/cloudstackcluster_controller.go index 1d39a1c9..9e6d4f37 100644 --- a/controllers/cloudstackcluster_controller.go +++ b/controllers/cloudstackcluster_controller.go @@ -105,20 +105,19 @@ func (r *CloudStackClusterReconciliationRunner) SetReady() (ctrl.Result, error) // VerifyFailureDomainCRDs verifies the FailureDomains found match against those requested. func (r *CloudStackClusterReconciliationRunner) VerifyFailureDomainCRDs() (ctrl.Result, error) { // Check that all required failure domains are present and ready. - for _, requiredFd := range r.ReconciliationSubject.Spec.FailureDomains { + for _, requiredFdSpec := range r.ReconciliationSubject.Spec.FailureDomains { found := false for _, fd := range r.FailureDomains.Items { - requiredFDName := csCtrlrUtils.WithClusterSuffix(requiredFd.Name, r.CAPICluster.Name) - if requiredFDName == fd.Name { + if requiredFdSpec.Name == fd.Spec.Name { found = true if !fd.Status.Ready { - return r.RequeueWithMessage(fmt.Sprintf("Required FailureDomain %s not ready, requeueing.", fd.Name)) + return r.RequeueWithMessage(fmt.Sprintf("Required FailureDomain %s not ready, requeueing.", fd.Spec.Name)) } break } } if !found { - return r.RequeueWithMessage(fmt.Sprintf("Required FailureDomain %s not found, requeueing.", requiredFd.Name)) + return r.RequeueWithMessage(fmt.Sprintf("Required FailureDomain %s not found, requeueing.", requiredFdSpec.Name)) } } return ctrl.Result{}, nil @@ -128,8 +127,9 @@ func (r *CloudStackClusterReconciliationRunner) VerifyFailureDomainCRDs() (ctrl. func (r *CloudStackClusterReconciliationRunner) SetFailureDomainsStatusMap() (ctrl.Result, error) { r.ReconciliationSubject.Status.FailureDomains = clusterv1.FailureDomains{} for _, fdSpec := range r.ReconciliationSubject.Spec.FailureDomains { - fdSpec.Name = csCtrlrUtils.WithClusterSuffix(fdSpec.Name, r.CAPICluster.Name) - r.ReconciliationSubject.Status.FailureDomains[fdSpec.Name] = clusterv1.FailureDomainSpec{ControlPlane: true} + metaHashName := infrav1.FailureDomainHashedMetaName(fdSpec.Name, r.CAPICluster.Name) + r.ReconciliationSubject.Status.FailureDomains[fdSpec.Name] = clusterv1.FailureDomainSpec{ + ControlPlane: true, Attributes: map[string]string{"MetaHashName": metaHashName}} } return ctrl.Result{}, nil } diff --git a/controllers/cloudstackfailuredomain_controller.go b/controllers/cloudstackfailuredomain_controller.go index faa25daa..2c68a15a 100644 --- a/controllers/cloudstackfailuredomain_controller.go +++ b/controllers/cloudstackfailuredomain_controller.go @@ -84,17 +84,14 @@ func (r *CloudStackFailureDomainReconciliationRunner) Reconcile() (retRes ctrl.R !csCtrlrUtils.ContainsNoMatchSubstring(err) { return ctrl.Result{}, errors.Wrap(err, "resolving Cloudstack network information") } - // Patch Zone ID back before potentially creating an isolated network. - if err := r.Patcher.Patch(r.RequestCtx, r.ReconciliationSubject); err != nil { - return ctrl.Result{}, err - } // Check if the passed network was an isolated network or the network was missing. In either case, create a // CloudStackIsolatedNetwork to manage the many intricacies and wait until CloudStackIsolatedNetwork is ready. if r.ReconciliationSubject.Spec.Zone.Network.ID == "" || r.ReconciliationSubject.Spec.Zone.Network.Type == infrav1.NetworkTypeIsolated { netName := r.ReconciliationSubject.Spec.Zone.Network.Name - if res, err := r.GenerateIsolatedNetwork(netName)(); r.ShouldReturn(res, err) { + if res, err := r.GenerateIsolatedNetwork( + netName, func() string { return r.ReconciliationSubject.Spec.Name })(); r.ShouldReturn(res, err) { return res, err } else if res, err := r.GetObjectByName(r.IsoNetMetaName(netName), r.IsoNet)(); r.ShouldReturn(res, err) { return res, err diff --git a/controllers/cloudstackisolatednetwork_controller.go b/controllers/cloudstackisolatednetwork_controller.go index 9b9cf294..f0fe94ae 100644 --- a/controllers/cloudstackisolatednetwork_controller.go +++ b/controllers/cloudstackisolatednetwork_controller.go @@ -22,7 +22,6 @@ import ( "sigs.k8s.io/cluster-api/util/patch" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "github.com/pkg/errors" @@ -61,8 +60,7 @@ func (reconciler *CloudStackIsoNetReconciler) Reconcile(ctx context.Context, req r := NewCSIsoNetReconciliationRunner() r.UsingBaseReconciler(reconciler.ReconcilerBase).ForRequest(req).WithRequestCtx(ctx) r.WithAdditionalCommonStages( - r.GetParent(r.ReconciliationSubject, r.FailureDomain), - r.CheckPresent(map[string]client.Object{"CloudStackFailureDomain": r.FailureDomain}), + r.GetFailureDomainByName(func() string { return r.ReconciliationSubject.Spec.FailureDomainName }, r.FailureDomain), r.AsFailureDomainUser(&r.FailureDomain.Spec), ) return r.RunBaseReconciliationStages() diff --git a/controllers/cloudstackmachine_controller.go b/controllers/cloudstackmachine_controller.go index 3ed32a68..b6185f72 100644 --- a/controllers/cloudstackmachine_controller.go +++ b/controllers/cloudstackmachine_controller.go @@ -21,7 +21,6 @@ import ( "fmt" "math/rand" "reflect" - "strings" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -87,9 +86,7 @@ func (reconciler *CloudStackMachineReconciler) Reconcile(ctx context.Context, re r.GetParent(r.ReconciliationSubject, r.CAPIMachine), r.RequeueIfCloudStackClusterNotReady, r.SetFailureDomainOnCSMachine, - r.GetObjectByName("placeholder", r.FailureDomain, - func() string { return r.ReconciliationSubject.Spec.FailureDomainName }), - r.CheckPresent(map[string]client.Object{"CloudStackFailureDomain": r.FailureDomain}), + r.GetFailureDomainByName(func() string { return r.ReconciliationSubject.Spec.FailureDomainName }, r.FailureDomain), r.AsFailureDomainUser(&r.FailureDomain.Spec)) return r.RunBaseReconciliationStages() } @@ -147,9 +144,6 @@ func (r *CloudStackMachineReconciliationRunner) SetFailureDomainOnCSMachine() (r randNum := (rand.Int() % len(r.CSCluster.Spec.FailureDomains)) // #nosec G404 -- weak crypt rand doesn't matter here. name = r.CSCluster.Spec.FailureDomains[randNum].Name } - if !strings.HasSuffix(name, "-"+r.CAPICluster.Name) { // Add cluster name suffix if missing. - name = name + "-" + r.CAPICluster.Name - } r.ReconciliationSubject.Spec.FailureDomainName = name r.ReconciliationSubject.Labels[infrav1.FailureDomainLabelName] = r.ReconciliationSubject.Spec.FailureDomainName } diff --git a/controllers/cloudstackmachine_controller_test.go b/controllers/cloudstackmachine_controller_test.go index a87e14ab..d8b97c9a 100644 --- a/controllers/cloudstackmachine_controller_test.go +++ b/controllers/cloudstackmachine_controller_test.go @@ -34,9 +34,7 @@ var _ = Describe("CloudStackMachineReconciler", func() { BeforeEach(func() { dummies.SetDummyVars() dummies.CSCluster.Spec.FailureDomains = dummies.CSCluster.Spec.FailureDomains[:1] - dummies.CSCluster.Spec.FailureDomains[0].Name = dummies.CSFailureDomain1.Name - dummies.CSFailureDomain1.Spec.Name = dummies.CSFailureDomain1.Spec.Name + "-" + dummies.CSCluster.Name - dummies.CSFailureDomain1.Name = dummies.CSFailureDomain1.Spec.Name + dummies.CSCluster.Spec.FailureDomains[0].Name = dummies.CSFailureDomain1.Spec.Name SetupTestEnvironment() // Must happen before setting up managers/reconcilers. Ω(MachineReconciler.SetupWithManager(k8sManager)).Should(Succeed()) // Register the CloudStack MachineReconciler. diff --git a/controllers/cloudstackmachinestatechecker_controller.go b/controllers/cloudstackmachinestatechecker_controller.go index 7d50e617..66a246a5 100644 --- a/controllers/cloudstackmachinestatechecker_controller.go +++ b/controllers/cloudstackmachinestatechecker_controller.go @@ -74,9 +74,7 @@ func (r *CloudStackMachineStateCheckerReconciliationRunner) Reconcile() (ctrl.Re r.GetParent(r.ReconciliationSubject, r.CSMachine), r.GetParent(r.CSMachine, r.CAPIMachine), r.CheckPresent(map[string]client.Object{"CloudStackMachine": r.CSMachine, "Machine": r.CAPIMachine}), - r.GetObjectByName("placeholder", r.FailureDomain, - func() string { return r.CSMachine.Spec.FailureDomainName }), - r.CheckPresent(map[string]client.Object{"CloudStackFailureDomain": r.FailureDomain}), + r.GetFailureDomainByName(func() string { return r.CSMachine.Spec.FailureDomainName }, r.FailureDomain), r.AsFailureDomainUser(&r.FailureDomain.Spec), func() (ctrl.Result, error) { if err := r.CSClient.ResolveVMInstanceDetails(r.CSMachine); err != nil { diff --git a/controllers/utils/failuredomains.go b/controllers/utils/failuredomains.go index 64cdbcb2..dc6ee77d 100644 --- a/controllers/utils/failuredomains.go +++ b/controllers/utils/failuredomains.go @@ -33,8 +33,9 @@ import ( // CreateFailureDomain creates a specified CloudStackFailureDomain CRD owned by the ReconcilationSubject. func (r *ReconciliationRunner) CreateFailureDomain(fdSpec infrav1.CloudStackFailureDomainSpec) error { + metaHashName := infrav1.FailureDomainHashedMetaName(fdSpec.Name, r.CAPICluster.Name) csFD := &infrav1.CloudStackFailureDomain{ - ObjectMeta: r.NewChildObjectMeta(fdSpec.Name), + ObjectMeta: r.NewChildObjectMeta(metaHashName), Spec: fdSpec, } return errors.Wrap(r.K8sClient.Create(r.RequestCtx, csFD), "creating CloudStackFailureDomain") @@ -44,9 +45,6 @@ func (r *ReconciliationRunner) CreateFailureDomain(fdSpec infrav1.CloudStackFail func (r *ReconciliationRunner) CreateFailureDomains(fdSpecs []infrav1.CloudStackFailureDomainSpec) CloudStackReconcilerMethod { return func() (ctrl.Result, error) { for _, fdSpec := range fdSpecs { - if !strings.HasSuffix(fdSpec.Name, "-"+r.CAPICluster.Name) { // Add cluster name suffix if missing. - fdSpec.Name = fdSpec.Name + "-" + r.CAPICluster.Name - } if err := r.CreateFailureDomain(fdSpec); err != nil { if !strings.Contains(strings.ToLower(err.Error()), "already exists") { return reconcile.Result{}, errors.Wrap(err, "creating CloudStackFailureDomains") @@ -73,6 +71,17 @@ func (r *ReconciliationRunner) GetFailureDomains(fds *infrav1.CloudStackFailureD } } +// GetFailureDomainByName gets a single FailureDomain by name and requeues if it's not found. +func (r *ReconciliationRunner) GetFailureDomainByName(nameFunc func() string, fd *infrav1.CloudStackFailureDomain) CloudStackReconcilerMethod { + return func() (ctrl.Result, error) { + metaHashName := infrav1.FailureDomainHashedMetaName(nameFunc(), r.CAPICluster.Name) + if err := r.K8sClient.Get(r.RequestCtx, client.ObjectKey{Namespace: r.Request.Namespace, Name: metaHashName}, fd); err != nil { + return ctrl.Result{}, errors.Wrapf(err, "failed to get failure domain with name %s", nameFunc()) + } + return ctrl.Result{}, nil + } +} + // RemoveExtraneousFailureDomains deletes failure domains no longer listed under the CloudStackCluster's spec. func (r *ReconciliationRunner) RemoveExtraneousFailureDomains(fds *infrav1.CloudStackFailureDomainList) CloudStackReconcilerMethod { return func() (ctrl.Result, error) { @@ -80,15 +89,12 @@ func (r *ReconciliationRunner) RemoveExtraneousFailureDomains(fds *infrav1.Cloud fdPresenceByName := map[string]bool{} for _, fdSpec := range r.CSCluster.Spec.FailureDomains { name := fdSpec.Name - if !strings.HasSuffix(name, "-"+r.CAPICluster.Name) { // Add cluster name suffix if missing. - name = name + "-" + r.CAPICluster.Name - } fdPresenceByName[name] = true } // Send a deletion request for each FailureDomain not speced for. for _, fd := range fds.Items { - if _, present := fdPresenceByName[fd.Name]; !present { + if _, present := fdPresenceByName[fd.Spec.Name]; !present { toDelete := fd r.Log.Info(fmt.Sprintf("Deleting extraneous failure domain: %s.", fd.Name)) if err := r.K8sClient.Delete(r.RequestCtx, &toDelete); err != nil { diff --git a/controllers/utils/isolated_network.go b/controllers/utils/isolated_network.go index 3328ea5b..8a92acc0 100644 --- a/controllers/utils/isolated_network.go +++ b/controllers/utils/isolated_network.go @@ -29,13 +29,14 @@ func (r *ReconciliationRunner) IsoNetMetaName(name string) string { } // GenerateIsolatedNetwork of the passed name that's owned by the ReconciliationSubject. -func (r *ReconciliationRunner) GenerateIsolatedNetwork(name string) CloudStackReconcilerMethod { +func (r *ReconciliationRunner) GenerateIsolatedNetwork(name string, fdNameFunc func() string) CloudStackReconcilerMethod { return func() (ctrl.Result, error) { lowerName := strings.ToLower(name) metaName := fmt.Sprintf("%s-%s", r.CSCluster.Name, lowerName) csIsoNet := &infrav1.CloudStackIsolatedNetwork{} csIsoNet.ObjectMeta = r.NewChildObjectMeta(metaName) csIsoNet.Spec.Name = lowerName + csIsoNet.Spec.FailureDomainName = fdNameFunc() csIsoNet.Spec.ControlPlaneEndpoint.Host = r.CSCluster.Spec.ControlPlaneEndpoint.Host csIsoNet.Spec.ControlPlaneEndpoint.Port = r.CSCluster.Spec.ControlPlaneEndpoint.Port diff --git a/test/dummies/v1beta2/vars.go b/test/dummies/v1beta2/vars.go index 518efb49..ecc14eab 100644 --- a/test/dummies/v1beta2/vars.go +++ b/test/dummies/v1beta2/vars.go @@ -253,7 +253,7 @@ func SetDummyCAPCClusterVars() { APIVersion: CSApiVersion, Kind: "CloudStackFailureDomain"}, ObjectMeta: metav1.ObjectMeta{ - Name: "fd1", + Name: infrav1.FailureDomainHashedMetaName("fd1", ClusterName), Namespace: "default", UID: "0", Labels: ClusterLabel}, @@ -266,7 +266,7 @@ func SetDummyCAPCClusterVars() { APIVersion: CSApiVersion, Kind: "CloudStackFailureDomain"}, ObjectMeta: metav1.ObjectMeta{ - Name: "fd2", + Name: infrav1.FailureDomainHashedMetaName("fd2", ClusterName), Namespace: "default", UID: "0", Labels: ClusterLabel}, diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/bases/cluster-with-kcp.yaml index 75ed80f9..01542391 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/bases/cluster-with-kcp.yaml @@ -28,7 +28,7 @@ spec: port: 6443 failureDomains: - name: ${CLOUDSTACK_FD1_NAME} - acsendpoint: + acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default zone: diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-anti.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-anti.yaml deleted file mode 100644 index 14e78711..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-anti.yaml +++ /dev/null @@ -1,130 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - affinity: anti - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - affinity: anti - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-pro.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-pro.yaml deleted file mode 100644 index 2bfca8b2..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-pro.yaml +++ /dev/null @@ -1,130 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - affinity: pro - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - affinity: pro - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-custom-disk-offering.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-custom-disk-offering.yaml deleted file mode 100644 index d57d1bd1..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-custom-disk-offering.yaml +++ /dev/null @@ -1,176 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - diskSetup: - filesystems: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE}1 - extraOpts: - - -E - - lazy_itable_init=1,lazy_journal_init=1 - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: data_disk - overwrite: false - partitions: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - layout: true - overwrite: false - tableType: gpt - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - mounts: - - - LABEL=${CLOUDSTACK_DISK_OFFERING_LABEL} - - ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - diskSetup: - filesystems: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE}1 - extraOpts: - - -E - - lazy_itable_init=1,lazy_journal_init=1 - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: data_disk - overwrite: false - partitions: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - layout: true - overwrite: false - tableType: gpt - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - mounts: - - - LABEL=${CLOUDSTACK_DISK_OFFERING_LABEL} - - ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - diskOffering: - customSizeInGB: ${CLOUDSTACK_DISK_OFFERING_CUSTOM_SIZE} - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: ${CLOUDSTACK_DISK_OFFERING_LABEL} - mountPath: ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - name: ${CLOUDSTACK_CUSTOM_DISK_OFFERING_NAME} - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - diskOffering: - customSizeInGB: ${CLOUDSTACK_DISK_OFFERING_CUSTOM_SIZE} - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: ${CLOUDSTACK_DISK_OFFERING_LABEL} - mountPath: ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - name: ${CLOUDSTACK_CUSTOM_DISK_OFFERING_NAME} - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-disk-offering.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-disk-offering.yaml deleted file mode 100644 index b025db2e..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-disk-offering.yaml +++ /dev/null @@ -1,174 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - diskSetup: - filesystems: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE}1 - extraOpts: - - -E - - lazy_itable_init=1,lazy_journal_init=1 - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: data_disk - overwrite: false - partitions: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - layout: true - overwrite: false - tableType: gpt - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - mounts: - - - LABEL=${CLOUDSTACK_DISK_OFFERING_LABEL} - - ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - diskSetup: - filesystems: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE}1 - extraOpts: - - -E - - lazy_itable_init=1,lazy_journal_init=1 - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: data_disk - overwrite: false - partitions: - - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - layout: true - overwrite: false - tableType: gpt - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - mounts: - - - LABEL=${CLOUDSTACK_DISK_OFFERING_LABEL} - - ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - diskOffering: - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: ${CLOUDSTACK_DISK_OFFERING_LABEL} - mountPath: ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - name: ${CLOUDSTACK_DISK_OFFERING_NAME} - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - diskOffering: - device: ${CLOUDSTACK_DISK_OFFERING_DEVICE} - filesystem: ${CLOUDSTACK_DISK_OFFERING_FILESYSTEM} - label: ${CLOUDSTACK_DISK_OFFERING_LABEL} - mountPath: ${CLOUDSTACK_DISK_OFFERING_MOUNT_PATH} - name: ${CLOUDSTACK_DISK_OFFERING_NAME} - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources-for-upgrade.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources-for-upgrade.yaml deleted file mode 100644 index 8f0269db..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources-for-upgrade.yaml +++ /dev/null @@ -1,154 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-upgrade-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-upgrade-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_IMPOSSIBLE_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources.yaml deleted file mode 100644 index 346ec928..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources.yaml +++ /dev/null @@ -1,128 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account.yaml deleted file mode 100644 index d613103c..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account.yaml +++ /dev/null @@ -1,130 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - account: ${CLOUDSTACK_INVALID_ACCOUNT_NAME} - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - domain: ${CLOUDSTACK_DOMAIN_NAME} - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account/cloudstack-cluster.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account/cloudstack-cluster.yaml index 7e1e36d6..57d28683 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account/cloudstack-cluster.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account/cloudstack-cluster.yaml @@ -5,7 +5,7 @@ metadata: spec: failureDomains: - name: ${CLOUDSTACK_FD1_NAME} - acsendpoint: + acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default zone: diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-cp-offering.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-cp-offering.yaml deleted file mode 100644 index bbf7ad06..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-cp-offering.yaml +++ /dev/null @@ -1,128 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_INVALID_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-customized.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-customized.yaml deleted file mode 100644 index 6165c11c..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-customized.yaml +++ /dev/null @@ -1,134 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - diskOffering: - device: /dev/vdb - filesystem: ext4 - label: my_disk - mountPath: /disk - name: ${CLOUDSTACK_CUSTOM_DISK_OFFERING_NAME} - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-non-customized.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-non-customized.yaml deleted file mode 100644 index e00b2ae0..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-non-customized.yaml +++ /dev/null @@ -1,135 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - diskOffering: - customSizeInGB: 1 - device: /dev/vdb - filesystem: ext4 - label: my_disk - mountPath: /disk - name: ${CLOUDSTACK_DISK_OFFERING_NAME} - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering.yaml deleted file mode 100644 index 585427f4..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering.yaml +++ /dev/null @@ -1,134 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - diskOffering: - device: /dev/vdb - filesystem: ext4 - label: my_disk - mountPath: /disk - name: ${CLOUDSTACK_INVALID_DISK_OFFERING_NAME} - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain.yaml deleted file mode 100644 index 18ca0617..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain.yaml +++ /dev/null @@ -1,130 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - account: ${CLOUDSTACK_ACCOUNT_NAME} - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - domain: ${CLOUDSTACK_INVALID_DOMAIN_NAME} - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain/cloudstack-cluster.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain/cloudstack-cluster.yaml index 97d2ba07..05d5a14f 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain/cloudstack-cluster.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain/cloudstack-cluster.yaml @@ -5,7 +5,7 @@ metadata: spec: failureDomains: - name: ${CLOUDSTACK_FD1_NAME} - acsendpoint: + acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default zone: diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-template.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-template.yaml deleted file mode 100644 index 583689fc..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-template.yaml +++ /dev/null @@ -1,128 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_INVALID_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone.yaml deleted file mode 100644 index 3537b155..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone.yaml +++ /dev/null @@ -1,128 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_INVALID_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone/cloudstack-cluster.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone/cloudstack-cluster.yaml index e2998576..273e62f5 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone/cloudstack-cluster.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone/cloudstack-cluster.yaml @@ -4,7 +4,7 @@ metadata: name: ${CLUSTER_NAME} spec: failureDomains: - - acsendpoint: + - acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default name: ${CLOUDSTACK_FD1_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-machine-remediation.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-machine-remediation.yaml deleted file mode 100644 index 247b917c..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-machine-remediation.yaml +++ /dev/null @@ -1,166 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: {} - template: - metadata: - labels: - e2e.mhc.label: "" - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineHealthCheck -metadata: - name: ${CLUSTER_NAME}-mhc-control-plane-0 -spec: - clusterName: ${CLUSTER_NAME} - maxUnhealthy: 100% - selector: - matchLabels: - cluster.x-k8s.io/control-plane: "" - unhealthyConditions: - - status: Unknown - timeout: 60s - type: Ready - - status: "False" - timeout: 60s - type: Ready ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineHealthCheck -metadata: - name: ${CLUSTER_NAME}-mhc-md-0 -spec: - clusterName: ${CLUSTER_NAME} - maxUnhealthy: 100% - selector: - matchLabels: - e2e.mhc.label: "" - unhealthyConditions: - - status: Unknown - timeout: 60s - type: Ready - - status: "False" - timeout: 60s - type: Ready ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-node-drain.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-node-drain.yaml deleted file mode 100644 index 77e983ef..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-node-drain.yaml +++ /dev/null @@ -1,129 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: {} - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - nodeDrainTimeout: ${NODE_DRAIN_TIMEOUT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - nodeDrainTimeout: ${NODE_DRAIN_TIMEOUT} - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup.yaml deleted file mode 100644 index 2c85d776..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup.yaml +++ /dev/null @@ -1,128 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NEW_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup/cloudstack-cluster.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup/cloudstack-cluster.yaml index d59228e2..e6d23335 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup/cloudstack-cluster.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup/cloudstack-cluster.yaml @@ -4,7 +4,7 @@ metadata: name: ${CLUSTER_NAME} spec: failureDomains: - - acsendpoint: + - acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default name: ${CLOUDSTACK_FD1_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster.yaml deleted file mode 100644 index 53edb94d..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster.yaml +++ /dev/null @@ -1,130 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: ${CLUSTER_ENDPOINT_IP_2} - port: 6443 - failureDomains: - - account: ${CLOUDSTACK_ACCOUNT_NAME} - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - domain: ${CLOUDSTACK_DOMAIN_NAME} - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster/cloudstack-cluster.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster/cloudstack-cluster.yaml index 15284d84..697484a4 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster/cloudstack-cluster.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster/cloudstack-cluster.yaml @@ -5,7 +5,7 @@ metadata: spec: failureDomains: - name: ${CLOUDSTACK_FD1_NAME} - acsendpoint: + acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default zone: diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip.yaml deleted file mode 100644 index f69ba044..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip.yaml +++ /dev/null @@ -1,178 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - files: - - content: | - apiVersion: v1 - kind: Pod - metadata: - creationTimestamp: null - name: kube-vip - namespace: kube-system - spec: - containers: - - args: - - start - env: - - name: vip_arp - value: "true" - - name: vip_leaderelection - value: "true" - - name: vip_address - value: ${CLUSTER_ENDPOINT_IP} - - name: vip_interface - value: ens3 - - name: vip_leaseduration - value: "15" - - name: vip_renewdeadline - value: "10" - - name: vip_retryperiod - value: "2" - image: public.ecr.aws/i3w0y7q3/plunder-app/kube-vip:v0.3.7-eks-a-v0.0.0-dev-build.0 - imagePullPolicy: IfNotPresent - name: kube-vip - resources: {} - securityContext: - capabilities: - add: - - NET_ADMIN - - SYS_TIME - volumeMounts: - - mountPath: /etc/kubernetes/admin.conf - name: kubeconfig - hostNetwork: true - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - type: FileOrCreate - name: kubeconfig - status: {} - owner: root:root - path: /etc/kubernetes/manifests/kube-vip.yaml - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - ignorePreflightErrors: - - DirAvailable--etc-kubernetes-manifests - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: ${CLUSTER_ENDPOINT_IP} - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_SHARED_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip/cluster-with-shared-network-and-kubevip.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip/cluster-with-shared-network-and-kubevip.yaml index 2c3f948f..25c7a39f 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip/cluster-with-shared-network-and-kubevip.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip/cluster-with-shared-network-and-kubevip.yaml @@ -28,7 +28,7 @@ spec: port: 6443 failureDomains: - name: ${CLOUDSTACK_FD1_NAME} - acsendpoint: + acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default zone: diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain.yaml deleted file mode 100644 index 2e714bf1..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain.yaml +++ /dev/null @@ -1,132 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - account: ${CLOUDSTACK_SUBDOMAIN_ACCOUNT_NAME} - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - domain: ${CLOUDSTACK_SUBDOMAIN_PATH} - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - affinity: pro - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - affinity: pro - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/cloudstack-cluster.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/cloudstack-cluster.yaml index 9c265d47..25c45f00 100644 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/cloudstack-cluster.yaml +++ b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/cloudstack-cluster.yaml @@ -5,7 +5,7 @@ metadata: spec: failureDomains: - name: ${CLOUDSTACK_FD1_NAME} - acsendpoint: + acsEndpoint: name: ${CLOUDSTACK_FD1_SECRET_NAME} namespace: default zone: diff --git a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template.yaml b/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template.yaml deleted file mode 100644 index 54dcb53b..00000000 --- a/test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template.yaml +++ /dev/null @@ -1,128 +0,0 @@ -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - serviceDomain: cluster.local - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackCluster - name: ${CLUSTER_NAME} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - imageRepository: k8s.gcr.io - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' - name: '{{ local_hostname }}' - preKubeadmCommands: - - swapoff -a - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: CloudStackMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: "" - port: 6443 - failureDomains: - - acsendpoint: - name: ${CLOUDSTACK_FD1_SECRET_NAME} - namespace: default - name: ${CLOUDSTACK_FD1_NAME} - zone: - name: ${CLOUDSTACK_ZONE_NAME} - network: - name: ${CLOUDSTACK_NETWORK_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: CloudStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - offering: - name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} - sshKey: ${CLOUDSTACK_SSH_KEY_NAME} - template: - name: ${CLOUDSTACK_TEMPLATE_NAME}