ce7cb702218693d08ea6d83464d2457c9250027c
This commit is contained in:
commit
34c5f8963c
13 changed files with 145336 additions and 0 deletions
8
services/stalwart/k8s/base/account.yaml
Normal file
8
services/stalwart/k8s/base/account.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: stalwart
|
||||
namespace: stalwart
|
||||
automountServiceAccountToken: false
|
||||
imagePullSecrets:
|
||||
- name: quay-cluster-pull
|
||||
57
services/stalwart/k8s/base/app-passwords.json
Normal file
57
services/stalwart/k8s/base/app-passwords.json
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
[
|
||||
{
|
||||
"clientIdFile": "/run/control/notifier_client_id",
|
||||
"clientSecretFile": "/run/control/notifier_client_secret",
|
||||
"username": "********",
|
||||
"description": "zitadel-notification-v1",
|
||||
"vaultPath": "secret/data/stalwart/zitadel-notification",
|
||||
"vaultKey": "smtp_password",
|
||||
"permissions": {
|
||||
"@type": "Replace",
|
||||
"permissions": {
|
||||
"authenticate": true,
|
||||
"emailSend": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"clientIdFile": "/run/control/sender_client_id",
|
||||
"clientSecretFile": "/run/control/sender_client_secret",
|
||||
"username": "********",
|
||||
"description": "alert-submit-v1",
|
||||
"vaultPath": "secret/data/stalwart/alert-identity",
|
||||
"vaultKey": "smtp_password",
|
||||
"permissions": {
|
||||
"@type": "Replace",
|
||||
"permissions": {
|
||||
"authenticate": true,
|
||||
"emailSend": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"clientIdFile": "/run/control/test_client_id",
|
||||
"clientSecretFile": "/run/control/test_client_secret",
|
||||
"username": "********",
|
||||
"description": "test-mail-v1",
|
||||
"vaultPath": "secret/data/stalwart/test-client",
|
||||
"vaultKey": "password",
|
||||
"permissions": {
|
||||
"@type": "Replace",
|
||||
"permissions": {
|
||||
"authenticate": true,
|
||||
"emailReceive": true,
|
||||
"emailSend": true,
|
||||
"imapAuthenticate": true,
|
||||
"imapCapability": true,
|
||||
"imapExamine": true,
|
||||
"imapFetch": true,
|
||||
"imapIdle": true,
|
||||
"imapList": true,
|
||||
"imapSearch": true,
|
||||
"imapSelect": true,
|
||||
"imapStatus": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
8
services/stalwart/k8s/base/certificate.yaml
Normal file
8
services/stalwart/k8s/base/certificate.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: stalwart-tls
|
||||
namespace: stalwart
|
||||
annotations:
|
||||
reflector.v1.k8s.emberstack.com/reflects: kube-system/gateway-relay-tls
|
||||
type: kubernetes.io/tls
|
||||
13
services/stalwart/k8s/base/config.json
Normal file
13
services/stalwart/k8s/base/config.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"@type": "PostgreSql",
|
||||
"host": "main-rw.postgres.svc.cluster.local",
|
||||
"port": 5432,
|
||||
"database": "stalwart",
|
||||
"authUsername": "stalwart",
|
||||
"authSecret": {
|
||||
"@type": "EnvironmentVariable",
|
||||
"variableName": "STALWART_DB_PASSWORD"
|
||||
},
|
||||
"useTls": false,
|
||||
"allowInvalidCerts": false
|
||||
}
|
||||
22
services/stalwart/k8s/base/kustomization.yaml
Normal file
22
services/stalwart/k8s/base/kustomization.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- account.yaml
|
||||
- certificate.yaml
|
||||
- vault/auth.yaml
|
||||
- vault/quay-pull.yaml
|
||||
- vault/database.yaml
|
||||
- vault/delivery.yaml
|
||||
- vault/identity.yaml
|
||||
- vault/runtime.yaml
|
||||
configMapGenerator:
|
||||
- name: startup
|
||||
namespace: stalwart
|
||||
files:
|
||||
- config.json
|
||||
- name: desired
|
||||
namespace: stalwart
|
||||
files:
|
||||
- app-passwords.json
|
||||
- plan.json
|
||||
7
services/stalwart/k8s/base/namespace.yaml
Normal file
7
services/stalwart/k8s/base/namespace.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: stalwart
|
||||
labels:
|
||||
gateway.quorate.internal/allow-internal: "true"
|
||||
security.quorate.internal/public-runtime: gvisor
|
||||
2486
services/stalwart/k8s/base/plan.json
Normal file
2486
services/stalwart/k8s/base/plan.json
Normal file
File diff suppressed because it is too large
Load diff
12
services/stalwart/k8s/base/vault/auth.yaml
Normal file
12
services/stalwart/k8s/base/vault/auth.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultAuth
|
||||
metadata:
|
||||
name: default
|
||||
namespace: stalwart
|
||||
spec:
|
||||
method: kubernetes
|
||||
mount: kubernetes
|
||||
kubernetes:
|
||||
role: stalwart
|
||||
serviceAccount: stalwart
|
||||
vaultConnectionRef: vault/vault
|
||||
26
services/stalwart/k8s/base/vault/database.yaml
Normal file
26
services/stalwart/k8s/base/vault/database.yaml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultDynamicSecret
|
||||
metadata:
|
||||
name: stalwart-db
|
||||
namespace: stalwart
|
||||
spec:
|
||||
mount: database
|
||||
path: static-creds/stalwart
|
||||
allowStaticCreds: true
|
||||
refreshAfter: 5m
|
||||
destination:
|
||||
name: stalwart-db
|
||||
create: true
|
||||
overwrite: true
|
||||
transformation:
|
||||
excludeRaw: true
|
||||
excludes:
|
||||
- .*
|
||||
templates:
|
||||
username:
|
||||
text: '{{ get .Secrets "username" }}'
|
||||
password:
|
||||
text: '{{ get .Secrets "password" }}'
|
||||
dsn:
|
||||
text: 'postgresql://{{ get .Secrets "username" }}:{{ get .Secrets "password" }}@main-rw.postgres.svc.cluster.local:5432/stalwart?sslmode=disable'
|
||||
vaultAuthRef: default
|
||||
25
services/stalwart/k8s/base/vault/delivery.yaml
Normal file
25
services/stalwart/k8s/base/vault/delivery.yaml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: stalwart-delivery
|
||||
namespace: stalwart
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: stalwart/oci-email-delivery
|
||||
refreshAfter: 1h
|
||||
destination:
|
||||
name: stalwart-delivery
|
||||
create: true
|
||||
transformation:
|
||||
excludeRaw: true
|
||||
excludes:
|
||||
- .*
|
||||
templates:
|
||||
relay_endpoint:
|
||||
text: '{{ get .Secrets "endpoint" }}'
|
||||
relay_password:
|
||||
text: '{{ get .Secrets "password" }}'
|
||||
relay_username:
|
||||
text: '{{ get .Secrets "username" }}'
|
||||
vaultAuthRef: default
|
||||
65
services/stalwart/k8s/base/vault/identity.yaml
Normal file
65
services/stalwart/k8s/base/vault/identity.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: stalwart-alert
|
||||
namespace: stalwart
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: stalwart/alert-identity
|
||||
refreshAfter: 1h
|
||||
destination:
|
||||
name: stalwart-alert
|
||||
create: true
|
||||
vaultAuthRef: default
|
||||
---
|
||||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: mail-web
|
||||
namespace: stalwart
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: stalwart/oidc/zitadel
|
||||
refreshAfter: 1h
|
||||
destination:
|
||||
name: mail-web
|
||||
create: true
|
||||
transformation:
|
||||
excludeRaw: true
|
||||
excludes: [.*]
|
||||
templates:
|
||||
config.json:
|
||||
text: '{{ dict "issuer" (get .Secrets "issuer_url") "clientId" (get .Secrets "account_client_id") "scope" (printf "openid profile urn:zitadel:iam:org:project:id:%s:aud" (get .Secrets "audience")) | toJson }}'
|
||||
vaultAuthRef: default
|
||||
---
|
||||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: stalwart-test-client
|
||||
namespace: stalwart
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: stalwart/test-client
|
||||
refreshAfter: 1h
|
||||
destination:
|
||||
name: stalwart-test-client
|
||||
create: true
|
||||
vaultAuthRef: default
|
||||
---
|
||||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: stalwart-oidc
|
||||
namespace: stalwart
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: stalwart/oidc/zitadel
|
||||
refreshAfter: 1h
|
||||
destination:
|
||||
name: stalwart-oidc
|
||||
create: true
|
||||
vaultAuthRef: default
|
||||
29
services/stalwart/k8s/base/vault/quay-pull.yaml
Normal file
29
services/stalwart/k8s/base/vault/quay-pull.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: quay-cluster-pull
|
||||
namespace: stalwart
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: quay/robots/cluster_pull
|
||||
destination:
|
||||
name: quay-cluster-pull
|
||||
create: true
|
||||
overwrite: true
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
transformation:
|
||||
excludeRaw: true
|
||||
excludes:
|
||||
- .*
|
||||
templates:
|
||||
.dockerconfigjson:
|
||||
text: >-
|
||||
{"auths":{"registry.quorate.internal":{"auth":"{{ printf "%s:%s" (get .Secrets "username") (get .Secrets "token") | b64enc }}"}}}
|
||||
refreshAfter: 1h
|
||||
rolloutRestartTargets:
|
||||
- kind: Deployment
|
||||
name: stalwart
|
||||
- kind: Deployment
|
||||
name: stalwart-controller
|
||||
vaultAuthRef: default
|
||||
18
services/stalwart/k8s/base/vault/runtime.yaml
Normal file
18
services/stalwart/k8s/base/vault/runtime.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: stalwart-runtime
|
||||
namespace: stalwart
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: stalwart/runtime
|
||||
refreshAfter: 1h
|
||||
destination:
|
||||
name: stalwart-runtime
|
||||
create: true
|
||||
transformation:
|
||||
templates:
|
||||
dragonfly_url:
|
||||
text: 'redis://default:{{ get .Secrets "dragonfly_password" }}@stalwart.dragonfly.svc.cluster.local:6379'
|
||||
vaultAuthRef: default
|
||||
Loading…
Reference in a new issue