Skip to content

Commit

Permalink
Rename value postgres to storage (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
elcomtik authored Sep 8, 2022
1 parent fe4e9bf commit 06fcdb6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/wg-access-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion charts/wg-access-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` | |
Expand All @@ -106,4 +110,4 @@ ingress:
| resources | object | `{}` | pod cpu/memory resource requests and limits |
| nodeSelector | object | `{}` | |
| tolerations | list | `[]` | |
| affinity | object | `{}` | |
| affinity | object | `{}` | |
6 changes: 3 additions & 3 deletions charts/wg-access-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
10 changes: 5 additions & 5 deletions charts/wg-access-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions charts/wg-access-server/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/wg-access-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ wireguard:
port: 51820
nodePort: ""

postgresql:
storage:
enabled: false
uri: ""
# existingSecret: ""
secretRefKeys:
uri: "postgresqlUri"
uri: "storageUri"

persistence:
enabled: false
Expand Down

0 comments on commit 06fcdb6

Please sign in to comment.