From 984d4f9b3865baeb71cb3f2fe222fc6bd2287572 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Wed, 21 Feb 2024 02:45:24 +0800 Subject: [PATCH] fix(redbot): switch to PVC --- kube/deploy/apps/redbot/app/hr.yaml | 41 +++++---------------- kube/deploy/apps/redbot/ks.yaml | 56 +++++++++-------------------- 2 files changed, 25 insertions(+), 72 deletions(-) diff --git a/kube/deploy/apps/redbot/app/hr.yaml b/kube/deploy/apps/redbot/app/hr.yaml index 1c449e1f..1e5bfae1 100644 --- a/kube/deploy/apps/redbot/app/hr.yaml +++ b/kube/deploy/apps/redbot/app/hr.yaml @@ -21,37 +21,26 @@ spec: replicas: 1 pod: labels: - db.home.arpa/pg: "pg-default" egress.home.arpa/discord: "allow" containers: main: image: &img repository: "jank.ing/jjgadgets/redbot" tag: "3.5.5@sha256:07da705d7113fe2c7e7f48aa5f2d5105fbf23c01b27b2808f457898c19636a00" + args: [ + # args specific to my image + "--init", + # RedBot args + "--mentionable" + ] env: TZ: "${CONFIG_TZ}" NAME: "JJGadgets" - PREFIX: "yui." + PREFIXES: "yui. y." TOKEN_FILE: &token "/secrets/token" OWNER_FILE: &owner "/secrets/owner" BASE_PATH: &path "/config" - STORAGE_TYPE: "Postgres" - PGHOST: - valueFrom: - secretKeyRef: - name: &pgsec "pg-default-pguser-redbot" - key: "pgbouncer-host" - PGDATABASE: - valueFrom: - secretKeyRef: - name: *pgsec - key: "dbname" - PGUSER: - valueFrom: - secretKeyRef: - name: *pgsec - key: "user" - PGPASSFILE: &pgpass "/secrets/pgpass" + STORAGE_TYPE: "JSON" securityContext: readOnlyRootFilesystem: true allowPrivilegeEscalation: false @@ -70,8 +59,7 @@ spec: persistence: config: enabled: true - type: emptyDir - medium: Memory + existingClaim: "redbot-data" globalMounts: - subPath: "config" path: *path @@ -98,17 +86,6 @@ spec: - subPath: "OWNER" path: *owner readOnly: true - pg: - enabled: true - type: secret - name: *pgsec - defaultMode: 0400 - advancedMounts: - main: - main: - - subPath: "password" - path: *pgpass - readOnly: true defaultPodOptions: automountServiceAccountToken: false enableServiceLinks: false diff --git a/kube/deploy/apps/redbot/ks.yaml b/kube/deploy/apps/redbot/ks.yaml index 0fee0e42..fd655948 100644 --- a/kube/deploy/apps/redbot/ks.yaml +++ b/kube/deploy/apps/redbot/ks.yaml @@ -12,56 +12,32 @@ spec: path: ./kube/deploy/apps/redbot/app targetNamespace: "redbot" dependsOn: - - name: redbot-db - # - name: redbot-pvc -# --- -# apiVersion: kustomize.toolkit.fluxcd.io/v1 -# kind: Kustomization -# metadata: -# name: redbot-pvc -# namespace: flux-system -# labels: &l -# app.kubernetes.io/name: "redbot" -# spec: -# commonMetadata: -# labels: *l -# path: ./kube/deploy/core/storage/volsync/template -# targetNamespace: "redbot" -# dependsOn: -# - name: 1-core-storage-volsync-app -# - name: 1-core-storage-rook-ceph-cluster -# postBuild: -# substitute: -# PVC: "redbot-data" -# SIZE: "10Gi" -# SC: &sc "file" -# SNAP: *sc -# RUID: !!str &uid | -# ${APP_UID_REDBOT} -# RGID: !!str | -# ${APP_UID_REDBOT} -# RFSG: !!str | -# ${APP_UID_REDBOT} + - name: redbot-pvc --- apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: redbot-db + name: redbot-pvc namespace: flux-system labels: &l - prune.flux.home.arpa/enabled: "true" - db.home.arpa/pg: "pg-default" app.kubernetes.io/name: "redbot" spec: commonMetadata: labels: *l - path: ./kube/deploy/core/db/pg/clusters/template/pguser - targetNamespace: "pg" + path: ./kube/deploy/core/storage/volsync/template + targetNamespace: "redbot" dependsOn: - - name: 1-core-db-pg-clusters-default - - name: 1-core-secrets-es-k8s + - name: 1-core-storage-volsync-app + - name: 1-core-storage-rook-ceph-cluster postBuild: substitute: - PG_NAME: "default" - PG_DB_USER: &app "redbot" - PG_APP_NS: *app + PVC: "redbot-data" + SIZE: "20Gi" + SC: &sc "file" + SNAP: *sc + RUID: !!str &uid | + ${APP_UID_REDBOT} + RGID: !!str | + ${APP_UID_REDBOT} + RFSG: !!str | + ${APP_UID_REDBOT}