diff --git a/docs/src/developers/development.md b/docs/src/developers/development.md index 07a281dbc..ea5a53ffb 100644 --- a/docs/src/developers/development.md +++ b/docs/src/developers/development.md @@ -169,7 +169,7 @@ This can then be used with `clusterctl` by adding the following to `~/.cluster-a ``` providers: - name: local-linode - url: ${PWD}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml + url: ${HOME}/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml type: InfrastructureProvider ``` diff --git a/docs/src/developers/testing.md b/docs/src/developers/testing.md index 998b5f58b..bc2d7a786 100644 --- a/docs/src/developers/testing.md +++ b/docs/src/developers/testing.md @@ -195,7 +195,7 @@ The e2e tests use the `local-linode` infrastructure provider, this is registered ``` providers: - name: local-linode - url: ${PWD}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml + url: ${HOME}/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml type: InfrastructureProvider ``` diff --git a/e2e/capl-cluster-flavors/k3s-capl-cluster/chainsaw-test.yaml b/e2e/capl-cluster-flavors/k3s-capl-cluster/chainsaw-test.yaml index 34948793b..4f13b3a9f 100755 --- a/e2e/capl-cluster-flavors/k3s-capl-cluster/chainsaw-test.yaml +++ b/e2e/capl-cluster-flavors/k3s-capl-cluster/chainsaw-test.yaml @@ -39,7 +39,7 @@ spec: --flavor k3s --kubernetes-version v1.29.1+k3s2 \ --infrastructure local-linode:v0.0.0 \ --control-plane-machine-count 1 --worker-machine-count 1 \ - --config $CLUSTERCTL_CONFIG > k3s-cluster.yaml + --config ${CLUSTERCTL_CONFIG:${HOME}/.cluster-api/clusterctl.yaml} > k3s-cluster.yaml check: ($error == null): true - name: Apply generated cluster yaml diff --git a/e2e/capl-cluster-flavors/kubeadm-capl-cluster/chainsaw-test.yaml b/e2e/capl-cluster-flavors/kubeadm-capl-cluster/chainsaw-test.yaml index 0e22ec1a4..871431321 100755 --- a/e2e/capl-cluster-flavors/kubeadm-capl-cluster/chainsaw-test.yaml +++ b/e2e/capl-cluster-flavors/kubeadm-capl-cluster/chainsaw-test.yaml @@ -39,7 +39,7 @@ spec: --kubernetes-version v1.29.1 \ --infrastructure local-linode:v0.0.0 \ --control-plane-machine-count 1 --worker-machine-count 1 \ - --config $CLUSTERCTL_CONFIG > default-cluster.yaml + --config ${CLUSTERCTL_CONFIG:${HOME}/.cluster-api/clusterctl.yaml} > default-cluster.yaml check: ($error == null): true - name: Apply generated cluster yaml diff --git a/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml b/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml index 8fb136d95..6bee182c6 100755 --- a/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml +++ b/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml @@ -38,7 +38,7 @@ spec: --flavor rke2 --kubernetes-version v1.29.1+rke2r1 \ --infrastructure local-linode:v0.0.0 \ --control-plane-machine-count 1 --worker-machine-count 1 \ - --config $CLUSTERCTL_CONFIG> rke2-cluster.yaml + --config ${CLUSTERCTL_CONFIG:${HOME}/.cluster-api/clusterctl.yaml} > rke2-cluster.yaml check: ($error == null): true - name: Apply generated cluster yaml diff --git a/e2e/gha-clusterctl-config.yaml b/e2e/gha-clusterctl-config.yaml index a9ee04059..c6d205d4f 100644 --- a/e2e/gha-clusterctl-config.yaml +++ b/e2e/gha-clusterctl-config.yaml @@ -1,6 +1,6 @@ providers: - name: local-linode - url: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml + url: ${GITHUB_WORKSPACE}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml type: InfrastructureProvider - name: "k3s" url: https://github.com/k3s-io/cluster-api-k3s/releases/latest/bootstrap-components.yaml diff --git a/templates/flavors/k3s/default/k3sControlPlane.yaml b/templates/flavors/k3s/default/k3sControlPlane.yaml index 68eb67081..d4d82d171 100644 --- a/templates/flavors/k3s/default/k3sControlPlane.yaml +++ b/templates/flavors/k3s/default/k3sControlPlane.yaml @@ -15,29 +15,6 @@ spec: content: | flannel-backend: none disable-network-policy: true - - path: /var/lib/rancher/k3s/server/manifests/ccm-linode.yaml - owner: root:root - content: |- - apiVersion: helm.cattle.io/v1 - kind: HelmChart - metadata: - namespace: kube-system - name: ccm-linode - spec: - targetNamespace: kube-system - version: ${LINODE_CCM_VERSION:=v0.4.4} - chart: ccm-linode - repo: https://linode.github.io/linode-cloud-controller-manager/ - bootstrap: true - valuesContent: |- - routeController: - vpcName: ${VPC_NAME:=${CLUSTER_NAME}} - clusterCIDR: 10.0.0.0/8 - configureCloudRoutes: true - secretRef: - name: "linode-token-region" - nodeSelector: - node-role.kubernetes.io/control-plane: "true" - path: /var/lib/rancher/k3s/server/manifests/cilium.yaml owner: root:root content: |- @@ -86,12 +63,6 @@ spec: enabled: true ui: enabled: true - - path: /var/lib/rancher/k3s/server/manifests/linode-token-region.yaml - owner: root:root - contentFrom: - secret: - key: linode-token-region.yaml - name: linode-${CLUSTER_NAME}-crs-0 serverConfig: disableComponents: - servicelb diff --git a/templates/flavors/k3s/default/kustomization.yaml b/templates/flavors/k3s/default/kustomization.yaml index c1b734a18..9ca96488c 100644 --- a/templates/flavors/k3s/default/kustomization.yaml +++ b/templates/flavors/k3s/default/kustomization.yaml @@ -4,8 +4,10 @@ resources: - ../../../infra - k3sControlPlane.yaml - k3sConfigTemplate.yaml - - secret.yaml - ../../../addons/cilium-network-policies + - ../../../addons/csi-driver-linode + - ../../../addons/ccm-linode + - ../../../addons/cluster-resource-set patches: - target: group: cluster.x-k8s.io @@ -15,6 +17,19 @@ patches: - op: replace path: /spec/controlPlaneRef/kind value: KThreesControlPlane + - target: + group: cluster.x-k8s.io + version: v1beta1 + kind: Cluster + patch: |- + apiVersion: cluster.x-k8s.io/v1beta1 + kind: Cluster + metadata: + name: ${CLUSTER_NAME} + labels: + ccm: ${CLUSTER_NAME}-linode + csi: ${CLUSTER_NAME}-linode + crs: ${CLUSTER_NAME}-crs - target: group: cluster.x-k8s.io version: v1beta1 diff --git a/templates/flavors/rke2/default/kustomization.yaml b/templates/flavors/rke2/default/kustomization.yaml index 1f8448567..0e6b69e3a 100644 --- a/templates/flavors/rke2/default/kustomization.yaml +++ b/templates/flavors/rke2/default/kustomization.yaml @@ -4,9 +4,11 @@ resources: - ../../../infra - rke2ControlPlane.yaml - rke2ConfigTemplate.yaml - - secret.yaml - ../../../addons/cilium - ../../../addons/cilium-network-policies + - ../../../addons/csi-driver-linode + - ../../../addons/ccm-linode + - ../../../addons/cluster-resource-set patches: - target: group: cluster.x-k8s.io @@ -26,7 +28,10 @@ patches: metadata: name: ${CLUSTER_NAME} labels: - cni: ${CLUSTER_NAME}-cilium + cni: ${CLUSTER_NAME}-cilium + ccm: ${CLUSTER_NAME}-linode + csi: ${CLUSTER_NAME}-linode + crs: ${CLUSTER_NAME}-crs - target: group: cluster.x-k8s.io version: v1beta1 diff --git a/templates/flavors/rke2/default/rke2ControlPlane.yaml b/templates/flavors/rke2/default/rke2ControlPlane.yaml index 506735cb3..7730885f0 100644 --- a/templates/flavors/rke2/default/rke2ControlPlane.yaml +++ b/templates/flavors/rke2/default/rke2ControlPlane.yaml @@ -8,36 +8,6 @@ spec: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 kind: LinodeMachineTemplate name: ${CLUSTER_NAME}-control-plane - files: - - path: /var/lib/rancher/rke2/server/manifests/ccm-linode.yaml - owner: root:root - content: |- - apiVersion: helm.cattle.io/v1 - kind: HelmChart - metadata: - namespace: kube-system - name: ccm-linode - spec: - targetNamespace: kube-system - version: ${LINODE_CCM_VERSION:=v0.4.4} - chart: ccm-linode - repo: https://linode.github.io/linode-cloud-controller-manager/ - bootstrap: true - valuesContent: |- - routeController: - vpcName: ${VPC_NAME:=${CLUSTER_NAME}} - clusterCIDR: 10.0.0.0/8 - configureCloudRoutes: true - secretRef: - name: "linode-token-region" - nodeSelector: - node-role.kubernetes.io/control-plane: "true" - - contentFrom: - secret: - key: linode-token-region.yaml - name: linode-${CLUSTER_NAME}-crs-0 - owner: root:root - path: /var/lib/rancher/rke2/server/manifests/linode-token-region.yaml registrationMethod: internal-only-ips serverConfig: cni: none diff --git a/templates/flavors/rke2/default/secret.yaml b/templates/flavors/rke2/default/secret.yaml deleted file mode 100644 index 04b685e1f..000000000 --- a/templates/flavors/rke2/default/secret.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -apiVersion: v1 -kind: Secret -metadata: - labels: - clusterctl.cluster.x-k8s.io/move: "true" - name: linode-${CLUSTER_NAME}-crs-0 -stringData: - linode-token-region.yaml: |- - kind: Secret - apiVersion: v1 - metadata: - name: linode-token-region - namespace: kube-system - stringData: - apiToken: ${LINODE_TOKEN} - region: ${LINODE_REGION}