Prechádzať zdrojové kódy

Ajusto Dockerfile y deployment

Tino 5 mesiacov pred
rodič
commit
4ff3383b2b

+ 1 - 1
Consola/Dockerfile

@@ -1,4 +1,4 @@
-FROM postgres:16-alpine
+FROM postgres:18.3-alpine3.23
 
 # Opcional: utilidades útiles para debug
 RUN apk add --no-cache bash curl

+ 10 - 7
Consola/Makefile

@@ -1,24 +1,27 @@
-export REGISTRY=registry.reymota.es
-export IMG_VERSION=1.1
+export REGISTRO=harbor.reymota.es\/sistema
+# export REGISTRO=registry.reymota.es
+export IMG_VERSION=1.3
 export NAMESPACE=clientepsql
 
 imagen:
 
-	echo "Creando imagen con version '${IMG_VERSION}' en el registry '${REGISTRY}'"
+	echo "Creando imagen con version '${IMG_VERSION}' en el registry '${REGISTRO}'"
 
-	docker build --no-cache -t ${REGISTRY}/clientepsql:${IMG_VERSION} -f Dockerfile .
-	docker push ${REGISTRY}/clientepsql:${IMG_VERSION}
+	docker build --no-cache -t ${REGISTRO}/clientepsql:${IMG_VERSION} -f Dockerfile .
+	docker push ${REGISTRO}/clientepsql:${IMG_VERSION}
 
 install:
+	-cat namespace.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 	-cat reg-secret.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 	-cat secreto.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 	-cat env-prod-configmap.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
-	-cat clientepsql-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | kubectl create -f -
+	-cat clientepsql-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl create -f -
 
 clean:
 	-cat reg-secret.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
 	-cat secreto.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
 	-cat env-prod-configmap.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
 
-	-cat clientepsql-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | kubectl delete -f -
+	-cat clientepsql-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
+	-cat namespace.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -

+ 1 - 1
Consola/clientepsql-deployment.yaml

@@ -15,7 +15,7 @@ spec:
     spec:
       containers:
         - name: psql
-          image: registry.reymota.es/clientepsql:<TAG>
+          image: <REGISTRO>/clientepsql:<TAG>
           imagePullPolicy: IfNotPresent
           env:
             - name: DATABASE

+ 8 - 0
Consola/namespace.yaml

@@ -0,0 +1,8 @@
+###################################################
+# Namespace clientepsql
+###################################################
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: <NS>
+

+ 8 - 0
namespace.yaml

@@ -0,0 +1,8 @@
+###################################################
+# Namespace reymota-pg-cluster
+###################################################
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: reymota-pg-cluster
+