From 546667dc73eb05e4ae550e4c8d67db406d76837e Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 26 Sep 2025 13:13:44 +0200 Subject: [PATCH] Cambios para que funcione en todos los clusters --- K8S/reymota-deployment.yaml | 21 +++++++++------------ nginx/Dockerfile | 4 ---- nginx/Makefile | 8 -------- nginx/nginx.conf | 26 -------------------------- 4 files changed, 9 insertions(+), 50 deletions(-) delete mode 100644 nginx/Dockerfile delete mode 100644 nginx/Makefile delete mode 100644 nginx/nginx.conf diff --git a/K8S/reymota-deployment.yaml b/K8S/reymota-deployment.yaml index c825c1c..55ab0e1 100644 --- a/K8S/reymota-deployment.yaml +++ b/K8S/reymota-deployment.yaml @@ -4,9 +4,11 @@ metadata: name: reymota namespace: reymota spec: + type: NodePort ports: - name: "8000" port: 8000 + nodePort: 30347 targetPort: 8000 selector: app: reymota @@ -31,13 +33,8 @@ spec: app: reymota spec: containers: - - args: - - gunicorn - - reymota.wsgi:application - - --bind - - 0.0.0.0:8000 - name: reymota - image: $REGISTRY/reymota-$ARQUITECTURA:$IMG_VERSION + - name: reymota + image: registry.reymota.es/reymota: env: - name: IMG_VERSION value: "$IMG_VERSION" @@ -77,16 +74,16 @@ spec: - containerPort: 8000 protocol: TCP volumeMounts: - - mountPath: /app/src/mediafiles + - mountPath: /app/mediafiles name: reymota-media - - mountPath: /app/src/lyrics/migrations + - mountPath: /app/lyrics/migrations name: reymota-lyrics-migrations - - mountPath: /app/src/repostajes/migrations + - mountPath: /app/repostajes/migrations name: reymota-repostajes-migrations - - mountPath: /app/src/reymotausers/migrations + - mountPath: /app/reymotausers/migrations name: reymota-reymotausers-migrations - - mountPath: /app/src/staticfiles + - mountPath: /app/staticfiles name: static-volume imagePullSecrets: - name: myregistrykey diff --git a/nginx/Dockerfile b/nginx/Dockerfile deleted file mode 100644 index 8328a0e..0000000 --- a/nginx/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM nginx:1.25 - -RUN rm /etc/nginx/conf.d/default.conf -COPY nginx.conf /etc/nginx/conf.d diff --git a/nginx/Makefile b/nginx/Makefile deleted file mode 100644 index fb1a26d..0000000 --- a/nginx/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -install: - - echo "Creando imagen con version '${IMG_NGINX_VERSION}' para la arquitectura '${ARQUITECTURA}' en el registry '${REGISTRY}'" - - docker build --no-cache -t ${REGISTRY}/nginx-reymota-${ARQUITECTURA}:${IMG_NGINX_VERSION} . - docker push ${REGISTRY}/nginx-reymota-${ARQUITECTURA}:${IMG_NGINX_VERSION} - - diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 8365ea3..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,26 +0,0 @@ -upstream reymota { - server reymota:8000; -} - -server { - - listen 80; - - location / { - proxy_pass http://reymota; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_redirect off; - client_max_body_size 100M; - } - - location /static/ { - alias /app/reymota/staticfiles/; - } - - location /media/ { - alias /app/reymota/mediafiles/; - } - -} -