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.
189 lines
4.3 KiB
189 lines
4.3 KiB
# Deployment description
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: trialytix-esculape
|
|
namespace: trialytix-environment
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: trialytix-esculape
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: trialytix-esculape
|
|
spec:
|
|
containers:
|
|
# Backend container
|
|
- name: trialytix-backend
|
|
image: packages.semapp.lan:5000/trialytix_backend:1.6.1-rc1
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "512Mi"
|
|
cpu: "4"
|
|
ports:
|
|
- containerPort: 5100
|
|
name: trialytix-back
|
|
protocol: TCP
|
|
envFrom:
|
|
- configMapRef:
|
|
name: trialytix-config-backend-prod
|
|
imagePullPolicy: Always
|
|
# Frontend container
|
|
- name: trialytix-frontend
|
|
image: packages.semapp.lan:5000/trialytix_frontend:1.6.1-rc1
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "512Mi"
|
|
cpu: "4"
|
|
ports:
|
|
- containerPort: 8100
|
|
name: trialytix-front
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- mountPath: /etc/nginx/conf.d
|
|
readOnly: true
|
|
name: nginx-trialytix-esculape-conf
|
|
envFrom:
|
|
- configMapRef:
|
|
name: trialytix-config-backend-prod
|
|
imagePullPolicy: Always
|
|
volumes:
|
|
- name: nginx-trialytix-esculape-conf
|
|
configMap:
|
|
name: nginx-trialytix-esculape-conf
|
|
|
|
# Env Configuration
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
namespace: trialytix-environment
|
|
name: trialytix-config-backend-prod
|
|
labels:
|
|
app: trialytix-esculape
|
|
data:
|
|
DJANGO_DB_ENGINE: 'django.db.backends.postgresql'
|
|
DJANGO_DB_NAME: 'trialytix-esculape'
|
|
DJANGO_DB_USER: 'trialytix-esculape'
|
|
DJANGO_DB_PASSWORD: 'Zb<BEg8)ndH_Fv`;N-'
|
|
DJANGO_DB_HOST: 'psql.semprod.local'
|
|
DJANGO_DB_PORT: '5432'
|
|
ALLOWED_HOSTS: '["*"]'
|
|
FRONTEND_URL: 'http://esculape.trialytix.io'
|
|
API_URL: 'http://esculape.trialytix.io'
|
|
FRONTEND_PORT: '8100'
|
|
BACKEND_PORT: '5100'
|
|
|
|
# Nginx configuration
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
namespace: trialytix-environment
|
|
name: nginx-trialytix-esculape-conf
|
|
data:
|
|
default.conf: |
|
|
upstream backend {
|
|
server backend-trialytix-esculape:5100;
|
|
}
|
|
|
|
server {
|
|
listen 8100;
|
|
|
|
access_log /var/log/nginx/access.log;
|
|
charset utf-8;
|
|
client_max_body_size 1G;
|
|
|
|
location / {
|
|
root /srv/trialytix;
|
|
index index.html index.htm;
|
|
try_files $uri /index.html =404;
|
|
}
|
|
|
|
location ~ ^/api {
|
|
proxy_pass http://backend;
|
|
proxy_redirect off;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_read_timeout 300s;
|
|
proxy_send_timeout 300s;
|
|
send_timeout 300s;
|
|
}
|
|
|
|
error_page 404 =200 /index.html;
|
|
|
|
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
|
|
expires off;
|
|
open_file_cache off;
|
|
sendfile off;
|
|
}
|
|
|
|
# Trialytix service
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: backend-trialytix-esculape
|
|
namespace: trialytix-environment
|
|
spec:
|
|
selector:
|
|
app: trialytix-esculape
|
|
ports:
|
|
- name: trialytix-back
|
|
port: 5100
|
|
targetPort: trialytix-back
|
|
type: NodePort
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: frontend-trialytix-esculape
|
|
namespace: trialytix-environment
|
|
spec:
|
|
selector:
|
|
app: trialytix-esculape
|
|
ports:
|
|
- name: trialytix-front
|
|
port: 8100
|
|
targetPort: trialytix-front
|
|
type: NodePort
|
|
|
|
# Ingress description
|
|
---
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
kind: Ingress
|
|
metadata:
|
|
name: trialytix-esculape-ingress
|
|
namespace: trialytix-environment
|
|
annotations:
|
|
kubernetes.io/ingress.class: "traefik"
|
|
spec:
|
|
rules:
|
|
- host: trialytix-esculape.k8s.semprod.local
|
|
http:
|
|
paths:
|
|
- path: /
|
|
backend:
|
|
serviceName: frontend-trialytix-esculape
|
|
serv:qicePort: 8100
|
|
- host: esculape.trialytix.io
|
|
http:
|
|
paths:
|
|
- path: /
|
|
backend:
|
|
serviceName: frontend-trialytix-esculape
|
|
servicePort: 8100
|