diff --git a/charts/wg-access-server/Chart.yaml b/charts/wg-access-server/Chart.yaml index 85d906a..e208759 100644 --- a/charts/wg-access-server/Chart.yaml +++ b/charts/wg-access-server/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 appVersion: v0.8.0 description: A Wireguard VPN Access Server name: wg-access-server -version: 0.9.7 +version: 0.9.8 diff --git a/charts/wg-access-server/README.md b/charts/wg-access-server/README.md index fe8f711..04ff8da 100644 --- a/charts/wg-access-server/README.md +++ b/charts/wg-access-server/README.md @@ -84,6 +84,10 @@ ingress: | wireguard.service.loadBalancerIP | string | `""` | | | wireguard.service.port | int | `51820` | | | wireguard.service.nodePort | int | `""` | Use available port from range 30000-32768 | +| storage.enabled | bool | `false` | | +| storage.uri | string | `""` | A storage backend connection string | +| storage.existingSecret | string | `""` | Use existing storage secret | +| storage.secretRefKeys.uri | string | `"storageUri"` | Secret key name containing storage uri | | persistence.enabled | bool | `false` | | | persistence.existingClaim | string | `""` | Use existing PVC claim for persistence instead | | persistence.annotations | object | `{}` | | @@ -106,4 +110,4 @@ ingress: | resources | object | `{}` | pod cpu/memory resource requests and limits | | nodeSelector | object | `{}` | | | tolerations | list | `[]` | | -| affinity | object | `{}` | | \ No newline at end of file +| affinity | object | `{}` | | diff --git a/charts/wg-access-server/templates/_helpers.tpl b/charts/wg-access-server/templates/_helpers.tpl index 0e8ad61..d5dfd25 100644 --- a/charts/wg-access-server/templates/_helpers.tpl +++ b/charts/wg-access-server/templates/_helpers.tpl @@ -83,9 +83,9 @@ Create a randomly generated admin password if none is supplied {{/* Return PostgreSQL Connection Secret Name */}} -{{- define "wg-access-server.postgresqlConnectionSecretName" -}} -{{- if .Values.postgresql.existingSecret -}} - {{- .Values.postgresql.existingSecret -}} +{{- define "wg-access-server.storageConnectionSecretName" -}} +{{- if .Values.storage.existingSecret -}} + {{- .Values.storage.existingSecret -}} {{- else -}} {{- include "wg-access-server.fullname" . -}} {{- end -}} diff --git a/charts/wg-access-server/templates/deployment.yaml b/charts/wg-access-server/templates/deployment.yaml index 3279385..675ac70 100644 --- a/charts/wg-access-server/templates/deployment.yaml +++ b/charts/wg-access-server/templates/deployment.yaml @@ -83,11 +83,11 @@ spec: key: {{ .Values.web.config.secretRefKeys.adminPassword }} {{- end }} - name: WG_STORAGE - {{- if .Values.postgresql.enabled }} + {{- if .Values.storage.enabled }} valueFrom: secretKeyRef: - name: {{ include "wg-access-server.postgresqlConnectionSecretName" . | quote }} - key: {{ .Values.postgresql.secretRefKeys.uri }} + name: {{ include "wg-access-server.storageConnectionSecretName" . | quote }} + key: {{ .Values.storage.secretRefKeys.uri }} {{- else}} value: "sqlite3:///data/db.sqlite3" {{- end }} @@ -96,7 +96,7 @@ spec: volumeMounts: - name: tun mountPath: /dev/net/tun - {{- if not .Values.postgresql.enabled }} + {{- if not .Values.storage.enabled }} - name: data mountPath: /data {{- end }} @@ -117,7 +117,7 @@ spec: hostPath: type: 'CharDevice' path: /dev/net/tun - {{- if not .Values.postgresql.enabled }} + {{- if not .Values.storage.enabled }} - name: data {{- if .Values.persistence.enabled }} persistentVolumeClaim: diff --git a/charts/wg-access-server/templates/secret.yaml b/charts/wg-access-server/templates/secret.yaml index 4ede38b..e0836be 100644 --- a/charts/wg-access-server/templates/secret.yaml +++ b/charts/wg-access-server/templates/secret.yaml @@ -16,8 +16,8 @@ data: {{- end }} {{ .Values.web.config.secretRefKeys.adminPassword }}: {{ (include "wg-access-server.adminPassword" .) | b64enc | quote }} {{- end }} - {{- if and .Values.postgresql.uri (not .Values.postgresql.existingSecret) }} - {{ .Values.postgresql.secretRefKeys.uri }}: {{ .Values.postgresql.uri | b64enc | quote }} + {{- if and .Values.storage.uri (not .Values.storage.existingSecret) }} + {{ .Values.storage.secretRefKeys.uri }}: {{ .Values.storage.uri | b64enc | quote }} {{- end }} {{- if and .Values.secretConfig.config (not .Values.secretConfig.existingSecret) }} {{ .Values.secretConfig.secretRefKeys.config }}: {{ toYaml .Values.secretConfig.config | b64enc | quote }} diff --git a/charts/wg-access-server/values.yaml b/charts/wg-access-server/values.yaml index e74f69a..b656d34 100644 --- a/charts/wg-access-server/values.yaml +++ b/charts/wg-access-server/values.yaml @@ -45,12 +45,12 @@ wireguard: port: 51820 nodePort: "" -postgresql: +storage: enabled: false uri: "" # existingSecret: "" secretRefKeys: - uri: "postgresqlUri" + uri: "storageUri" persistence: enabled: false