From 41c2ab8ad7b1d2e913793a660d0868c94193d385 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 31 Jan 2025 10:31:30 +0100 Subject: [PATCH] Api para ver vehiculos --- ReyMotaAppsDj/K8S/Makefile | 2 +- .../K8S/nginx-deployment-limpio.yaml | 46 ++++++ .../K8S/reymota-deployment-limpio.yaml | 144 ++++++++++++++++++ 3 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 ReyMotaAppsDj/K8S/nginx-deployment-limpio.yaml create mode 100644 ReyMotaAppsDj/K8S/reymota-deployment-limpio.yaml diff --git a/ReyMotaAppsDj/K8S/Makefile b/ReyMotaAppsDj/K8S/Makefile index 50c2a78..d9c1229 100644 --- a/ReyMotaAppsDj/K8S/Makefile +++ b/ReyMotaAppsDj/K8S/Makefile @@ -1,7 +1,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') #export REGISTRY=registry.cube.local export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.29 +export IMG_VERSION = 0.30 export IMG_NGINX_VERSION = 1.0 # limpia todo diff --git a/ReyMotaAppsDj/K8S/nginx-deployment-limpio.yaml b/ReyMotaAppsDj/K8S/nginx-deployment-limpio.yaml new file mode 100644 index 0000000..2d781dd --- /dev/null +++ b/ReyMotaAppsDj/K8S/nginx-deployment-limpio.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: nginx + name: nginx + namespace: reymota +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: nginx + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: nginx + spec: + containers: + - image: registry.reymota.es/nginx-reymota-x86_64:1.0 + name: nginx + ports: + - containerPort: 80 + protocol: TCP + volumeMounts: + - mountPath: /app/reymota/staticfiles + name: static-volume + - mountPath: /app/reymota/mediafiles + name: reymota-media + imagePullSecrets: + - name: myregistrykey + restartPolicy: Always + volumes: + - name: static-volume + persistentVolumeClaim: + claimName: static-volume + - name: reymota-media + persistentVolumeClaim: + claimName: reymota-media diff --git a/ReyMotaAppsDj/K8S/reymota-deployment-limpio.yaml b/ReyMotaAppsDj/K8S/reymota-deployment-limpio.yaml new file mode 100644 index 0000000..6817f40 --- /dev/null +++ b/ReyMotaAppsDj/K8S/reymota-deployment-limpio.yaml @@ -0,0 +1,144 @@ +apiVersion: v1 +kind: Service +metadata: + name: reymota + namespace: reymota +spec: + ports: + - name: "8000" + port: 8000 + targetPort: 8000 + selector: + app: reymota +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reymota + namespace: reymota + labels: + app: reymota +spec: + replicas: 1 + selector: + matchLabels: + app: reymota + strategy: + type: Recreate + template: + metadata: + labels: + app: reymota + spec: + containers: + - args: + - gunicorn + - reymota.wsgi:application + - --bind + - 0.0.0.0:8000 + name: reymota + image: registry.reymota.es/reymota-x86_64:0.24 + env: + - name: VERSION + value: "0.24" + - name: ENVIRONMENT + valueFrom: + configMapKeyRef: + key: ENTORNO + name: env-prod + - name: DEBUG + valueFrom: + configMapKeyRef: + key: DEBUG + name: env-prod + - name: DJANGO_ALLOWED_HOSTS + valueFrom: + configMapKeyRef: + key: DJANGO_ALLOWED_HOSTS + name: env-prod + - name: CSRF_TRUSTED_ORIGINS + valueFrom: + configMapKeyRef: + key: CSRF_TRUSTED_ORIGINS + name: env-prod + - name: SECRET_KEY + valueFrom: + configMapKeyRef: + key: SECRET_KEY + name: env-prod + - name: DATABASE + valueFrom: + configMapKeyRef: + key: DATABASE + name: env-prod + - name: SQL_HOST + valueFrom: + configMapKeyRef: + key: SQL_HOST + name: env-prod + - name: SQL_PORT + valueFrom: + configMapKeyRef: + key: SQL_PORT + name: env-prod + - name: SQL_ENGINE + valueFrom: + configMapKeyRef: + key: SQL_ENGINE + name: env-prod + - name: SQL_DATABASE + valueFrom: + configMapKeyRef: + key: SQL_DATABASE + name: env-prod + - name: SQL_USER + valueFrom: + configMapKeyRef: + key: SQL_USER + name: env-prod + - name: SQL_PASSWORD + valueFrom: + configMapKeyRef: + key: SQL_PASSWORD + name: env-prod + ports: + - containerPort: 8000 + protocol: TCP + volumeMounts: + - mountPath: /app/reymota/mediafiles + name: reymota-media + + - mountPath: /app/reymota/lyrics/migrations + name: reymota-lyrics-migrations + - mountPath: /app/reymota/repostajes/migrations + name: reymota-repostajes-migrations + - mountPath: /app/reymota/libros/migrations + name: reymota-libros-migrations + - mountPath: /app/reymota/reymotausers/migrations + name: reymota-reymotausers-migrations + + - mountPath: /app/reymota/staticfiles + name: static-volume + imagePullSecrets: + - name: myregistrykey + restartPolicy: Always + volumes: + - name: reymota-media + persistentVolumeClaim: + claimName: reymota-media + - name: reymota-lyrics-migrations + persistentVolumeClaim: + claimName: reymota-lyrics-migrations + - name: reymota-repostajes-migrations + persistentVolumeClaim: + claimName: reymota-repostajes-migrations + - name: reymota-libros-migrations + persistentVolumeClaim: + claimName: reymota-libros-migrations + - name: reymota-reymotausers-migrations + persistentVolumeClaim: + claimName: reymota-reymotausers-migrations + - name: static-volume + persistentVolumeClaim: + claimName: static-volume +status: {}