Celestino Rey 1 year ago
parent
commit
c530b6aa8f
7 changed files with 128 additions and 18 deletions
  1. +1
    -1
      ReyMotaAppsDj/K8S/Makefile
  2. +1
    -1
      ReyMotaAppsDj/K8S/nginx-service.yaml
  3. +47
    -2
      ReyMotaAppsDj/K8S/pv-local-reymota.yaml
  4. +20
    -3
      ReyMotaAppsDj/K8S/reymota-deployment.yaml
  5. +50
    -3
      ReyMotaAppsDj/K8S/reymota-prod-persistentvolumeclaim.yaml
  6. BIN
      ReyMotaAppsDj/reymota/db.sqlite3
  7. +9
    -8
      ReyMotaAppsDj/reymota/reymota/settings.py

+ 1
- 1
ReyMotaAppsDj/K8S/Makefile View File

@ -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.1
export IMG_VERSION = 0.3
export IMG_NGINX_VERSION = 1.0
# limpia todo


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

@ -13,7 +13,7 @@ spec:
ports:
- name: "1337"
port: 1337
nodePort: 30340
nodePort: 30341
targetPort: 80
selector:
io.kompose.service: nginx


+ 47
- 2
ReyMotaAppsDj/K8S/pv-local-reymota.yaml View File

@ -16,7 +16,7 @@ spec:
apiVersion: v1
kind: PersistentVolume
metadata:
name: reymota-migrations-folder
name: reymota-lyrics-migrations-folder
namespace: reymota
labels:
app: reymota
@ -26,7 +26,52 @@ spec:
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/reymota/migrations"
path: "/mnt/Externo/reymota/migrations/lyrics"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: reymota-libros-migrations-folder
namespace: reymota
labels:
app: reymota
spec:
capacity:
storage: 51Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/reymota/migrations/libros"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: reymota-repostajes-migrations-folder
namespace: reymota
labels:
app: reymota
spec:
capacity:
storage: 52Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/reymota/migrations/repostajes"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: reymota-reymotausers-migrations-folder
namespace: reymota
labels:
app: reymota
spec:
capacity:
storage: 53Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/reymota/migrations/reymotausers"
---
apiVersion: v1
kind: PersistentVolume


+ 20
- 3
ReyMotaAppsDj/K8S/reymota-deployment.yaml View File

@ -104,8 +104,16 @@ spec:
volumeMounts:
- mountPath: /app/reymota/mediafiles
name: reymota-media
- mountPath: /app/reymota/lyrics/migrations
name: reymota-lyrics-migrations
- mountPath: /app/reymota/repostajes/migrations
name: reymota-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:
@ -115,9 +123,18 @@ spec:
- name: reymota-media
persistentVolumeClaim:
claimName: reymota-media
- name: reymota-migrations
- name: reymota-lyrics-migrations
persistentVolumeClaim:
claimName: reymota-migrations
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


+ 50
- 3
ReyMotaAppsDj/K8S/reymota-prod-persistentvolumeclaim.yaml View File

@ -19,8 +19,24 @@ kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: reymota-migrations
name: reymota-migrations
io.kompose.service: reymota-libros-migrations
name: reymota-libros-migrations
namespace: reymota
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 51Mi
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: reymota-lyrics-migrations
name: reymota-lyrics-migrations
namespace: reymota
spec:
accessModes:
@ -29,4 +45,35 @@ spec:
requests:
storage: 50Mi
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: reymota-repostajes-migrations
name: reymota-repostajes-migrations
namespace: reymota
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 52Mi
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: reymota-reymotausers-migrations
name: reymota-reymotausers-migrations
namespace: reymota
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 53Mi
status: {}

BIN
ReyMotaAppsDj/reymota/db.sqlite3 View File


+ 9
- 8
ReyMotaAppsDj/reymota/reymota/settings.py View File

@ -26,8 +26,7 @@ SECRET_KEY = 'django-insecure-vu#zk4g8pj-qoov#8^i$&s8n_ipp2r3h+o$z1w(1%d=6+i@erm
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
# Application definition
@ -80,16 +79,18 @@ WSGI_APPLICATION = 'reymota.wsgi.application'
# Database
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
"default": {
"ENGINE": os.environ.get("SQL_ENGINE", "django.db.backends.sqlite3"),
"NAME": os.environ.get("SQL_DATABASE", BASE_DIR / "db.sqlite3"),
"USER": os.environ.get("SQL_USER", "user"),
"PASSWORD": os.environ.get("SQL_PASSWORD", "password"),
"HOST": os.environ.get("SQL_HOST", "localhost"),
"PORT": os.environ.get("SQL_PORT", "5432"),
}
}
# Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators


Loading…
Cancel
Save