Skip to content

Commit d0db258

Browse files
authored
feat(helm): add extraObjects support (#781)
* feat(helm): add extraObjects support for external secret management - Add extraObjects configuration field to values.yaml - Create templates/extra-objects.yaml to render additional manifests - Update README.md with usage examples for ExternalSecretOperator and SealedSecrets - Add automated tests in tests/extra_objects_test.yaml - Enable GitOps-friendly secret management by allowing injection of custom resources Signed-off-by: Ralf Dahmen <ralf.dahmen14@googlemail.com>
1 parent cae2e33 commit d0db258

4 files changed

Lines changed: 120 additions & 0 deletions

File tree

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,53 @@ For an example, review the values for Google's `cloud sql proxy` in the `values/
117117
helm install --repo https://go.temporal.io/helm-charts -f values/values.cloudsqlproxy.yaml temporal temporal --timeout 900s
118118
```
119119

120+
### Install with extraObjects for external secret management
121+
122+
You can inject additional Kubernetes manifests using the `extraObjects` configuration. This is particularly useful for GitOps scenarios where you want to manage secrets externally using tools like ExternalSecretOperator or SealedSecrets.
123+
124+
The `extraObjects` field accepts an array of raw YAML strings rendered alongside the Temporal chart. Each entry supports Go templating (e.g. `{{ .Release.Name }}`).
125+
126+
#### Example with ExternalSecretOperator
127+
128+
```yaml
129+
extraObjects:
130+
- |
131+
apiVersion: external-secrets.io/v1beta1
132+
kind: ExternalSecret
133+
metadata:
134+
name: {{ .Release.Name }}-db-secret
135+
spec:
136+
secretStoreRef:
137+
name: aws-secretsmanager
138+
kind: SecretStore
139+
target:
140+
name: {{ .Release.Name }}-db-secret
141+
creationPolicy: Owner
142+
data:
143+
- secretKey: password
144+
remoteRef:
145+
key: prod/temporal/db
146+
property: password
147+
```
148+
149+
150+
#### Example with SealedSecrets
151+
152+
```yaml
153+
extraObjects:
154+
- |
155+
apiVersion: bitnami.com/v1alpha1
156+
kind: SealedSecret
157+
metadata:
158+
name: {{ .Release.Name }}-db-secret
159+
spec:
160+
encryptedData:
161+
password: <encrypted-password>
162+
template:
163+
metadata:
164+
name: {{ .Release.Name }}-db-secret
165+
```
166+
120167
### Install with MySQL
121168

122169
To use a MySQL database, copy the [MySQL values file](values/values.mysql.yaml) locally and edit it with your database connection details:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{- range .Values.extraObjects }}
2+
---
3+
{{ tpl . $ }}
4+
{{- end }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
suite: test extra objects
2+
templates:
3+
- extra-objects.yaml
4+
tests:
5+
- it: does not render anything when extraObjects is empty
6+
asserts:
7+
- not: true
8+
containsDocument:
9+
kind: "*"
10+
- it: renders a ConfigMap from a string entry
11+
set:
12+
extraObjects:
13+
- |
14+
apiVersion: v1
15+
kind: ConfigMap
16+
metadata:
17+
name: test-config
18+
data:
19+
key: value
20+
asserts:
21+
- containsDocument:
22+
kind: ConfigMap
23+
apiVersion: v1
24+
- equal:
25+
path: metadata.name
26+
value: test-config
27+
- it: renders an ExternalSecret from a string entry
28+
set:
29+
extraObjects:
30+
- |
31+
apiVersion: external-secrets.io/v1beta1
32+
kind: ExternalSecret
33+
metadata:
34+
name: test-secret
35+
spec:
36+
secretStoreRef:
37+
name: test-store
38+
kind: SecretStore
39+
target:
40+
name: test-target
41+
data:
42+
- secretKey: password
43+
remoteRef:
44+
key: test/key
45+
property: password
46+
asserts:
47+
- containsDocument:
48+
kind: ExternalSecret
49+
apiVersion: external-secrets.io/v1beta1
50+
- equal:
51+
path: metadata.name
52+
value: test-secret
53+
- it: supports Go templating within entries
54+
set:
55+
extraObjects:
56+
- |
57+
apiVersion: v1
58+
kind: ConfigMap
59+
metadata:
60+
name: {{ .Release.Name }}-config
61+
asserts:
62+
- containsDocument:
63+
kind: ConfigMap
64+
apiVersion: v1
65+
- equal:
66+
path: metadata.name
67+
value: RELEASE-NAME-config

charts/temporal/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ serviceAccount:
1616
extraAnnotations:
1717
additionalAnnotations: {}
1818
additionalLabels: {}
19+
# Array of extra K8s manifests to deploy
20+
extraObjects: []
1921
server:
2022
enabled: true
2123
image:

0 commit comments

Comments
 (0)