From 14d358190028f2c7b78e0d869e6c3861f000556f Mon Sep 17 00:00:00 2001 From: chyoo Date: Thu, 2 Jul 2026 01:43:41 +0000 Subject: [PATCH] add auth redis manifest --- k8s/auth-be.yaml | 37 +++++++++++++++++++++++ k8s/auth-db.yaml | 61 ++++++++++++++++++++++++++++++++++++++ k8s/auth-ingress.yaml | 19 ++++++++++++ k8s/studio-auth-redis.yaml | 33 +++++++++++++++++++++ 4 files changed, 150 insertions(+) create mode 100644 k8s/auth-be.yaml create mode 100644 k8s/auth-db.yaml create mode 100644 k8s/auth-ingress.yaml create mode 100644 k8s/studio-auth-redis.yaml diff --git a/k8s/auth-be.yaml b/k8s/auth-be.yaml new file mode 100644 index 0000000..7c0ca4d --- /dev/null +++ b/k8s/auth-be.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Service +metadata: + name: studio-auth-be + namespace: studio-system +spec: + selector: + app: studio-auth-be + ports: + - name: http + port: 4100 + targetPort: 4100 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: studio-auth-be + namespace: studio-system +spec: + replicas: 1 + selector: + matchLabels: + app: studio-auth-be + template: + metadata: + labels: + app: studio-auth-be + spec: + containers: + - name: studio-auth-be + image: localhost:5000/studio-auth-be:0.1.0 + imagePullPolicy: Always + ports: + - containerPort: 4100 + envFrom: + - secretRef: + name: studio-auth-be-env diff --git a/k8s/auth-db.yaml b/k8s/auth-db.yaml new file mode 100644 index 0000000..077dbaf --- /dev/null +++ b/k8s/auth-db.yaml @@ -0,0 +1,61 @@ +apiVersion: v1 +kind: Secret +metadata: + name: studio-auth-db-secret + namespace: studio-system +type: Opaque +stringData: + POSTGRES_USER: atnmy_auth + POSTGRES_PASSWORD: future1234!@ + POSTGRES_DB: atnmy_auth +--- +apiVersion: v1 +kind: Service +metadata: + name: studio-auth-db + namespace: studio-system +spec: + selector: + app: studio-auth-db + ports: + - name: postgres + port: 5432 + targetPort: 5432 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: studio-auth-db + namespace: studio-system +spec: + serviceName: studio-auth-db + replicas: 1 + selector: + matchLabels: + app: studio-auth-db + template: + metadata: + labels: + app: studio-auth-db + spec: + containers: + - name: postgres + image: postgres:17 + ports: + - containerPort: 5432 + envFrom: + - secretRef: + name: studio-auth-db-secret + volumeMounts: + - name: data + mountPath: /var/lib/postgresql/data + subPath: postgres + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: ["ReadWriteOnce"] + storageClassName: local-path + resources: + requests: + storage: 3Gi diff --git a/k8s/auth-ingress.yaml b/k8s/auth-ingress.yaml new file mode 100644 index 0000000..06a12df --- /dev/null +++ b/k8s/auth-ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: studio-auth-ingress + namespace: studio-system +spec: + ingressClassName: traefik + rules: + - host: auth.autonomystudio.net + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: studio-auth-be + port: + number: 4100 + diff --git a/k8s/studio-auth-redis.yaml b/k8s/studio-auth-redis.yaml new file mode 100644 index 0000000..7fb5084 --- /dev/null +++ b/k8s/studio-auth-redis.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: studio-auth-redis + namespace: studio-system +spec: + replicas: 1 + selector: + matchLabels: + app: studio-auth-redis + template: + metadata: + labels: + app: studio-auth-redis + spec: + containers: + - name: redis + image: redis:7-alpine + ports: + - containerPort: 6379 +--- +apiVersion: v1 +kind: Service +metadata: + name: studio-auth-redis + namespace: studio-system +spec: + selector: + app: studio-auth-redis + ports: + - name: redis + port: 6379 + targetPort: 6379