From ff6326d7beee72f5c2a6a16cda14830fb37dbbb5 Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 10 Jan 2025 11:28:42 -0800 Subject: [PATCH] Fix AWS hosted cluster template networking issue (#810) --- .../templates/k0smotroncontrolplane.yaml | 12 ++++++++---- templates/cluster/aws-hosted-cp/values.schema.json | 7 ++++++- templates/cluster/aws-hosted-cp/values.yaml | 5 ++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/templates/cluster/aws-hosted-cp/templates/k0smotroncontrolplane.yaml b/templates/cluster/aws-hosted-cp/templates/k0smotroncontrolplane.yaml index 3460717d1..222005e34 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: true + global: + KubernetesClusterID: {{ required ".Values.managementClusterName is required on AWS hosted deployment" .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..e892d7d6e 100644 --- a/templates/cluster/aws-hosted-cp/values.schema.json +++ b/templates/cluster/aws-hosted-cp/values.schema.json @@ -10,9 +10,14 @@ "iamInstanceProfile", "instanceType", "securityGroupIDs", - "clusterIdentity" + "clusterIdentity", + "managementClusterName" ], "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