From 825d2ce433f038fe3b1ad75b27db36ac5dca1974 Mon Sep 17 00:00:00 2001 From: Prajyot Parab Date: Fri, 24 Jan 2025 16:28:14 +0530 Subject: [PATCH] remove deprecated v1 provider id format Signed-off-by: Prajyot Parab --- Makefile | 1 - cloud/scope/machine.go | 4 +- cloud/scope/machine_test.go | 25 ++ cloud/scope/powervs_machine.go | 5 +- cloud/scope/powervs_machine_test.go | 10 +- .../ibmpowervsmachine_controller_test.go | 2 + controllers/ibmvpcmachine_controller_test.go | 5 + main.go | 10 +- pkg/cloud/services/utils/accounts.go | 8 + pkg/options/options.go | 7 - templates/cluster-template-powervs.yaml | 296 ------------------ templates/cluster-template-powervs/kcp.yaml | 15 - .../kubeadm-config.yaml | 11 - .../kustomization.yaml | 9 - 14 files changed, 51 insertions(+), 357 deletions(-) delete mode 100644 templates/cluster-template-powervs.yaml delete mode 100644 templates/cluster-template-powervs/kcp.yaml delete mode 100644 templates/cluster-template-powervs/kubeadm-config.yaml delete mode 100644 templates/cluster-template-powervs/kustomization.yaml diff --git a/Makefile b/Makefile index d7807db32..8274928b1 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,6 @@ generate-go-conversions: $(CONVERSION_GEN) ## Generate conversions go code .PHONY: generate-templates generate-templates: $(KUSTOMIZE) ## Generate cluster templates $(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template.yaml - $(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-powervs --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-powervs.yaml $(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-powervs-cloud-provider --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-powervs-cloud-provider.yaml $(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-powervs-clusterclass --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-powervs-clusterclass.yaml $(KUSTOMIZE) build $(TEMPLATES_DIR)/cluster-template-vpc-clusterclass --load-restrictor LoadRestrictionsNone > $(TEMPLATES_DIR)/cluster-template-vpc-clusterclass.yaml diff --git a/cloud/scope/machine.go b/cloud/scope/machine.go index 30d28f18b..8e94d8ab6 100644 --- a/cloud/scope/machine.go +++ b/cloud/scope/machine.go @@ -1077,14 +1077,14 @@ func (m *MachineScope) SetNotReady() { func (m *MachineScope) SetProviderID(id *string) error { // Based on the ProviderIDFormat version the providerID format will be decided. if options.ProviderIDFormatType(options.ProviderIDFormat) == options.ProviderIDFormatV2 { - accountID, err := utils.GetAccountID() + accountID, err := utils.GetAccountIDWrapper() if err != nil { m.Logger.Error(err, "failed to get cloud account id", err.Error()) return err } m.IBMVPCMachine.Spec.ProviderID = ptr.To(fmt.Sprintf("ibm://%s///%s/%s", accountID, m.Machine.Spec.ClusterName, *id)) } else { - m.IBMVPCMachine.Spec.ProviderID = ptr.To(fmt.Sprintf("ibmvpc://%s/%s", m.Machine.Spec.ClusterName, m.IBMVPCMachine.Name)) + return fmt.Errorf("invalid value for ProviderIDFormat") } return nil } diff --git a/cloud/scope/machine_test.go b/cloud/scope/machine_test.go index 2a153e857..6059154e3 100644 --- a/cloud/scope/machine_test.go +++ b/cloud/scope/machine_test.go @@ -35,7 +35,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" infrav1beta2 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2" + "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/utils" "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/vpc/mock" + "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/options" . "github.com/onsi/gomega" ) @@ -124,6 +126,29 @@ func TestNewMachineScope(t *testing.T) { } } +func TestSetVPCProviderID(t *testing.T) { + providerID := "foo-provider-id" + + t.Run("Set Provider ID in invalid format", func(t *testing.T) { + g := NewWithT(t) + scope := setupMachineScope(clusterName, machineName, mock.NewMockVpc(gomock.NewController(t))) + options.ProviderIDFormat = string("v1") + err := scope.SetProviderID(core.StringPtr(providerID)) + g.Expect(err).ToNot(BeNil()) + }) + + t.Run("Set Provider ID in valid format", func(t *testing.T) { + g := NewWithT(t) + scope := setupMachineScope(clusterName, machineName, mock.NewMockVpc(gomock.NewController(t))) + options.ProviderIDFormat = string("v2") + utils.GetAccountIDFunc = func() (string, error) { + return "dummy-account-id", nil // Return dummy value + } + err := scope.SetProviderID(core.StringPtr(providerID)) + g.Expect(err).To(BeNil()) + }) +} + func TestCreateMachine(t *testing.T) { setup := func(t *testing.T) (*gomock.Controller, *mock.MockVpc) { t.Helper() diff --git a/cloud/scope/powervs_machine.go b/cloud/scope/powervs_machine.go index 31aa88011..10e44bd92 100644 --- a/cloud/scope/powervs_machine.go +++ b/cloud/scope/powervs_machine.go @@ -954,9 +954,8 @@ func (m *PowerVSMachineScope) GetServiceInstanceID() (string, error) { // SetProviderID will set the provider id for the machine. func (m *PowerVSMachineScope) SetProviderID(instanceID string) error { // Based on the ProviderIDFormat version the providerID format will be decided. - if options.ProviderIDFormatType(options.ProviderIDFormat) == options.ProviderIDFormatV1 { - m.IBMPowerVSMachine.Spec.ProviderID = ptr.To(fmt.Sprintf("ibmpowervs://%s/%s", m.Machine.Spec.ClusterName, m.IBMPowerVSMachine.Name)) - return nil + if options.ProviderIDFormatType(options.ProviderIDFormat) != options.ProviderIDFormatV2 { + return fmt.Errorf("invalid value for ProviderIDFormat") } m.V(3).Info("setting provider id in v2 format") diff --git a/cloud/scope/powervs_machine_test.go b/cloud/scope/powervs_machine_test.go index 331f011b9..ea1fb3ad5 100644 --- a/cloud/scope/powervs_machine_test.go +++ b/cloud/scope/powervs_machine_test.go @@ -912,14 +912,12 @@ func TestGetMachineInternalIP(t *testing.T) { func TestSetProviderID(t *testing.T) { providerID := "foo-provider-id" - t.Run("Set Provider ID in v1 format", func(t *testing.T) { + t.Run("Set Provider ID in invalid format", func(t *testing.T) { g := NewWithT(t) scope := setupPowerVSMachineScope(clusterName, machineName, ptr.To(pvsImage), ptr.To(pvsNetwork), true, nil) - options.ProviderIDFormat = string(options.ProviderIDFormatV1) - err := scope.SetProviderID("foo-providerID") - expectedProviderID := ptr.To(fmt.Sprintf("ibmpowervs://%s/%s", scope.Machine.Spec.ClusterName, scope.IBMPowerVSMachine.Name)) - g.Expect(*scope.IBMPowerVSMachine.Spec.ProviderID).To(Equal(*expectedProviderID)) - g.Expect(err).To(BeNil()) + options.ProviderIDFormat = string("v1") + err := scope.SetProviderID(providerID) + g.Expect(err).ToNot(BeNil()) }) t.Run("failed to get service instance ID", func(t *testing.T) { diff --git a/controllers/ibmpowervsmachine_controller_test.go b/controllers/ibmpowervsmachine_controller_test.go index d6d999943..33065bce5 100644 --- a/controllers/ibmpowervsmachine_controller_test.go +++ b/controllers/ibmpowervsmachine_controller_test.go @@ -46,6 +46,7 @@ import ( "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/powervs" "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/powervs/mock" mockVPC "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/vpc/mock" + "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/options" "github.com/IBM-Cloud/power-go-client/power/models" "github.com/IBM/go-sdk-core/v5/core" @@ -374,6 +375,7 @@ func TestIBMPowerVSMachineReconciler_ReconcileOperations(t *testing.T) { mockCtrl.Finish() } t.Run("Reconciling creating IBMPowerVSMachine ", func(t *testing.T) { + options.ProviderIDFormat = string("v2") t.Run("Should requeue if Cluster infrastructure status is not ready", func(t *testing.T) { g := NewWithT(t) setup(t) diff --git a/controllers/ibmvpcmachine_controller_test.go b/controllers/ibmvpcmachine_controller_test.go index f72ad601f..48b91c8a9 100644 --- a/controllers/ibmvpcmachine_controller_test.go +++ b/controllers/ibmvpcmachine_controller_test.go @@ -39,6 +39,7 @@ import ( infrav1beta2 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2" "sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope" gtmock "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/globaltagging/mock" + "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/utils" vpcmock "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/vpc/mock" . "github.com/onsi/gomega" @@ -327,6 +328,10 @@ func TestIBMVPCMachineLBReconciler_reconcile(t *testing.T) { return gomock.NewController(t), mockvpc, mockgt, machineScope, reconciler } + utils.GetAccountIDFunc = func() (string, error) { + return "dummy-account-id", nil // Return dummy value + } + t.Run("Reconcile creating IBMVPCMachine associated with LoadBalancer", func(t *testing.T) { instancelist := &vpcv1.InstanceCollection{ Instances: []vpcv1.Instance{ diff --git a/main.go b/main.go index f8ab2e5ff..9948f0c8a 100644 --- a/main.go +++ b/main.go @@ -135,14 +135,10 @@ func initFlags(fs *pflag.FlagSet) { } func validateFlags() error { - switch options.ProviderIDFormatType(options.ProviderIDFormat) { - // Deprecated: ProviderIDFormatV1 is deprecated and will be removed in a future release. - case options.ProviderIDFormatV1: - setupLog.Info("Using v1 version of ProviderID format.V1 is deprecated and will be removed in a future release.Instead use V2.") - case options.ProviderIDFormatV2: + if options.ProviderIDFormatType(options.ProviderIDFormat) == options.ProviderIDFormatV2 { setupLog.Info("Using v2 version of ProviderID format") - default: - return fmt.Errorf("invalid value for flag provider-id-fmt: %s, Supported values: %s, %s ", options.ProviderIDFormat, options.ProviderIDFormatV1, options.ProviderIDFormatV2) + } else { + return fmt.Errorf("invalid value for flag provider-id-fmt: %s, Only supported value is %s", options.ProviderIDFormat, options.ProviderIDFormatV2) } if err := logsv1.ValidateAndApply(logOptions, nil); err != nil { diff --git a/pkg/cloud/services/utils/accounts.go b/pkg/cloud/services/utils/accounts.go index c4fb10645..54cf36a23 100644 --- a/pkg/cloud/services/utils/accounts.go +++ b/pkg/cloud/services/utils/accounts.go @@ -54,6 +54,14 @@ func GetAccount(auth core.Authenticator) (string, error) { return token.Claims.(jwt.MapClaims)["account"].(map[string]interface{})["bss"].(string), nil } +// GetAccountIDFunc is a variable that will hold the function reference. +var GetAccountIDFunc = GetAccountID // Default to the original function + +// GetAccountIDWrapper is a function that calls GetAccountIDFunc. +func GetAccountIDWrapper() (string, error) { + return GetAccountIDFunc() // Call the function that GetAccountIDFunc points to +} + // GetAccountID will parse and returns user cloud account ID. func GetAccountID() (string, error) { auth, err := authenticator.GetAuthenticator() diff --git a/pkg/options/options.go b/pkg/options/options.go index 0630eae2e..19e37ae70 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -20,13 +20,6 @@ package options type ProviderIDFormatType string const ( - // ProviderIDFormatV1 will set provider id to machine as follows - // For VPC machines: ibmvpc:/// - // For Power VS machines: ibmpowervs:/// - // Deprecated: ProviderIDFormatV1 is deprecated and will be removed in a future release. see https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/issues/1868 for more details. - // use ProviderIDFormatV2 instead ProviderIDFormatV1. - ProviderIDFormatV1 ProviderIDFormatType = "v1" - // ProviderIDFormatV2 will set provider id to machine as follows // For VPC machines: ibm:////// // For Power VS machines: ibmpowervs:///// diff --git a/templates/cluster-template-powervs.yaml b/templates/cluster-template-powervs.yaml deleted file mode 100644 index dfd33b1a5..000000000 --- a/templates/cluster-template-powervs.yaml +++ /dev/null @@ -1,296 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - labels: - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - ${POD_CIDR:="192.168.0.0/16"} - serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} - services: - cidrBlocks: - - ${SERVICE_CIDR:="10.128.0.0/12"} - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: IBMPowerVSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: IBMPowerVSCluster -metadata: - labels: - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - name: ${CLUSTER_NAME} -spec: - controlPlaneEndpoint: - host: ${IBMPOWERVS_VIP_EXTERNAL} - port: ${API_SERVER_PORT:=6443} - network: - name: ${IBMPOWERVS_NETWORK_NAME} - serviceInstanceID: ${IBMPOWERVS_SERVICE_INSTANCE_ID} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - certSANs: - - ${IBMPOWERVS_VIP} - - ${IBMPOWERVS_VIP_EXTERNAL} - controlPlaneEndpoint: ${IBMPOWERVS_VIP}:${API_SERVER_PORT:=6443} - controllerManager: - extraArgs: - enable-hostpath-provisioner: "true" - files: - - content: | - apiVersion: v1 - kind: Pod - metadata: - creationTimestamp: null - name: kube-vip - namespace: kube-system - spec: - containers: - - args: - - manager - env: - - name: vip_arp - value: "true" - - name: port - value: "${API_SERVER_PORT:=6443}" - - name: vip_interface - value: env2 - - name: vip_cidr - value: "${IBMPOWERVS_VIP_CIDR}" - - name: cp_enable - value: "true" - - name: cp_namespace - value: kube-system - - name: vip_ddns - value: "false" - - name: svc_enable - value: "true" - - name: vip_leaderelection - value: "true" - - name: vip_leaseduration - value: "5" - - name: vip_renewdeadline - value: "3" - - name: vip_retryperiod - value: "1" - - name: address - value: "${IBMPOWERVS_VIP}" - image: ghcr.io/kube-vip/kube-vip:v0.8.0 - imagePullPolicy: Always - name: kube-vip - resources: {} - securityContext: - capabilities: - add: - - NET_ADMIN - - NET_RAW - volumeMounts: - - mountPath: /etc/kubernetes/admin.conf - name: kubeconfig - - mountPath: /etc/hosts - name: etchosts - hostNetwork: true - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: kubeconfig - - hostPath: - path: /etc/kube-vip.hosts - type: File - name: etchosts - status: {} - owner: root:root - path: /etc/kubernetes/manifests/kube-vip.yaml - permissions: "0744" - - content: 127.0.0.1 localhost kubernetes - owner: root:root - path: /etc/kube-vip.hosts - permissions: "0644" - - content: | - #!/bin/bash - - # Copyright 2020 The Kubernetes Authors. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - - set -e - - # Configure the workaround required for kubeadm init with kube-vip: - # xref: https://github.com/kube-vip/kube-vip/issues/684 - - # Nothing to do for kubernetes < v1.29 - KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then - exit 0 - fi - - IS_KUBEADM_INIT="false" - - # cloud-init kubeadm init - if [[ -f /run/kubeadm/kubeadm.yaml ]]; then - IS_KUBEADM_INIT="true" - fi - - # ignition kubeadm init - if [[ -f /etc/kubeadm.sh ]] && grep -q -e "kubeadm init" /etc/kubeadm.sh; then - IS_KUBEADM_INIT="true" - fi - - if [[ "$IS_KUBEADM_INIT" == "true" ]]; then - sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' \ - /etc/kubernetes/manifests/kube-vip.yaml - fi - owner: root:root - path: /etc/pre-kubeadm-commands/50-kube-vip-prepare.sh - permissions: "0700" - initConfiguration: - nodeRegistration: - criSocket: /var/run/containerd/containerd.sock - kubeletExtraArgs: - cloud-provider: external - eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% - provider-id: ibmpowervs://${CLUSTER_NAME}/'{{ v1.local_hostname }}' - name: '{{ v1.local_hostname }}' - joinConfiguration: - discovery: - bootstrapToken: - apiServerEndpoint: ${IBMPOWERVS_VIP}:${API_SERVER_PORT:=6443} - caCertHashes: [] - token: "" - unsafeSkipCAVerification: false - nodeRegistration: - criSocket: /var/run/containerd/containerd.sock - kubeletExtraArgs: - cloud-provider: external - eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% - provider-id: ibmpowervs://${CLUSTER_NAME}/'{{ v1.local_hostname }}' - name: '{{ v1.local_hostname }}' - preKubeadmCommands: - - hostname "{{ v1.local_hostname }}" - - echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts - - echo "127.0.0.1 localhost" >>/etc/hosts - - echo "127.0.0.1 {{ v1.local_hostname }}" >>/etc/hosts - - echo "{{ v1.local_hostname }}" >/etc/hostname - - mkdir -p /etc/pre-kubeadm-commands - - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done - useExperimentalRetryJoin: true - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 - kind: IBMPowerVSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: IBMPowerVSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - image: - name: ${IBMPOWERVS_IMAGE_NAME} - memoryGiB: ${IBMPOWERVS_CONTROL_PLANE_MEMORY:=4} - network: - name: ${IBMPOWERVS_NETWORK_NAME} - processorType: ${IBMPOWERVS_CONTROL_PLANE_PROCTYPE:="Shared"} - processors: ${IBMPOWERVS_CONTROL_PLANE_PROCESSORS:="0.25"} - serviceInstanceID: ${IBMPOWERVS_SERVICE_INSTANCE_ID} - sshKey: ${IBMPOWERVS_SSHKEY_NAME} - systemType: ${IBMPOWERVS_CONTROL_PLANE_SYSTYPE:="s922"} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - 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: IBMPowerVSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 -kind: IBMPowerVSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - image: - name: ${IBMPOWERVS_IMAGE_NAME} - memoryGiB: ${IBMPOWERVS_COMPUTE_MEMORY:=4} - network: - name: ${IBMPOWERVS_NETWORK_NAME} - processorType: ${IBMPOWERVS_COMPUTE_PROCTYPE:="Shared"} - processors: ${IBMPOWERVS_COMPUTE_PROCESSORS:="0.25"} - serviceInstanceID: ${IBMPOWERVS_SERVICE_INSTANCE_ID} - sshKey: ${IBMPOWERVS_SSHKEY_NAME} - systemType: ${IBMPOWERVS_COMPUTE_SYSTYPE:="s922"} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - labels: - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - discovery: - bootstrapToken: - apiServerEndpoint: ${IBMPOWERVS_VIP}:${API_SERVER_PORT:=6443} - caCertHashes: [] - token: "" - unsafeSkipCAVerification: false - nodeRegistration: - criSocket: /var/run/containerd/containerd.sock - kubeletExtraArgs: - cloud-provider: external - eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% - provider-id: ibmpowervs://${CLUSTER_NAME}/'{{ v1.local_hostname }}' - name: '{{ v1.local_hostname }}' - preKubeadmCommands: - - hostname "{{ v1.local_hostname }}" - - echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts - - echo "127.0.0.1 localhost" >>/etc/hosts - - echo "127.0.0.1 {{ v1.local_hostname }}" >>/etc/hosts - - echo "{{ v1.local_hostname }}" >/etc/hostname diff --git a/templates/cluster-template-powervs/kcp.yaml b/templates/cluster-template-powervs/kcp.yaml deleted file mode 100644 index 65b9f438a..000000000 --- a/templates/cluster-template-powervs/kcp.yaml +++ /dev/null @@ -1,15 +0,0 @@ -kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - kubeadmConfigSpec: - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: ibmpowervs://${CLUSTER_NAME}/'{{ v1.local_hostname }}' - name: '{{ v1.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - provider-id: ibmpowervs://${CLUSTER_NAME}/'{{ v1.local_hostname }}' diff --git a/templates/cluster-template-powervs/kubeadm-config.yaml b/templates/cluster-template-powervs/kubeadm-config.yaml deleted file mode 100644 index d690de6c2..000000000 --- a/templates/cluster-template-powervs/kubeadm-config.yaml +++ /dev/null @@ -1,11 +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: ibmpowervs://${CLUSTER_NAME}/'{{ v1.local_hostname }}' diff --git a/templates/cluster-template-powervs/kustomization.yaml b/templates/cluster-template-powervs/kustomization.yaml deleted file mode 100644 index 158a96dac..000000000 --- a/templates/cluster-template-powervs/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -resources: -- ../bases/powervs - -patches: -- path: kcp.yaml -- path: kubeadm-config.yaml - -sortOptions: - order: fifo