mirror of
https://gitlab.opencode.de/bmi/opendesk/deployment/opendesk.git
synced 2025-12-08 00:11:38 +01:00
Compare commits
1 Commits
weber/upda
...
lender/fea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7681fb545 |
42
docs/external-secrets.md
Normal file
42
docs/external-secrets.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!--
|
||||||
|
SPDX-FileCopyrightText: 2025 Zentrum für Digitale Souveränität der Öffentlichen Verwaltung (ZenDiS) GmbH
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
-->
|
||||||
|
|
||||||
|
<h1>External Secrets</h1>
|
||||||
|
|
||||||
|
This document covers how to utilise external secrets and special requirements.
|
||||||
|
|
||||||
|
<!-- TOC -->
|
||||||
|
* [General](#general)
|
||||||
|
* [Components](#components)
|
||||||
|
* [Cassandra](#cassandra)
|
||||||
|
<!-- TOC -->
|
||||||
|
|
||||||
|
# General
|
||||||
|
|
||||||
|
For most components when set the external secret will supersede e.g. a password in a `values.yaml` file.
|
||||||
|
|
||||||
|
The file [`external_secrets.yaml`](/helmfile/environments/default/external_secrets.yaml.gotmpl) lists all possible references to external secrets that are currently implemented in openDesk.
|
||||||
|
|
||||||
|
# Components
|
||||||
|
|
||||||
|
This section covers information and special requirements to external secrets that some Helm Charts expect.
|
||||||
|
|
||||||
|
## Cassandra
|
||||||
|
|
||||||
|
Cassandra is pre-populated with information regarding Dovecot with a `cql` script. The openDesk default `initDB` setting is configured as follows:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
initUserData.cql: >
|
||||||
|
CREATE KEYSPACE IF NOT EXISTS {{ .Values.databases.dovecotDictmap.name | quote }} WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
|
||||||
|
CREATE ROLE IF NOT EXISTS {{ .Values.databases.dovecotDictmap.username | quote }};
|
||||||
|
ALTER ROLE {{ .Values.databases.dovecotDictmap.username | quote }} WITH PASSWORD = {{ regexReplaceAll "'" .Values.secrets.cassandra.dovecotDictmapUser "''" | squote }} AND LOGIN = true;
|
||||||
|
GRANT ALL ON KEYSPACE {{ .Values.databases.dovecotDictmap.name | quote }} TO {{ .Values.databases.dovecotDictmap.username | quote }};
|
||||||
|
CREATE KEYSPACE IF NOT EXISTS {{ .Values.databases.dovecotACL.name | quote }} WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
|
||||||
|
CREATE ROLE IF NOT EXISTS {{ .Values.databases.dovecotACL.username | quote }};
|
||||||
|
ALTER ROLE {{ .Values.databases.dovecotACL.username | quote }} WITH PASSWORD = {{ regexReplaceAll "'" .Values.secrets.cassandra.dovecotACLUser "''" | squote }} AND LOGIN = true;
|
||||||
|
GRANT ALL ON KEYSPACE {{ .Values.databases.dovecotACL.name | quote }} TO {{ .Values.databases.dovecotACL.username | quote }};
|
||||||
|
```
|
||||||
|
|
||||||
|
This has to be adapted into a secret that also holds a `cql` script and is named in `initDBSecret`.
|
||||||
@@ -22,7 +22,10 @@ containerSecurityContext:
|
|||||||
dbUser:
|
dbUser:
|
||||||
user: "root"
|
user: "root"
|
||||||
password: {{ .Values.secrets.cassandra.rootPassword | quote }}
|
password: {{ .Values.secrets.cassandra.rootPassword | quote }}
|
||||||
|
existingSecret:
|
||||||
|
name: {{ .Values.externalSecrets.cassandra.existingSecret.name | quote }}
|
||||||
|
keyMapping:
|
||||||
|
cassandra-password: {{ .Values.externalSecrets.cassandra.existingSecret.passwordKey | quote }}
|
||||||
global:
|
global:
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{ .Values.global.imagePullSecrets | toYaml | nindent 4 }}
|
{{ .Values.global.imagePullSecrets | toYaml | nindent 4 }}
|
||||||
@@ -48,6 +51,8 @@ initDB:
|
|||||||
ALTER ROLE {{ .Values.databases.dovecotACL.username | quote }} WITH PASSWORD = {{ regexReplaceAll "'" .Values.secrets.cassandra.dovecotACLUser "''" | squote }} AND LOGIN = true;
|
ALTER ROLE {{ .Values.databases.dovecotACL.username | quote }} WITH PASSWORD = {{ regexReplaceAll "'" .Values.secrets.cassandra.dovecotACLUser "''" | squote }} AND LOGIN = true;
|
||||||
GRANT ALL ON KEYSPACE {{ .Values.databases.dovecotACL.name | quote }} TO {{ .Values.databases.dovecotACL.username | quote }};
|
GRANT ALL ON KEYSPACE {{ .Values.databases.dovecotACL.name | quote }} TO {{ .Values.databases.dovecotACL.username | quote }};
|
||||||
|
|
||||||
|
initDBSecret: {{ .Values.externalSecrets.cassandra.initDBSecret | quote }}
|
||||||
|
|
||||||
# Will print a warning if unset but is automatically calculated:
|
# Will print a warning if unset but is automatically calculated:
|
||||||
jvm:
|
jvm:
|
||||||
maxHeapSize: ""
|
maxHeapSize: ""
|
||||||
|
|||||||
12
helmfile/environments/default/external_secrets.yaml.gotmpl
Normal file
12
helmfile/environments/default/external_secrets.yaml.gotmpl
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{{/*
|
||||||
|
SPDX-FileCopyrightText: 2025 Zentrum für Digitale Souveränität der Öffentlichen Verwaltung (ZenDiS) GmbH
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/}}
|
||||||
|
---
|
||||||
|
externalSecrets:
|
||||||
|
cassandra:
|
||||||
|
initDBSecret: ~
|
||||||
|
existingSecret:
|
||||||
|
name: ~
|
||||||
|
passwordKey: ~
|
||||||
|
...
|
||||||
Reference in New Issue
Block a user