Browse Source

Añado volumen para migrations

politica
Celestino Rey 1 year ago
parent
commit
94e3ae0a6a
7 changed files with 46 additions and 13 deletions
  1. +1
    -2
      RepostajesPy/K8S/Makefile
  2. +1
    -1
      RepostajesPy/K8S/entra.sh
  3. +16
    -2
      RepostajesPy/K8S/pv-local-repostajes.yaml
  4. +9
    -4
      RepostajesPy/K8S/repostajes-deployment.yaml
  5. +18
    -2
      RepostajesPy/K8S/repostajes-prod-persistentvolumeclaim.yaml
  6. +1
    -1
      RepostajesPy/K8S/verImg.sh
  7. +0
    -1
      RepostajesPy/servicios/repostajes/models.py

+ 1
- 2
RepostajesPy/K8S/Makefile View File

@ -1,4 +1,4 @@
export IMG_VERSION = 7.5
export IMG_VERSION = 1.1
# limpia todo
all: imagen clean install
@ -14,4 +14,3 @@ clean:
envsubst < repostajes-deployment.yaml |kubectl delete -f -
kubectl delete -f repostajes-prod-persistentvolumeclaim.yaml
kubectl delete -f pv-local-repostajes.yaml

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

@ -1 +1 @@
kubectl exec -ti deployment.apps/lyrics -- /bin/bash
kubectl exec -ti deployment.apps/repostajespy -- /bin/bash

+ 16
- 2
RepostajesPy/K8S/pv-local-repostajes.yaml View File

@ -1,7 +1,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: repostajespy-app-folder
name: repostajespy-instance-folder
labels:
app: repostajespy
spec:
@ -10,5 +10,19 @@ spec:
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/repostajespy"
path: "/mnt/Externo/repostajespy/instance"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: repostajespy-migrations-folder
labels:
app: repostajespy
spec:
capacity:
storage: 50Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/repostajespy/migrations"

+ 9
- 4
RepostajesPy/K8S/repostajes-deployment.yaml View File

@ -36,8 +36,8 @@ spec:
- --bind
- 0.0.0.0:5000
- repostajes:create_app()
image: creylopez/repostajes:$IMG_VERSION
name: repostajespy
image: creylopez/repostajes:$IMG_VERSION
env:
- name: SALUDO_DEMO
value: "Hola, mundo"
@ -47,10 +47,15 @@ spec:
resources: {}
volumeMounts:
- mountPath: /repostajes/instance
name: repostajespy-prod
name: repostajespy-instance
- mountPath: /repostajes/migrations
name: repostajespy-migrations
restartPolicy: Always
volumes:
- name: repostajespy-prod
- name: repostajespy-instance
persistentVolumeClaim:
claimName: repostajespy-instance
- name: repostajespy-migrations
persistentVolumeClaim:
claimName: repostajespy-prod
claimName: repostajespy-migrations
status: {}

+ 18
- 2
RepostajesPy/K8S/repostajes-prod-persistentvolumeclaim.yaml View File

@ -3,8 +3,8 @@ kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: repostajespy-prod
name: repostajespy-prod
io.kompose.service: repostajespy-instance
name: repostajespy-instance
spec:
accessModes:
- ReadWriteOnce
@ -12,3 +12,19 @@ spec:
requests:
storage: 100Mi
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: repostajespy-migrations
name: repostajespy-migrations
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
status: {}

+ 1
- 1
RepostajesPy/K8S/verImg.sh View File

@ -1 +1 @@
docker run -it creylopez/repostajes:5.3 bash
docker run -it creylopez/repostajes:1.0 bash

+ 0
- 1
RepostajesPy/servicios/repostajes/models.py View File

@ -7,7 +7,6 @@ from . import db
class User(UserMixin, db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(150), unique=True, nullable=False)
email = db.Column(db.String(150), unique=True, nullable=True)
password = db.Column(db.String(150), nullable=False)
photo = db.Column(db.String(150), nullable=False)


Loading…
Cancel
Save