From 1c39ebe8bf535e225005cb3048a5f33f957f74ed Mon Sep 17 00:00:00 2001 From: Pau Rosello Date: Fri, 8 Nov 2024 14:57:11 +0100 Subject: [PATCH] add nodetags --- helm/cluster-aws/README.md | 2 ++ helm/cluster-aws/templates/_control_plane.tpl | 2 ++ helm/cluster-aws/templates/_machine_pools.tpl | 1 + helm/cluster-aws/values.schema.json | 8 ++++++++ 4 files changed, 13 insertions(+) diff --git a/helm/cluster-aws/README.md b/helm/cluster-aws/README.md index cfefd4ae..970bbd6d 100644 --- a/helm/cluster-aws/README.md +++ b/helm/cluster-aws/README.md @@ -17,6 +17,8 @@ Properties within the `.global.providerSpecific` object | **Property** | **Description** | **More Details** | | :----------- | :-------------- | :--------------- | +| `global.providerSpecific.additionalNodeTags` | **Additional node tags** - Additional tags to add to AWS nodes created by the cluster.|**Type:** `object`
| +| `global.providerSpecific.additionalNodeTags.*` | **Tag value**|**Type:** `string`
**Value pattern:** `^[ a-zA-Z0-9\._:/=+-@]+$`
| | `global.providerSpecific.additionalResourceTags` | **Additional resource tags** - Additional tags to add to AWS resources created by the cluster.|**Type:** `object`
| | `global.providerSpecific.additionalResourceTags.*` | **Tag value**|**Type:** `string`
**Value pattern:** `^[ a-zA-Z0-9\._:/=+-@]+$`
| | `global.providerSpecific.ami` | **Amazon machine image (AMI)** - If specified, this image will be used to provision EC2 instances.|**Type:** `string`
| diff --git a/helm/cluster-aws/templates/_control_plane.tpl b/helm/cluster-aws/templates/_control_plane.tpl index f403c0b0..abbfa15f 100644 --- a/helm/cluster-aws/templates/_control_plane.tpl +++ b/helm/cluster-aws/templates/_control_plane.tpl @@ -5,6 +5,8 @@ Any changes to this will trigger the resource to be recreated rather than attemp */}} {{- define "controlplane-awsmachinetemplate-spec" -}} {{- include "ami" $ }} +additionalTags: + {{- if .Values.global.providerSpecific.additionalNodeTags -}}{{- toYaml .Values.global.providerSpecific.additionalNodeTags | nindent 2 }}{{- end}} cloudInit: {} instanceType: {{ .Values.global.controlPlane.instanceType }} nonRootVolumes: diff --git a/helm/cluster-aws/templates/_machine_pools.tpl b/helm/cluster-aws/templates/_machine_pools.tpl index 956e2f4c..bcc150b1 100644 --- a/helm/cluster-aws/templates/_machine_pools.tpl +++ b/helm/cluster-aws/templates/_machine_pools.tpl @@ -13,6 +13,7 @@ spec: additionalTags: k8s.io/cluster-autoscaler/enabled: "true" giantswarm.io/machinepool: {{ $name }} + {{- if .Values.global.providerSpecific.additionalNodeTags -}}{{- toYaml .Values.global.providerSpecific.additionalNodeTags | nindent 4 }}{{- end}} availabilityZones: {{ include "aws-availability-zones" (dict "mp" $value "Values" $.Values "Files" $.Files) | nindent 2 }} subnets: - filters: diff --git a/helm/cluster-aws/values.schema.json b/helm/cluster-aws/values.schema.json index 94fa9771..979b6f64 100644 --- a/helm/cluster-aws/values.schema.json +++ b/helm/cluster-aws/values.schema.json @@ -1626,6 +1626,14 @@ "$ref": "#/$defs/awsResourceTagValue" } }, + "additionalNodeTags": { + "type": "object", + "title": "Additional node tags", + "description": "Additional tags to add to AWS nodes created by the cluster.", + "additionalProperties": { + "$ref": "#/$defs/awsResourceTagValue" + } + }, "ami": { "type": "string", "title": "Amazon machine image (AMI)",