Skip to content

Commit

Permalink
allow setting additional annotations on the vsphere cluster object (#279
Browse files Browse the repository at this point in the history
)

* allow setting additional annotations on the vsphere cluster object

* typo

* sort

* sort changelog

* make the name clearer

* remove default annotation
  • Loading branch information
anvddriesch authored Aug 29, 2024
1 parent bec680a commit 1ee6384
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Allow adding custom annotations to the infrastructure cluster resource using `providerSpecific.additionalVsphereClusterAnnotations` value.

## [0.61.0] - 2024-08-23

> [!WARNING]
Expand Down
4 changes: 3 additions & 1 deletion helm/cluster-vsphere/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ Properties within the `.global.providerSpecific` object

| **Property** | **Description** | **More Details** |
| :----------- | :-------------- | :--------------- |
| `global.providerSpecific.additionalVsphereClusterAnnotations` | **Additional vsphere cluster annotations** - Additional annotations to be added to the vspherecluster custom resource.|**Type:** `object`<br/>**Default:** `{}`|
| `global.providerSpecific.additionalVsphereClusterAnnotations.*` | **Annotation value** - Value of the annotation|**Type:** `string`<br/>|
| `global.providerSpecific.defaultStorageClass` | **Default Storage Class** - Configuration of the default storage class.|**Type:** `object`<br/>|
| `global.providerSpecific.defaultStorageClass.enabled` | **Enable default storage class** - Creates a default storage class if set to true.|**Type:** `boolean`<br/>**Default:** `true`|
| `global.providerSpecific.defaultStorageClass.reclaimPolicy` | **Reclaim Policy** - Reclaim policy of the storage class (Delete or Retain).|**Type:** `string`<br/>**Default:** `"Delete"`|
Expand All @@ -171,4 +173,4 @@ Properties within the `.global.providerSpecific` object



<!-- DOCS_END -->
<!-- DOCS_END -->
7 changes: 7 additions & 0 deletions helm/cluster-vsphere/templates/_additional_annotations.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- define "additional-annotations" -}}
{{- $tags := .Values.global.providerSpecific.additionalVsphereClusterAnnotations | default dict }}
annotations:
{{- if $tags }}
{{- toYaml $tags | nindent 2 }}
{{- end -}}
{{- end -}}
3 changes: 3 additions & 0 deletions helm/cluster-vsphere/templates/vspherecluster.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apiVersion: {{ include "infrastructureApiVersion" . }}
kind: VSphereCluster
metadata:
{{- if .Values.global.providerSpecific.additionalVsphereClusterAnnotations -}}
{{- include "additional-annotations" . | indent 2}}
{{- end }}
name: {{ include "resource.default.name" $ }}
namespace: {{ .Release.Namespace }}
labels:
Expand Down
19 changes: 19 additions & 0 deletions helm/cluster-vsphere/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,25 @@
"type": "object",
"title": "Provider specific configuration",
"properties": {
"additionalVsphereClusterAnnotations": {
"type": "object",
"title": "Additional vsphere cluster annotations",
"description": "Additional annotations to be added to the vspherecluster custom resource.",
"additionalProperties": {
"type": "string",
"title": "Annotation value",
"description": "Value of the annotation",
"maxLength": 256
},
"default": {},
"propertyNames": {
"type": "string",
"title": "Annotation name",
"description": "Name of the annotation",
"maxLength": 128,
"pattern": "^[^<>%&?/\\\\]*$"
}
},
"defaultStorageClass": {
"type": "object",
"title": "Default Storage Class",
Expand Down
1 change: 1 addition & 0 deletions helm/cluster-vsphere/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ global:
podSecurityStandards:
enforced: true
providerSpecific:
additionalVsphereClusterAnnotations: {}
defaultStorageClass:
enabled: true
reclaimPolicy: Delete
Expand Down

0 comments on commit 1ee6384

Please sign in to comment.