|
|
|
@ -1,21 +1,41 @@ |
|
|
|
# Versión para openshift |
|
|
|
|
|
|
|
## permitir a nginx correr con privilegios |
|
|
|
|
|
|
|
### esto se hace una vez dentro del proyecto. |
|
|
|
|
|
|
|
oc adm policy add-scc-to-user -z default anyuid |
|
|
|
|
|
|
|
## Instalación |
|
|
|
### app reymota |
|
|
|
|
|
|
|
Crear un proyecto y luego añadir una app desde Agregar, importar desde git. |
|
|
|
|
|
|
|
oc new-app http://gitea.reymota.es/creylopez/ReyMotaAppsOC.git -e DEBUG="False" -e VERSION=11.0 --name='reymota' |
|
|
|
|
|
|
|
Tal y como está la estructura de directorios, deberia detectar automáticamente una compilación Python |
|
|
|
|
|
|
|
## asignación de los volúmenes |
|
|
|
### Si la pvc no está creada |
|
|
|
|
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-lyrics-migrations --claim-name='reymota-lyrics-migrations' --mount-path='/app/lyrics/migrations' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-media --claim-name='reymota-media' --mount-path='/app/mediafiles' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-repostajes-migrations --claim-name='reymota-repostajes-migrations' --mount-path='/app/repostajes/migrations' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-reymotausers-migrations --claim-name='reymota-reymotausers-migrations' --mount-path='/app/reymotausers/migrations' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --claim-size=50G --name=static-volume --claim-name='static-volume' --mount-path='/app/staticfiles' |
|
|
|
|
|
|
|
|
|
|
|
### Si la pvc ya está creada |
|
|
|
|
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --name=reymota-lyrics-migrations --claim-name='reymota-lyrics-migrations' --mount-path='/app/lyrics/migrations' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --name=reymota-media --claim-name='reymota-media' --mount-path='/app/mediafiles' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --name=reymota-repostajes-migrations --claim-name='reymota-repostajes-migrations' --mount-path='/app/repostajes/migrations' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --name=reymota-reymotausers-migrations --claim-name='reymota-reymotausers-migrations' --mount-path='/app/reymotausers/migrations' |
|
|
|
oc set volume deployment.apps/reymota --add -t pvc --name=static-volume --claim-name='static-volume' --mount-path='/app/staticfiles' |
|
|
|
|
|
|
|
|
|
|
|
Desde la línea de comandos, sería: |
|
|
|
## Exponer el servicio |
|
|
|
oc expose service/reymota |
|
|
|
|
|
|
|
### postgresql |
|
|
|
Se hace desde el yaml |
|
|
|
|
|
|
|
oc create -f postgresql-deployment.yaml |
|
|
|
|
|
|
|
oc new-app http://gitea.reymota.es/creylopez/ReyMotaAppsOC.git -e DEBUG=True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -65,20 +85,3 @@ ALTER SEQUENCE tablename_id_seq RESTART WITH nn; |
|
|
|
|
|
|
|
esto se hace cuando restauro un volcado de la bd sobre una instalación nueva. Si hay índices ya creados, hay que reinciar a partir del último. |
|
|
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
## Copiar ficheros al contenedor |
|
|
|
|
|
|
|
Copy local directory to a pod directory |
|
|
|
oc rsync /home/user/source devpod1234:/src |
|
|
|
|
|
|
|
# Copy pod directory to a local directory |
|
|
|
oc rsync devpod1234:/src /home/user/source |
|
|
|
======= |
|
|
|
## Para que git no pida credenciales |
|
|
|
|
|
|
|
git config --global credential.helper store |
|
|
|
|
|
|
|
|
|
|
|
la siguiente vez que se haga el push nos la pedirá una última vez |
|
|
|
|
|
|
|
>>>>>>> c04abab64cc16d19cf44b2b6e95eb68cccfb37b5 |