Skip to content

Commit 1e1ffe3

Browse files
committed
Improve envFrom
1 parent 2c3d649 commit 1e1ffe3

File tree

5 files changed

+65
-4
lines changed

5 files changed

+65
-4
lines changed

charts/guacamole/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type: application
1919
# This is the chart version. This version number should be incremented each time you make changes
2020
# to the chart and its templates, including the app version.
2121
# Versions are expected to follow Semantic Versioning (https://semver.org/)
22-
version: 0.3.0
22+
version: 0.3.1
2323

2424
# This is the version number of the application being deployed. This version number should be
2525
# incremented each time you make changes to the application. Versions are not expected to

charts/guacamole/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Apache Guacamole Helm Chart
22

3-
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.6.0](https://img.shields.io/badge/AppVersion-1.6.0-informational?style=flat-square)
3+
![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.6.0](https://img.shields.io/badge/AppVersion-1.6.0-informational?style=flat-square)
44

55
A Helm chart for deploying Apache Guacamole, a clientless remote desktop gateway that supports standard protocols like VNC, RDP and SSH.
66

@@ -407,6 +407,28 @@ volumes:
407407
claimName: guacamole-recordings
408408
```
409409

410+
### Environment Variables from ConfigMaps and Secrets
411+
412+
Both the client and guacd deployments support loading environment variables from ConfigMaps and Secrets using `envFrom`. This is useful for managing configuration externally or integrating with secret management systems.
413+
414+
```yaml
415+
client:
416+
envFrom:
417+
configMap: "guacamole-client-config"
418+
secret: "guacamole-client-secrets"
419+
extraEnv:
420+
- name: ADDITIONAL_VAR
421+
value: "additional-value"
422+
423+
guacd:
424+
envFrom:
425+
configMap: "guacd-config"
426+
secret: "guacd-secrets"
427+
extraEnv:
428+
- name: CUSTOM_GUACD_VAR
429+
value: "custom-value"
430+
```
431+
410432
### Custom Extensions
411433

412434
```yaml
@@ -514,13 +536,19 @@ kubectl exec -it deployment/my-guacamole-client -- nc -zv postgres.default.svc.c
514536
| client.image.pullPolicy | string | `"IfNotPresent"` | Client image pull policy |
515537
| client.service.type | string | `"ClusterIP"` | Client service type |
516538
| client.service.port | int | `8080` | Client service port |
539+
| client.envFrom.configMap | string | `""` | ConfigMap name for client environment variables |
540+
| client.envFrom.secret | string | `""` | Secret name for client environment variables |
541+
| client.extraEnv | list | `[]` | Additional environment variables for client |
517542
| client.initContainers | list | `[]` | Init containers for the client pod |
518543
| client.auth.postgresql.enabled | bool | `false` | Enable PostgreSQL authentication |
519544
| client.auth.mysql.enabled | bool | `false` | Enable MySQL authentication |
520545
| client.auth.ldap.enabled | bool | `false` | Enable LDAP authentication |
521546
| guacd.replicaCount | int | `1` | Number of guacd replicas |
522547
| guacd.image.repository | string | `"guacamole/guacd"` | Guacd container image repository |
523548
| guacd.service.port | int | `4822` | Guacd service port |
549+
| guacd.envFrom.configMap | string | `""` | ConfigMap name for guacd environment variables |
550+
| guacd.envFrom.secret | string | `""` | Secret name for guacd environment variables |
551+
| guacd.extraEnv | list | `[]` | Additional environment variables for guacd |
524552
| guacd.initContainers | list | `[]` | Init containers for the guacd pod |
525553
| ingress.enabled | bool | `false` | Enable ingress |
526554
| httpRoute.enabled | bool | `false` | Enable Gateway API HTTPRoute |

charts/guacamole/templates/client-deployment.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ spec:
5151
- name: http
5252
containerPort: {{ .Values.client.service.port }}
5353
protocol: TCP
54+
{{- if or .Values.client.envFrom.configMap .Values.client.envFrom.secret }}
5455
envFrom:
56+
{{- with .Values.client.envFrom.configMap }}
5557
- configMapRef:
56-
name: {{ .Values.client.envFrom.configMap }}
58+
name: {{ . }}
59+
{{- end }}
60+
{{- with .Values.client.envFrom.secret }}
5761
- secretRef:
58-
name: {{ .Values.client.envFrom.secret }}
62+
name: {{ . }}
63+
{{- end }}
64+
{{- end }}
5965
env:
6066
- name: GUACD_HOSTNAME
6167
value: {{ include "guacamole.fullname" . }}-guacd

charts/guacamole/templates/guacd-deployment.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ spec:
5151
- name: guacd
5252
containerPort: {{ .Values.guacd.service.port }}
5353
protocol: TCP
54+
{{- if or .Values.guacd.envFrom.configMap .Values.guacd.envFrom.secret }}
55+
envFrom:
56+
{{- with .Values.guacd.envFrom.configMap }}
57+
- configMapRef:
58+
name: {{ . }}
59+
{{- end }}
60+
{{- with .Values.guacd.envFrom.secret }}
61+
- secretRef:
62+
name: {{ . }}
63+
{{- end }}
64+
{{- end }}
5465
{{- if or .Values.guacd.logLevel .Values.guacd.extraEnv }}
5566
env:
5667
{{- with .Values.guacd.logLevel }}

charts/guacamole/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,14 @@ client:
406406
# QUICKCONNECT_DENIED_PARAMETERS: Comma-separated list of denied connection parameters
407407
deniedParameters: ""
408408

409+
# Environment variables from ConfigMaps and Secrets
410+
# Used to load environment variables from external ConfigMaps and Secrets
411+
envFrom:
412+
# Name of ConfigMap containing environment variables
413+
configMap: ""
414+
# Name of Secret containing environment variables
415+
secret: ""
416+
409417
# Additional environment variables for the client container
410418
# Use this to set custom environment variables not covered by the auth sections above
411419
extraEnv: []
@@ -605,6 +613,14 @@ guacd:
605613
# More information: https://guacamole.apache.org/doc/gug/configuring-guacamole.html#guacd-logging
606614
logLevel: ""
607615

616+
# Environment variables from ConfigMaps and Secrets
617+
# Used to load environment variables from external ConfigMaps and Secrets
618+
envFrom:
619+
# Name of ConfigMap containing environment variables
620+
configMap: ""
621+
# Name of Secret containing environment variables
622+
secret: ""
623+
608624
# Additional environment variables for guacd
609625
# Useful for custom configuration or third-party extensions
610626
# Example:

0 commit comments

Comments
 (0)