diff --git a/CHANGELOG.md b/CHANGELOG.md index d587c8fa..a7a074ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add `global.providerSpecific.additionalNodeTags`. Field used to specify tags applied to nodes only. + ### Fixed - Only try to render subnet tags if they are defined by the user. diff --git a/helm/cluster-aws/README.md b/helm/cluster-aws/README.md index 58f4e0a6..88956188 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 18833689..84c9dd6d 100644 --- a/helm/cluster-aws/templates/_control_plane.tpl +++ b/helm/cluster-aws/templates/_control_plane.tpl @@ -5,6 +5,9 @@ Any changes to this will trigger the resource to be recreated rather than attemp */}} {{- define "controlplane-awsmachinetemplate-spec" -}} {{- include "ami" $ }} +{{- if $.Values.global.providerSpecific.additionalNodeTags }} +additionalTags: {{ 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 dd7b3e38..d5aee1a5 100644 --- a/helm/cluster-aws/templates/_machine_pools.tpl +++ b/helm/cluster-aws/templates/_machine_pools.tpl @@ -13,6 +13,9 @@ 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 b09dfc43..b7f61843 100644 --- a/helm/cluster-aws/values.schema.json +++ b/helm/cluster-aws/values.schema.json @@ -1714,6 +1714,14 @@ "title": "AWS settings", "additionalProperties": false, "properties": { + "additionalNodeTags": { + "type": "object", + "title": "Additional node tags", + "description": "Additional tags to add to AWS nodes created by the cluster.", + "additionalProperties": { + "$ref": "#/$defs/awsResourceTagValue" + } + }, "additionalResourceTags": { "type": "object", "title": "Additional resource tags",