You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

67 lines
2.5 KiB

export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
export REGISTRY=localhost:30500
#export REGISTRY=registry.reymota.es
export IMG_VERSION = 0.66
export IMG_NGINX_VERSION = 1.1
# limpia todo
all: imagen clean install
imagen:
cd ../; make
install:
-kubectl create -f namespace.yaml
-kubectl create -f reg-secret.yaml
-kubectl create -f env-prod-configmap-local.yaml
-kubectl create -f env-prod-db-configmap.yaml
-kubectl create -f pv-local-riesgos.yaml
-kubectl create -f riesgos-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 < riesgos-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 < riesgos-deployment.yaml |kubectl delete -f -
-kubectl delete -f db-deployment.yaml
-kubectl delete -f db-service.yaml
-kubectl delete -f env-prod-configmap-local.yaml
-kubectl delete -f env-prod-db-configmap.yaml
-kubectl delete -f postgres-data-persistentvolumeclaim.yaml
-kubectl delete -f static-volume-persistentvolumeclaim.yaml
-kubectl delete -f riesgos-prod-persistentvolumeclaim.yaml
-kubectl delete -f pv-local-riesgos.yaml
-kubectl delete -f reg-secret.yaml
-kubectl delete -f namespace.yaml
nginx:
cd ../nginx; make
verimg:
docker run -it ${REGISTRY}/riesgos-${ARQUITECTURA}:${IMG_VERSION} bash
backup:
kubectl --kubeconfig /home/creylopez/.kube/config -n riesgos exec -ti deployment.apps/db -- /usr/lib/postgresql/15/bin/pg_dump --username=creylopez --dbname=riesgos > riesgos-$(IMG_VERSION).sql
mrproper:
-kubectl -n riesgos patch pvc postgres-data -p '{"metadata":{"finalizers":null}}'
-kubectl -n riesgos patch pvc static-volume -p '{"metadata":{"finalizers":null}}'
-kubectl -n riesgos patch pvc riesgos-usuarios-migrations -p '{"metadata":{"finalizers":null}}'
-kubectl -n riesgos patch pv riesgos-pg-folder -p '{"metadata":{"finalizers":null}}'
-kubectl -n riesgos patch pvc riesgos-usuarios-migrations -p '{"metadata":{"finalizers":null}}'
-kubectl -n riesgos patch pv riesgos-gestion-migrations-folder -p '{"metadata":{"finalizers":null}}'
-kubectl -n riesgos patch pvc riesgos-media-folder -p '{"metadata":{"finalizers":null}}'
-kubectl -n riesgos patch pvc riesgos-media -p '{"metadata":{"finalizers":null}}'