From 4d5c47e21baab45f4a3aa6083f11ed6b44b27f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 15 Aug 2024 09:49:48 +0300 Subject: [PATCH] wildduck: Refined Dragonfly cleanup --- wildduck/haraka.yaml | 4 ++-- wildduck/session-storage.yaml | 42 +++++++++++++++++++++++++++++++++++ wildduck/sessions.yaml | 28 ----------------------- wildduck/webmail.yaml | 4 ++-- wildduck/wildduck.yaml | 2 +- wildduck/wildflock.yaml | 2 +- wildduck/zonemta.yaml | 4 ++-- 7 files changed, 50 insertions(+), 36 deletions(-) create mode 100644 wildduck/session-storage.yaml delete mode 100644 wildduck/sessions.yaml diff --git a/wildduck/haraka.yaml b/wildduck/haraka.yaml index 38c9473..f176ea7 100644 --- a/wildduck/haraka.yaml +++ b/wildduck/haraka.yaml @@ -177,8 +177,8 @@ spec: - name: REDIS_URI valueFrom: secretKeyRef: - name: dragonfly-auth - key: REDIS_URI + name: session-storage + key: REDIS_WILDDUCK_URI - name: MONGO_URI valueFrom: secretKeyRef: diff --git a/wildduck/session-storage.yaml b/wildduck/session-storage.yaml new file mode 100644 index 0000000..5d59318 --- /dev/null +++ b/wildduck/session-storage.yaml @@ -0,0 +1,42 @@ +--- +apiVersion: codemowers.cloud/v1beta1 +kind: SecretClaim +metadata: + name: session-storage +spec: + size: 32 + mapping: + - key: password + value: "%(plaintext)s" + - key: REDIS_WILDDUCK_URI + value: "redis://:%(plaintext)s@session-storage/1" + - key: REDIS_WEBMAIL_URI + value: "redis://:%(plaintext)s@session-storage/2" + - key: REDIS_WILDFLOCK_URI + value: "redis://:%(plaintext)s@session-storage/2" +--- +apiVersion: dragonflydb.io/v1alpha1 +kind: Dragonfly +metadata: + name: session-storage +spec: + authentication: + passwordFromSecret: + key: password + name: session-storage + replicas: 3 + resources: + limits: + memory: 1Gi +--- +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: session-storage +spec: + selector: + matchLabels: + app: session-storage + app.kubernetes.io/part-of: dragonfly + podMetricsEndpoints: + - port: admin diff --git a/wildduck/sessions.yaml b/wildduck/sessions.yaml deleted file mode 100644 index ac15378..0000000 --- a/wildduck/sessions.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -apiVersion: codemowers.cloud/v1beta1 -kind: SecretClaim -metadata: - name: dragonfly-auth -spec: - size: 32 - mapping: - - key: password - value: "%(plaintext)s" - - key: REDIS_WILDDUCK_URI - value: "redis://:%(plaintext)s@dragonfly/1" - - key: REDIS_WILDFLOCK_URI - value: "redis://:%(plaintext)s@dragonfly/2" ---- -apiVersion: dragonflydb.io/v1alpha1 -kind: Dragonfly -metadata: - name: dragonfly -spec: - authentication: - passwordFromSecret: - key: password - name: dragonfly-auth - replicas: 3 - resources: - limits: - memory: 1Gi diff --git a/wildduck/webmail.yaml b/wildduck/webmail.yaml index f407960..68e4861 100644 --- a/wildduck/webmail.yaml +++ b/wildduck/webmail.yaml @@ -88,8 +88,8 @@ spec: - name: APPCONF_dbs_redis valueFrom: secretKeyRef: - name: dragonfly-auth - key: REDIS_URI + name: session-storage + key: REDIS_WEBMAIL_URI volumes: - name: webmail-config projected: diff --git a/wildduck/wildduck.yaml b/wildduck/wildduck.yaml index a78220f..ab5f688 100644 --- a/wildduck/wildduck.yaml +++ b/wildduck/wildduck.yaml @@ -92,7 +92,7 @@ spec: - name: APPCONF_dbs_redis valueFrom: secretKeyRef: - name: dragonfly-auth + name: session-storage key: REDIS_WILDDUCK_URI volumeMounts: - mountPath: /cert diff --git a/wildduck/wildflock.yaml b/wildduck/wildflock.yaml index 9967f1a..fbaf8c7 100644 --- a/wildduck/wildflock.yaml +++ b/wildduck/wildflock.yaml @@ -96,7 +96,7 @@ spec: - name: REDIS_URL valueFrom: secretKeyRef: - name: dragonfly-auth + name: session-storage key: REDIS_WILDFLOCK_URI - name: CLIENT_URL value: https://wildflock.k-space.ee diff --git a/wildduck/zonemta.yaml b/wildduck/zonemta.yaml index 4cc568a..35407e8 100644 --- a/wildduck/zonemta.yaml +++ b/wildduck/zonemta.yaml @@ -125,8 +125,8 @@ spec: - name: APPCONF_dbs_redis valueFrom: secretKeyRef: - name: dragonfly-auth - key: REDIS_URI + name: session-storage + key: REDIS_WILDDUCK_URI volumeMounts: - name: cert mountPath: /cert