From 2f2ae4d06348e2916f530b0f55fdba745e42b993 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Fri, 26 Apr 2024 15:15:57 -0400 Subject: [PATCH 1/5] Update infrastructure to v1beta2 because v1beta1 is not compatible with latest provider, set AMI base os from env. var (defaults to ubuntu-18.04 on the provider side as of today if env. var. is empty). Remove extra v. --- templates/cluster-template-aws.rc | 9 +++++++-- templates/cluster-template-aws.yaml | 16 ++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) mode change 100644 => 100755 templates/cluster-template-aws.rc diff --git a/templates/cluster-template-aws.rc b/templates/cluster-template-aws.rc old mode 100644 new mode 100755 index bcc024c..dc51997 --- a/templates/cluster-template-aws.rc +++ b/templates/cluster-template-aws.rc @@ -1,17 +1,22 @@ # Kubernetes cluster configuration -export KUBERNETES_VERSION=1.25.0 +export KUBERNETES_VERSION=1.27.0 export CONTROL_PLANE_MACHINE_COUNT=1 export WORKER_MACHINE_COUNT=1 # AWS region export AWS_REGION="eu-west-1" +# AWS image +# Use clusterawsadm ami list to verify there is a AMI that +# matches your desired base os and kubernetes version. +export AWS_IMAGE_LOOKUP_BASE_OS= + # AWS machine configuration export AWS_CREATE_BASTION=true export AWS_PUBLIC_IP=false export AWS_CONTROL_PLANE_MACHINE_FLAVOR=t3.large export AWS_NODE_MACHINE_FLAVOR=t3.large -export AWS_SSH_KEY_NAME=my-ssh-key +export AWS_SSH_KEY_NAME=microk8s # (optional) Snap risk level and confinement export SNAP_RISKLEVEL="stable" diff --git a/templates/cluster-template-aws.yaml b/templates/cluster-template-aws.yaml index f00facf..808942c 100644 --- a/templates/cluster-template-aws.yaml +++ b/templates/cluster-template-aws.yaml @@ -6,7 +6,7 @@ metadata: name: ${CLUSTER_NAME} spec: infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -14,13 +14,13 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSCluster metadata: name: ${CLUSTER_NAME} spec: region: ${AWS_REGION} - imageLookupBaseOS: ubuntu-20.04 + imageLookupBaseOS: ${AWS_IMAGE_LOOKUP_BASE_OS} sshKeyName: ${AWS_SSH_KEY_NAME} bastion: enabled: ${AWS_CREATE_BASTION:=false} @@ -43,14 +43,14 @@ spec: portCompatibilityRemap: true machineTemplate: infrastructureTemplate: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSMachineTemplate name: "${CLUSTER_NAME}-control-plane" replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1} - version: "v${KUBERNETES_VERSION}" + version: "${KUBERNETES_VERSION}" upgradeStrategy: "${UPGRADE_STRATEGY}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -82,10 +82,10 @@ spec: kind: MicroK8sConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1beta + apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 From 14ef2f2041a818062527c8c93e167c00929caae8 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Fri, 26 Apr 2024 15:19:55 -0400 Subject: [PATCH 2/5] Change ssh key name --- templates/cluster-template-aws.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cluster-template-aws.rc b/templates/cluster-template-aws.rc index dc51997..9ab98c0 100755 --- a/templates/cluster-template-aws.rc +++ b/templates/cluster-template-aws.rc @@ -16,7 +16,7 @@ export AWS_CREATE_BASTION=true export AWS_PUBLIC_IP=false export AWS_CONTROL_PLANE_MACHINE_FLAVOR=t3.large export AWS_NODE_MACHINE_FLAVOR=t3.large -export AWS_SSH_KEY_NAME=microk8s +export AWS_SSH_KEY_NAME=my-ssh-key # (optional) Snap risk level and confinement export SNAP_RISKLEVEL="stable" From 9ccf9d87fb9093f5ee5c5c9bc8540ea4495bf374 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Fri, 26 Apr 2024 15:21:42 -0400 Subject: [PATCH 3/5] Match k8s version. can be updated later --- templates/cluster-template-aws.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cluster-template-aws.rc b/templates/cluster-template-aws.rc index 9ab98c0..b937669 100755 --- a/templates/cluster-template-aws.rc +++ b/templates/cluster-template-aws.rc @@ -1,5 +1,5 @@ # Kubernetes cluster configuration -export KUBERNETES_VERSION=1.27.0 +export KUBERNETES_VERSION=1.25.0 export CONTROL_PLANE_MACHINE_COUNT=1 export WORKER_MACHINE_COUNT=1 From edf2f1f9bde20a45639fd82667c08e21f0adb995 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Fri, 26 Apr 2024 15:33:53 -0400 Subject: [PATCH 4/5] Revert v - it's needed there but not elsewhere --- templates/cluster-template-aws.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cluster-template-aws.yaml b/templates/cluster-template-aws.yaml index 808942c..645f6e2 100644 --- a/templates/cluster-template-aws.yaml +++ b/templates/cluster-template-aws.yaml @@ -47,7 +47,7 @@ spec: kind: AWSMachineTemplate name: "${CLUSTER_NAME}-control-plane" replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1} - version: "${KUBERNETES_VERSION}" + version: "v${KUBERNETES_VERSION}" upgradeStrategy: "${UPGRADE_STRATEGY}" --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 From 6c06ced3b1aa4296d7cef6482615f1b67f23894a Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 10 Jul 2024 17:00:17 -0400 Subject: [PATCH 5/5] revert unneeded --- templates/cluster-template-aws.rc | 5 ----- templates/cluster-template-aws.yaml | 1 - 2 files changed, 6 deletions(-) mode change 100755 => 100644 templates/cluster-template-aws.rc diff --git a/templates/cluster-template-aws.rc b/templates/cluster-template-aws.rc old mode 100755 new mode 100644 index b937669..bcc024c --- a/templates/cluster-template-aws.rc +++ b/templates/cluster-template-aws.rc @@ -6,11 +6,6 @@ export WORKER_MACHINE_COUNT=1 # AWS region export AWS_REGION="eu-west-1" -# AWS image -# Use clusterawsadm ami list to verify there is a AMI that -# matches your desired base os and kubernetes version. -export AWS_IMAGE_LOOKUP_BASE_OS= - # AWS machine configuration export AWS_CREATE_BASTION=true export AWS_PUBLIC_IP=false diff --git a/templates/cluster-template-aws.yaml b/templates/cluster-template-aws.yaml index 645f6e2..31afb6d 100644 --- a/templates/cluster-template-aws.yaml +++ b/templates/cluster-template-aws.yaml @@ -20,7 +20,6 @@ metadata: name: ${CLUSTER_NAME} spec: region: ${AWS_REGION} - imageLookupBaseOS: ${AWS_IMAGE_LOOKUP_BASE_OS} sshKeyName: ${AWS_SSH_KEY_NAME} bastion: enabled: ${AWS_CREATE_BASTION:=false}