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 # change to the app user
#USER app #USER app
WORKDIR $APP_HOME/vehiculos
WORKDIR $APP_HOME/reymota
# run entrypoint.sh # run entrypoint.sh
ENTRYPOINT ["/app/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-configmap.yaml
-kubectl create -f env-prod-db-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 static-volume-persistentvolumeclaim.yaml
-kubectl create -f postgres-data-persistentvolumeclaim.yaml -kubectl create -f postgres-data-persistentvolumeclaim.yaml
-kubectl create -f db-deployment.yaml -kubectl create -f db-deployment.yaml
-kubectl create -f db-service.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 - -envsubst < nginx-deployment.yaml |kubectl create -f -
-kubectl create -f nginx-service.yaml -kubectl create -f nginx-service.yaml
clean: clean:
-envsubst < nginx-deployment.yaml |kubectl delete -f - -envsubst < nginx-deployment.yaml |kubectl delete -f -
-kubectl delete -f nginx-service.yaml -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-deployment.yaml
-kubectl delete -f db-service.yaml -kubectl delete -f db-service.yaml
@ -41,8 +41,8 @@ clean:
-kubectl delete -f postgres-data-persistentvolumeclaim.yaml -kubectl delete -f postgres-data-persistentvolumeclaim.yaml
-kubectl delete -f static-volume-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 reg-secret.yaml
-kubectl delete -f namespace.yaml -kubectl delete -f namespace.yaml


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

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


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

@ -7,7 +7,7 @@ metadata:
labels: labels:
io.kompose.service: db io.kompose.service: db
name: db name: db
namespace: finanzas
namespace: reymota
spec: spec:
ports: ports:
- name: "5432" - 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 apiVersion: v1
data: data:
DEBUG: "False" 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 SECRET_KEY: change_me
SQL_DATABASE: finanzas
SQL_DATABASE: reymota
SQL_ENGINE: django.db.backends.postgresql SQL_ENGINE: django.db.backends.postgresql
SQL_HOST: db SQL_HOST: db
SQL_PASSWORD: Dsa-0213 SQL_PASSWORD: Dsa-0213


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

@ -1,6 +1,6 @@
apiVersion: v1 apiVersion: v1
data: data:
POSTGRES_DB: finanzas
POSTGRES_DB: reymota
POSTGRES_PASSWORD: Dsa-0213 POSTGRES_PASSWORD: Dsa-0213
POSTGRES_USER: creylopez POSTGRES_USER: creylopez
kind: ConfigMap kind: ConfigMap
@ -8,4 +8,4 @@ metadata:
labels: labels:
io.kompose.service: db-env-prod-db io.kompose.service: db-env-prod-db
name: 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 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:
name: finanzas
name: reymota

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

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

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

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


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

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


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

@ -1,59 +1,59 @@
apiVersion: v1 apiVersion: v1
kind: PersistentVolume kind: PersistentVolume
metadata: metadata:
name: finanzas-media-folder
namespace: finanzas
name: reymota-media-folder
namespace: reymota
labels: labels:
app: finanzas
app: reymota
spec: spec:
capacity: capacity:
storage: 100Mi storage: 100Mi
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/Externo/finanzas/media"
path: "/mnt/Externo/reymota/media"
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolume kind: PersistentVolume
metadata: metadata:
name: finanzas-migrations-folder
namespace: finanzas
name: reymota-migrations-folder
namespace: reymota
labels: labels:
app: finanzas
app: reymota
spec: spec:
capacity: capacity:
storage: 50Mi storage: 50Mi
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/Externo/finanzas/migrations"
path: "/mnt/Externo/reymota/migrations"
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolume kind: PersistentVolume
metadata: metadata:
name: finanzas-static-folder
namespace: finanzas
name: reymota-static-folder
namespace: reymota
labels: labels:
app: finanzas
app: reymota
spec: spec:
capacity: capacity:
storage: 70Mi storage: 70Mi
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/Externo/finanzas/static"
path: "/mnt/Externo/reymota/static"
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolume kind: PersistentVolume
metadata: metadata:
name: finanzas-pg-folder
namespace: finanzas
name: reymota-pg-folder
namespace: reymota
labels: labels:
app: finanzas
app: reymota
spec: spec:
capacity: capacity:
storage: 200Mi storage: 200Mi
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: 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 kind: Secret
metadata: metadata:
name: myregistrykey name: myregistrykey
namespace: finanzas
namespace: reymota
data: data:
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5yZXltb3RhLmVzIjogewoJCQkiYXV0aCI6ICJZM0psZVd4dmNHVjZPbEpsZVMweE1UYzIiCgkJfQoJfQp9 .dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5yZXltb3RhLmVzIjogewoJCQkiYXV0aCI6ICJZM0psZVd4dmNHVjZPbEpsZVMweE1UYzIiCgkJfQoJfQp9
type: kubernetes.io/dockerconfigjson type: kubernetes.io/dockerconfigjson

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

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

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

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

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

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


+ 1
- 1
ReyMotaAppsDj/README.md View File

@ -17,7 +17,7 @@ Con la shell entraPsql.sh:
\l para listar las BD \l para listar las BD
\c vehiculos para usar nuestra db
\c reymota para usar nuestra db
\dt para ver las tablas \dt para ver las tablas
# De dónde cogí ideas # 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}'" 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 { server {
@ -7,7 +7,7 @@ server {
listen 80; listen 80;
location / { location / {
proxy_pass http://vehiculos;
proxy_pass http://reymota;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_redirect off; proxy_redirect off;
@ -15,11 +15,11 @@ server {
} }
location /static/ { location /static/ {
alias /app/vehiculos/staticfiles/;
alias /app/reymota/staticfiles/;
} }
location /media/ { location /media/ {
alias /app/vehiculos/mediafiles/;
alias /app/reymota/mediafiles/;
} }
} }

Loading…
Cancel
Save