From 4397a8dd249587ac0a6a7e79524adf2313876148 Mon Sep 17 00:00:00 2001 From: Kyle Wuolle Date: Wed, 18 Dec 2024 09:16:32 -0800 Subject: [PATCH] Updated the aws hosted template so that users can specify the management cluster name which is required for networking to work with AWS. Also switched to using the forked version of the AWS cloud provider helm chart so we can support this. --- .../templates/k0smotroncontrolplane.yaml | 12 ++++++++---- templates/cluster/aws-hosted-cp/values.schema.json | 4 ++++ templates/cluster/aws-hosted-cp/values.yaml | 5 ++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/templates/cluster/aws-hosted-cp/templates/k0smotroncontrolplane.yaml b/templates/cluster/aws-hosted-cp/templates/k0smotroncontrolplane.yaml index 3460717d1..7f19f1ea9 100644 --- a/templates/cluster/aws-hosted-cp/templates/k0smotroncontrolplane.yaml +++ b/templates/cluster/aws-hosted-cp/templates/k0smotroncontrolplane.yaml @@ -26,11 +26,11 @@ spec: extensions: helm: repositories: - - name: aws-cloud-controller-manager + - name: mirantis {{- if .Values.extensions.chartRepository }} url: {{ .Values.extensions.chartRepository }} {{- else }} - url: https://kubernetes.github.io/cloud-provider-aws + url: https://charts.mirantis.com {{- end }} - name: aws-ebs-csi-driver {{- if .Values.extensions.chartRepository }} @@ -41,8 +41,8 @@ spec: charts: - name: aws-cloud-controller-manager namespace: kube-system - chartname: aws-cloud-controller-manager/aws-cloud-controller-manager - version: "0.0.8" + chartname: mirantis/aws-cloud-controller-manager + version: "0.0.9" values: | image: {{- if .Values.extensions.imageRepository }} @@ -55,6 +55,10 @@ spec: - --cluster-cidr={{ first .Values.clusterNetwork.pods.cidrBlocks }} - --allocate-node-cidrs=true - --cluster-name={{ include "cluster.name" . }} + cloudConfig: + enabled: {{ ne .Values.managementClusterName "" }} + global: + KubernetesClusterID: {{ .Values.managementClusterName }} # Removing the default `node-role.kubernetes.io/control-plane` node selector # TODO: it does not work nodeSelector: diff --git a/templates/cluster/aws-hosted-cp/values.schema.json b/templates/cluster/aws-hosted-cp/values.schema.json index 4a1786d9f..74a6a427e 100644 --- a/templates/cluster/aws-hosted-cp/values.schema.json +++ b/templates/cluster/aws-hosted-cp/values.schema.json @@ -13,6 +13,10 @@ "clusterIdentity" ], "properties": { + "managementClusterName" : { + "description": "The name of the management cluster that this template is being deployed on", + "type": "string" + }, "workersNumber": { "description": "The number of the worker machines", "type": "integer", diff --git a/templates/cluster/aws-hosted-cp/values.yaml b/templates/cluster/aws-hosted-cp/values.yaml index c018fe1fd..c147402cc 100644 --- a/templates/cluster/aws-hosted-cp/values.yaml +++ b/templates/cluster/aws-hosted-cp/values.yaml @@ -52,4 +52,7 @@ k0s: # k0s extensions. extensions: chartRepository: "" - imageRepository: "" \ No newline at end of file + imageRepository: "" + +# Name of the management cluster that this template is being deployed on +managementClusterName: "" \ No newline at end of file