Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion deployments/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ The following table lists the configurable parameters of the SMSGate chart and t
| `database.port` | Database port | `3306` |
| `database.user` | Database user | `sms` |
| `database.password` | Database password | `""` |
| `database.existingSecret` | Existing secret for database | `{}` |
| `database.existingSecret.secretName` | Existing secret name | `""` |
| `database.existingSecret.passwordKey` | Existing secret password key | `""` |
Comment thread
capcom6 marked this conversation as resolved.
| `database.name` | Database name | `sms` |
| `database.deployInternal` | Deploy internal MariaDB | `true` |
| `gateway.privateToken` | Private token for device registration | `""` |
Expand Down Expand Up @@ -154,4 +157,4 @@ This Helm chart is licensed under the Apache-2.0 license. See [LICENSE](LICENSE)

## Legal Notice

Android is a trademark of Google LLC.
Android is a trademark of Google LLC.
8 changes: 5 additions & 3 deletions deployments/helm-chart/templates/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ spec:
- name: MARIADB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "sms-gateway.fullname" . }}-db-secrets
key: database-password
name: {{ .Values.database.existingSecret.secretName | default (printf "%s-db-secrets" (include "sms-gateway.fullname" .)) }}
key: {{ .Values.database.existingSecret.passwordKey | default ("database-password") }}
ports:
- name: mysql
containerPort: 3306
Expand Down Expand Up @@ -92,7 +92,9 @@ metadata:
type: Opaque
data:
root-password: {{ .Values.database.mariadb.rootPassword | b64enc | quote }}
{{- if not .Values.database.existingSecret }}
database-password: {{ .Values.database.password | b64enc | quote }}
{{- end }}
Comment thread
capcom6 marked this conversation as resolved.

---
# Database Persistent Volume Claim
Expand All @@ -111,4 +113,4 @@ spec:
{{- if .Values.database.mariadb.persistence.storageClass }}
storageClassName: {{ .Values.database.mariadb.persistence.storageClass }}
{{- end }}
{{- end }}
{{- end }}
14 changes: 7 additions & 7 deletions deployments/helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ spec:
- name: DATABASE__HOST
value: {{ .Values.database.host }}
{{- end }}
- name: DATABASE__NAME
- name: DATABASE__DATABASE
value: {{ .Values.database.name }}
- name: DATABASE__USER
value: {{ .Values.database.user }}
- name: DATABASE__PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "sms-gateway.fullname" . }}-secrets
key: database-password
name: {{ .Values.database.existingSecret.secretName | default (printf "%s-secret" (include "sms-gateway.fullname" .)) }}
key: {{ .Values.database.existingSecret.passwordKey | default ("database-password") }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
{{- if .Values.gateway.privateToken }}
- name: GATEWAY__MODE
value: "private"
Expand Down Expand Up @@ -197,15 +197,15 @@ spec:
- name: DATABASE__HOST
value: {{ .Values.database.host }}
{{- end }}
- name: DATABASE__NAME
- name: DATABASE__DATABASE
value: {{ .Values.database.name }}
- name: DATABASE__USER
value: {{ .Values.database.user }}
- name: DATABASE__PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "sms-gateway.fullname" . }}-secrets
key: database-password
name: {{ .Values.database.existingSecret.secretName | default (printf "%s-secret" (include "sms-gateway.fullname" .)) }}
key: {{ .Values.database.existingSecret.passwordKey | default ("database-password") }}
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
Expand Down Expand Up @@ -237,4 +237,4 @@ spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion deployments/helm-chart/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ metadata:
{{- include "sms-gateway.labels" . | nindent 4 }}
type: Opaque
data:
{{- if not .Values.database.existingSecret }}
database-password: {{ .Values.database.password | b64enc | quote }}
{{- end }}
{{- if .Values.gateway.privateToken }}
private-token: {{ .Values.gateway.privateToken | b64enc | quote }}
{{- end }}
{{- if .Values.gateway.fcmCredentials }}
fcm-credentials: {{ .Values.gateway.fcmCredentials | b64enc | quote }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions deployments/helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ database:
user: sms
password: "" # REQUIRED: Set a strong password for the database user
name: sms
existingSecret: {}
# secretName: existing-secret-name
# passwordKey: password
# Set to true to deploy a MariaDB instance with the chart
deployInternal: true
mariadb:
Expand Down
Loading