Browse Source

Cambio de nombre de ficheros

politica
Celestino Rey 1 year ago
parent
commit
4062ba34b9
20 changed files with 78 additions and 78 deletions
  1. +1
    -1
      ReyMotaAppsDj/Dockerfile
  2. +6
    -6
      ReyMotaAppsDj/K8S/Makefile
  3. +1
    -1
      ReyMotaAppsDj/K8S/db-deployment.yaml
  4. +1
    -1
      ReyMotaAppsDj/K8S/db-service.yaml
  5. +1
    -1
      ReyMotaAppsDj/K8S/entra.sh
  6. +1
    -1
      ReyMotaAppsDj/K8S/entraPsql.sh
  7. +3
    -3
      ReyMotaAppsDj/K8S/env-prod-configmap.yaml
  8. +2
    -2
      ReyMotaAppsDj/K8S/env-prod-db-configmap.yaml
  9. +1
    -1
      ReyMotaAppsDj/K8S/namespace.yaml
  10. +7
    -7
      ReyMotaAppsDj/K8S/nginx-deployment.yaml
  11. +1
    -1
      ReyMotaAppsDj/K8S/nginx-service.yaml
  12. +1
    -1
      ReyMotaAppsDj/K8S/postgres-data-persistentvolumeclaim.yaml
  13. +16
    -16
      ReyMotaAppsDj/K8S/pv-local-reymota.yaml
  14. +1
    -1
      ReyMotaAppsDj/K8S/reg-secret.yaml
  15. +20
    -20
      ReyMotaAppsDj/K8S/reymota-deployment.yaml
  16. +6
    -6
      ReyMotaAppsDj/K8S/reymota-prod-persistentvolumeclaim.yaml
  17. +1
    -1
      ReyMotaAppsDj/K8S/static-volume-persistentvolumeclaim.yaml
  18. +1
    -1
      ReyMotaAppsDj/README.md
  19. +2
    -2
      ReyMotaAppsDj/nginx/Makefile
  20. +5
    -5
      ReyMotaAppsDj/nginx/nginx.conf

+ 1
- 1
ReyMotaAppsDj/Dockerfile View File

@ -67,7 +67,7 @@ COPY . $APP_HOME
# change to the app user
#USER app
WORKDIR $APP_HOME/vehiculos
WORKDIR $APP_HOME/reymota
# run entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]

+ 6
- 6
ReyMotaAppsDj/K8S/Makefile View File

@ -16,22 +16,22 @@ install:
-kubectl create -f env-prod-configmap.yaml
-kubectl create -f env-prod-db-configmap.yaml
-kubectl create -f pv-local-finanzas.yaml
-kubectl create -f finanzas-prod-persistentvolumeclaim.yaml
-kubectl create -f pv-local-reymota.yaml
-kubectl create -f reymota-prod-persistentvolumeclaim.yaml
-kubectl create -f static-volume-persistentvolumeclaim.yaml
-kubectl create -f postgres-data-persistentvolumeclaim.yaml
-kubectl create -f db-deployment.yaml
-kubectl create -f db-service.yaml
-envsubst < finanzas-deployment.yaml |kubectl create -f -
-envsubst < reymota-deployment.yaml |kubectl create -f -
-envsubst < nginx-deployment.yaml |kubectl create -f -
-kubectl create -f nginx-service.yaml
clean:
-envsubst < nginx-deployment.yaml |kubectl delete -f -
-kubectl delete -f nginx-service.yaml
-envsubst < finanzas-deployment.yaml |kubectl delete -f -
-envsubst < reymota-deployment.yaml |kubectl delete -f -
-kubectl delete -f db-deployment.yaml
-kubectl delete -f db-service.yaml
@ -41,8 +41,8 @@ clean:
-kubectl delete -f postgres-data-persistentvolumeclaim.yaml
-kubectl delete -f static-volume-persistentvolumeclaim.yaml
-kubectl delete -f finanzas-prod-persistentvolumeclaim.yaml
-kubectl delete -f pv-local-finanzas.yaml
-kubectl delete -f reymota-prod-persistentvolumeclaim.yaml
-kubectl delete -f pv-local-reymota.yaml
-kubectl delete -f reg-secret.yaml
-kubectl delete -f namespace.yaml


+ 1
- 1
ReyMotaAppsDj/K8S/db-deployment.yaml View File

@ -7,7 +7,7 @@ metadata:
labels:
io.kompose.service: db
name: db
namespace: finanzas
namespace: reymota
spec:
replicas: 1
selector:


+ 1
- 1
ReyMotaAppsDj/K8S/db-service.yaml View File

@ -7,7 +7,7 @@ metadata:
labels:
io.kompose.service: db
name: db
namespace: finanzas
namespace: reymota
spec:
ports:
- name: "5432"


+ 1
- 1
ReyMotaAppsDj/K8S/entra.sh View File

@ -1 +1 @@
kubectl -n finanzas exec -ti deployment.apps/finanzas -- /bin/bash
kubectl -n reymota exec -ti deployment.apps/reymota -- /bin/bash

+ 1
- 1
ReyMotaAppsDj/K8S/entraPsql.sh View File

@ -1 +1 @@
kubectl -n finanzas exec -ti deployment.apps/db -- psql --username=creylopez --dbname=finanzas
kubectl -n reymota exec -ti deployment.apps/db -- psql --username=creylopez --dbname=reymota

+ 3
- 3
ReyMotaAppsDj/K8S/env-prod-configmap.yaml View File

@ -1,10 +1,10 @@
apiVersion: v1
data:
DEBUG: "False"
DJANGO_ALLOWED_HOSTS: "finanzas.reymota.es k8s-server localhost 127.0.0.1 [::1]"
CSRF_TRUSTED_ORIGINS: "https://finanzas.reymota.es"
DJANGO_ALLOWED_HOSTS: "reymota.es k8s-server localhost 127.0.0.1 [::1]"
CSRF_TRUSTED_ORIGINS: "https://reymota.es"
SECRET_KEY: change_me
SQL_DATABASE: finanzas
SQL_DATABASE: reymota
SQL_ENGINE: django.db.backends.postgresql
SQL_HOST: db
SQL_PASSWORD: Dsa-0213


+ 2
- 2
ReyMotaAppsDj/K8S/env-prod-db-configmap.yaml View File

@ -1,6 +1,6 @@
apiVersion: v1
data:
POSTGRES_DB: finanzas
POSTGRES_DB: reymota
POSTGRES_PASSWORD: Dsa-0213
POSTGRES_USER: creylopez
kind: ConfigMap
@ -8,4 +8,4 @@ metadata:
labels:
io.kompose.service: db-env-prod-db
name: env-prod-db
namespace: finanzas
namespace: reymota

+ 1
- 1
ReyMotaAppsDj/K8S/namespace.yaml View File

@ -4,4 +4,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: finanzas
name: reymota

+ 7
- 7
ReyMotaAppsDj/K8S/nginx-deployment.yaml View File

@ -7,7 +7,7 @@ metadata:
labels:
io.kompose.service: nginx
name: nginx
namespace: finanzas
namespace: reymota
spec:
replicas: 1
selector:
@ -24,16 +24,16 @@ spec:
io.kompose.service: nginx
spec:
containers:
- image: $REGISTRY/nginx-finanzas-$ARQUITECTURA:$IMG_NGINX_VERSION
- image: $REGISTRY/nginx-reymota-$ARQUITECTURA:$IMG_NGINX_VERSION
name: nginx
ports:
- containerPort: 80
protocol: TCP
volumeMounts:
- mountPath: /app/finanzas/staticfiles
- mountPath: /app/reymota/staticfiles
name: static-volume
- mountPath: /app/finanzas/mediafiles
name: finanzas-media
- mountPath: /app/reymota/mediafiles
name: reymota-media
imagePullSecrets:
- name: myregistrykey
restartPolicy: Always
@ -41,6 +41,6 @@ spec:
- name: static-volume
persistentVolumeClaim:
claimName: static-volume
- name: finanzas-media
- name: reymota-media
persistentVolumeClaim:
claimName: finanzas-media
claimName: reymota-media

+ 1
- 1
ReyMotaAppsDj/K8S/nginx-service.yaml View File

@ -7,7 +7,7 @@ metadata:
labels:
io.kompose.service: nginx
name: nginx
namespace: finanzas
namespace: reymota
spec:
type: NodePort
ports:


+ 1
- 1
ReyMotaAppsDj/K8S/postgres-data-persistentvolumeclaim.yaml View File

@ -4,7 +4,7 @@ metadata:
labels:
io.kompose.service: postgres-data
name: postgres-data
namespace: finanzas
namespace: reymota
spec:
accessModes:
- ReadWriteOnce


ReyMotaAppsDj/K8S/pv-local-finanzas.yaml → ReyMotaAppsDj/K8S/pv-local-reymota.yaml View File

@ -1,59 +1,59 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: finanzas-media-folder
namespace: finanzas
name: reymota-media-folder
namespace: reymota
labels:
app: finanzas
app: reymota
spec:
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/finanzas/media"
path: "/mnt/Externo/reymota/media"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: finanzas-migrations-folder
namespace: finanzas
name: reymota-migrations-folder
namespace: reymota
labels:
app: finanzas
app: reymota
spec:
capacity:
storage: 50Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/finanzas/migrations"
path: "/mnt/Externo/reymota/migrations"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: finanzas-static-folder
namespace: finanzas
name: reymota-static-folder
namespace: reymota
labels:
app: finanzas
app: reymota
spec:
capacity:
storage: 70Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/finanzas/static"
path: "/mnt/Externo/reymota/static"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: finanzas-pg-folder
namespace: finanzas
name: reymota-pg-folder
namespace: reymota
labels:
app: finanzas
app: reymota
spec:
capacity:
storage: 200Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/finanzas/pg"
path: "/mnt/Externo/reymota/pg"

+ 1
- 1
ReyMotaAppsDj/K8S/reg-secret.yaml View File

@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: myregistrykey
namespace: finanzas
namespace: reymota
data:
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5yZXltb3RhLmVzIjogewoJCQkiYXV0aCI6ICJZM0psZVd4dmNHVjZPbEpsZVMweE1UYzIiCgkJfQoJfQp9
type: kubernetes.io/dockerconfigjson

ReyMotaAppsDj/K8S/finanzas-deployment.yaml → ReyMotaAppsDj/K8S/reymota-deployment.yaml View File

@ -1,43 +1,43 @@
apiVersion: v1
kind: Service
metadata:
name: finanzas
namespace: finanzas
name: reymota
namespace: reymota
spec:
ports:
- name: "8000"
port: 8000
targetPort: 8000
selector:
app: finanzas
app: reymota
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: finanzas
namespace: finanzas
name: reymota
namespace: reymota
labels:
app: finanzas
app: reymota
spec:
replicas: 1
selector:
matchLabels:
app: finanzas
app: reymota
strategy:
type: Recreate
template:
metadata:
labels:
app: finanzas
app: reymota
spec:
containers:
- args:
- gunicorn
- finanzas.wsgi:application
- reymota.wsgi:application
- --bind
- 0.0.0.0:8000
name: finanzas
image: $REGISTRY/finanzas-$ARQUITECTURA:$IMG_VERSION
name: reymota
image: $REGISTRY/reymota-$ARQUITECTURA:$IMG_VERSION
env:
- name: VERSION
value: "$IMG_VERSION"
@ -102,22 +102,22 @@ spec:
- containerPort: 8000
protocol: TCP
volumeMounts:
- mountPath: /app/finanzas/mediafiles
name: finanzas-media
- mountPath: /app/finanzas/repostajes/migrations
name: finanzas-migrations
- mountPath: /app/finanzas/staticfiles
- mountPath: /app/reymota/mediafiles
name: reymota-media
- mountPath: /app/reymota/repostajes/migrations
name: reymota-migrations
- mountPath: /app/reymota/staticfiles
name: static-volume
imagePullSecrets:
- name: myregistrykey
restartPolicy: Always
volumes:
- name: finanzas-media
- name: reymota-media
persistentVolumeClaim:
claimName: finanzas-media
- name: finanzas-migrations
claimName: reymota-media
- name: reymota-migrations
persistentVolumeClaim:
claimName: finanzas-migrations
claimName: reymota-migrations
- name: static-volume
persistentVolumeClaim:
claimName: static-volume

ReyMotaAppsDj/K8S/finanzas-prod-persistentvolumeclaim.yaml → ReyMotaAppsDj/K8S/reymota-prod-persistentvolumeclaim.yaml View File

@ -3,9 +3,9 @@ kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: finanzas-media
name: finanzas-media
namespace: finanzas
io.kompose.service: reymota-media
name: reymota-media
namespace: reymota
spec:
accessModes:
- ReadWriteOnce
@ -19,9 +19,9 @@ kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: finanzas-migrations
name: finanzas-migrations
namespace: finanzas
io.kompose.service: reymota-migrations
name: reymota-migrations
namespace: reymota
spec:
accessModes:
- ReadWriteOnce

+ 1
- 1
ReyMotaAppsDj/K8S/static-volume-persistentvolumeclaim.yaml View File

@ -4,7 +4,7 @@ metadata:
labels:
io.kompose.service: static-volume
name: static-volume
namespace: finanzas
namespace: reymota
spec:
accessModes:
- ReadWriteOnce


+ 1
- 1
ReyMotaAppsDj/README.md View File

@ -17,7 +17,7 @@ Con la shell entraPsql.sh:
\l para listar las BD
\c vehiculos para usar nuestra db
\c reymota para usar nuestra db
\dt para ver las tablas
# De dónde cogí ideas


+ 2
- 2
ReyMotaAppsDj/nginx/Makefile View File

@ -2,7 +2,7 @@ install:
echo "Creando imagen con version '${IMG_NGINX_VERSION}' para la arquitectura '${ARQUITECTURA}' en el registry '${REGISTRY}'"
docker build --no-cache -t ${REGISTRY}/nginx-vehiculos-${ARQUITECTURA}:${IMG_NGINX_VERSION} .
docker push ${REGISTRY}/nginx-vehiculos-${ARQUITECTURA}:${IMG_NGINX_VERSION}
docker build --no-cache -t ${REGISTRY}/nginx-reymota-${ARQUITECTURA}:${IMG_NGINX_VERSION} .
docker push ${REGISTRY}/nginx-reymota-${ARQUITECTURA}:${IMG_NGINX_VERSION}

+ 5
- 5
ReyMotaAppsDj/nginx/nginx.conf View File

@ -1,5 +1,5 @@
upstream vehiculos {
server vehiculos:8000;
upstream reymota {
server reymota:8000;
}
server {
@ -7,7 +7,7 @@ server {
listen 80;
location / {
proxy_pass http://vehiculos;
proxy_pass http://reymota;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
@ -15,11 +15,11 @@ server {
}
location /static/ {
alias /app/vehiculos/staticfiles/;
alias /app/reymota/staticfiles/;
}
location /media/ {
alias /app/vehiculos/mediafiles/;
alias /app/reymota/mediafiles/;
}
}

Loading…
Cancel
Save