Переглянути джерело

Añado secreto para postgresql

Celestino Rey 6 місяців тому
батько
коміт
505358a4d8
3 змінених файлів з 12 додано та 0 видалено
  1. 1 0
      K8S/Makefile
  2. 3 0
      K8S/finanzas-deployment.yaml
  3. 8 0
      K8S/secreto-db.yaml

+ 1 - 0
K8S/Makefile

@@ -14,6 +14,7 @@ ns:
 install:
 	-cat reg-secret.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 	-cat env-prod-configmap.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
+	-cat secret-db.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
 	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | kubectl create -f -
 	-cat finanzas-ingress.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -

+ 3 - 0
K8S/finanzas-deployment.yaml

@@ -83,6 +83,9 @@ spec:
             configMapKeyRef:
               key: SQL_PORT
               name: env-prod
+          envFrom:
+          - secretRef:
+              name: postgres-secret
         ports:
         - containerPort: 8000
           protocol: TCP

+ 8 - 0
K8S/secreto-db.yaml

@@ -0,0 +1,8 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: postgres-secret
+  namespace: <NS>
+type: Opaque
+stringData:
+  PGPASSWORD: Dsa-0213