-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from directus-labs/secrets-in-secrets
Secrets in k8s secrets
- Loading branch information
Showing
6 changed files
with
98 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/) | ||
|
||
## [1.0.0] - 2024-07-31 | ||
|
||
**Breaking change** | ||
|
||
Reworked environment variable setting and injection. | ||
|
||
### Added | ||
|
||
- Move sensetive values to the `secret` k8s resource | ||
- Move not-sensetive variables to the `configmap` k8s resource | ||
- Inject variables from `configmap` and `secrets` to the application pods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "directus.fullname" . }}-configmap | ||
labels: | ||
app.kubernetes.io/name: {{ include "directus.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
helm.sh/chart: {{ include "directus.chart" . }} | ||
data: | ||
DB_CLIENT: "mysql" | ||
DB_HOST: {{- if .Values.mariadb.mariadbURL }} "{{ .Values.mariadb.mariadbURL }}" {{- else }} "{{ .Release.Name }}-mariadb.{{ .Release.Namespace }}.svc.cluster.local" {{- end }} | ||
DB_PORT: "3306" | ||
DB_DATABASE: "{{ .Values.mariadb.auth.database }}" | ||
DB_USER: "{{ .Values.mariadb.auth.username }}" | ||
ADMIN_EMAIL: "{{ .Values.adminEmail }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if .Values.mariadb.auth.createSecrets }} | ||
{{- $dbPassword := randAlphaNum 10 | nospace -}} | ||
{{- $adminPassword := randAlphaNum 10 | nospace -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ .Values.mariadb.auth.existingSecret }} | ||
labels: | ||
app.kubernetes.io/name: {{ include "directus.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
helm.sh/chart: {{ include "directus.chart" . }} | ||
annotations: | ||
helm.sh/resource-policy: keep | ||
helm.sh/hook: "pre-install" | ||
helm.sh/hook-delete-policy: "before-hook-creation" | ||
type: Opaque | ||
data: | ||
ADMIN_PASSWORD: {{ $adminPassword | b64enc | quote }} | ||
SECRET: {{ randAlphaNum 10 | b64enc | quote }} | ||
KEY: {{ randAlphaNum 10 | b64enc | quote }} | ||
mariadb-root-password: {{ randAlphaNum 10 | b64enc | quote }} | ||
mariadb-password: {{ $dbPassword | b64enc | quote }} | ||
mariadb-replication-password: {{ randAlphaNum 10 | b64enc | quote }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters