Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secretを指定 #549

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions kubernetes/apps/auth/base/back.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ spec:
envFrom:
- configMapRef:
name: auth-conf
- secretRef:
name: auth-secret
env:
- name: DB_USER
valueFrom:
secretKeyRef:
name: default.auth.postgres-cluster.credentials.postgresql.acid.zalan.do
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: default.auth.postgres-cluster.credentials.postgresql.acid.zalan.do
key: password
livenessProbe:
httpGet:
path: /healthz
Expand Down
14 changes: 14 additions & 0 deletions kubernetes/apps/auth/base/external-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: auth-secret
spec:
secretStoreRef:
name: vault-secret-store
kind: ClusterSecretStore
refreshInterval: 1m
data:
- secretKey: SESSION_SECRET
remoteRef:
key: auth
property: SESSION_SECRET
7 changes: 4 additions & 3 deletions kubernetes/apps/auth/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- back.deployment.yaml
- back.service.yaml
- external-secret.yaml
- front.deployment.yaml
- image-repository.yaml
- back.service.yaml
- front.service.yaml
configMapGenerator:
- name: auth-conf
literals:
- DB_USER=auth
- DB_HOST=postgres-cluster.database.svc.cluster.local
- DB_PORT=5432
- DB_NAME=auth
- DB_NAME=
- DB_SSLMODE=disable
- DB_DEBUG=false
- SERVER_URL=
- SERVER_PORT=8080
- SERVER_ALLOW_ORIGINS=
- API_LOGIN_URL=
- API_APPROVE_URL=
- NEXT_PUBLIC_BACKEND_URL=
configurations:
- kustomizeconfig.yaml
6 changes: 6 additions & 0 deletions kubernetes/apps/auth/base/kustomizeconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ nameReference:
fieldSpecs:
- kind: ImagePolicy
path: spec/imageRepositoryRef/name
- kind: ExternalSecret
fieldSpecs:
- kind: Deployment
path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
- kind: Deployment
path: spec/template/spec/containers/envFrom/secretRef/name
2 changes: 2 additions & 0 deletions kubernetes/apps/auth/production/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ configMapGenerator:
- name: auth-conf
behavior: merge
literals:
- DB_NAME=auth
- SERVER_URL=https://auth.piny940.com/api/v1
- API_LOGIN_URL=https://auth.piny940.com/
- API_APPROVE_URL=https://auth.piny940.com/approve
- NEXT_PUBLIC_BACKEND_URL=https://auth.piny940.com/api/v1
4 changes: 3 additions & 1 deletion kubernetes/apps/auth/staging/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: auth
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
ingressClassName: nginx
tls:
Expand All @@ -12,7 +14,7 @@ spec:
- host: stg-auth.piny940.com
http:
paths:
- path: /api/v1
- path: /api/v1/(.*)
pathType: Prefix
backend:
service:
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/apps/auth/staging/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ configMapGenerator:
- name: auth-conf
behavior: merge
literals:
- DB_NAME=auth_staging
- SERVER_URL=https://stg-auth.piny940.com/api/v1
- API_LOGIN_URL=https://stg-auth.piny940.com/
- API_APPROVE_URL=https://stg-auth.piny940.com/approve
- NEXT_PUBLIC_BACKEND_URL=https://stg-auth.piny940.com/api/v1
Loading