Commit 89c3e49e authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

Resolve "Create secrets for postgres from gitlab CI"

parent ecd074eb
...@@ -9,6 +9,9 @@ kubectl create secret docker-registry -n ${NAMESPACE} registry-gitlab --docker-s ...@@ -9,6 +9,9 @@ kubectl create secret docker-registry -n ${NAMESPACE} registry-gitlab --docker-s
## SECRET_KEY for Django ## SECRET_KEY for Django
kubectl delete secret backend-secret -n ${NAMESPACE} --ignore-not-found=true kubectl delete secret backend-secret -n ${NAMESPACE} --ignore-not-found=true
kubectl create secret generic backend-secret -n ${NAMESPACE} --from-literal=secret_key=${SECRET_KEY} kubectl create secret generic backend-secret -n ${NAMESPACE} --from-literal=secret_key=${SECRET_KEY}
## Credentials for postgres
kubectl delete secret postgresql-credentials -n ${NAMESPACE} --ignore-not-found=true
kubectl create secret generic postgresql-credentials -n ${NAMESPACE} --from-literal=username=${POSTGRES_USER} --from-literal=password=${POSTGRES_PASSWORD} --from-literal=database=${POSTGRES_DB}
# Deployement # Deployement
## DB ## DB
......
...@@ -33,11 +33,11 @@ spec: ...@@ -33,11 +33,11 @@ spec:
secretKeyRef: secretKeyRef:
name: postgresql-credentials name: postgresql-credentials
key: username key: username
# - name: DATABASE_PASSWORD - name: DATABASE_PASSWORD
# valueFrom: valueFrom:
# secretKeyRef: secretKeyRef:
# name: postgresql-credentials name: postgresql-credentials
# key: password key: password
- name: SECRET_KEY - name: SECRET_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
......
...@@ -23,7 +23,7 @@ spec: ...@@ -23,7 +23,7 @@ spec:
backend: backend:
serviceName: backend serviceName: backend
servicePort: 8000 servicePort: 8000
- path: /catalog - path: /api
backend: backend:
serviceName: backend serviceName: backend
servicePort: 8000 servicePort: 8000
\ No newline at end of file
...@@ -11,16 +11,6 @@ spec: ...@@ -11,16 +11,6 @@ spec:
requests: requests:
storage: 8Gi storage: 8Gi
--- ---
apiVersion: v1
kind: Secret
metadata:
name: postgresql-credentials
type: Opaque
data:
username: bWV0YWdlbmVkYl91c2VyCg==
password: bWV0YWdlbmVkYl9kZXYK
database: bWV0YWdlbmVkYl9kZXYK
---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -54,11 +44,11 @@ spec: ...@@ -54,11 +44,11 @@ spec:
secretKeyRef: secretKeyRef:
name: postgresql-credentials name: postgresql-credentials
key: database key: database
# - name: POSTGRES_PASSWORD - name: POSTGRES_PASSWORD
# valueFrom: valueFrom:
# secretKeyRef: secretKeyRef:
# name: postgresql-credentials name: postgresql-credentials
# key: password key: password
ports: ports:
- containerPort: 5432 - containerPort: 5432
name: postgresql name: postgresql
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment