5 changed files with 182 additions and 166 deletions
@ -0,0 +1,182 @@ |
|||||
|
# Deployment description |
||||
|
--- |
||||
|
apiVersion: apps/v1 |
||||
|
kind: Deployment |
||||
|
metadata: |
||||
|
name: trialytix-deployment |
||||
|
namespace: dev-environment |
||||
|
spec: |
||||
|
replicas: 1 |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
app: trialytix-dev |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: trialytix-dev |
||||
|
spec: |
||||
|
containers: |
||||
|
# Backend container |
||||
|
- name: trialytix-backend |
||||
|
image: packages.semapp.lan:5000/trialytix_backend:kubernetes-test |
||||
|
resources: |
||||
|
requests: |
||||
|
memory: "512Mi" |
||||
|
cpu: "100m" |
||||
|
limits: |
||||
|
memory: "1Gi" |
||||
|
cpu: "4" |
||||
|
ports: |
||||
|
- containerPort: 5100 |
||||
|
name: trialytix-back |
||||
|
protocol: TCP |
||||
|
envFrom: |
||||
|
- configMapRef: |
||||
|
name: trialytix-config-backend-dev |
||||
|
imagePullPolicy: Always |
||||
|
# Frontend container |
||||
|
- name: trialytix-frontend |
||||
|
image: packages.semapp.lan:5000/trialytix_frontend:kubernetes-test |
||||
|
resources: |
||||
|
requests: |
||||
|
memory: "512Mi" |
||||
|
cpu: "100m" |
||||
|
limits: |
||||
|
memory: "1Gi" |
||||
|
cpu: "4" |
||||
|
ports: |
||||
|
- containerPort: 8100 |
||||
|
name: trialytix-front |
||||
|
protocol: TCP |
||||
|
volumeMounts: |
||||
|
- mountPath: /etc/nginx/conf.d |
||||
|
readOnly: true |
||||
|
name: nginx-trialytix-dev-conf |
||||
|
envFrom: |
||||
|
- configMapRef: |
||||
|
name: trialytix-config-backend-dev |
||||
|
imagePullPolicy: Always |
||||
|
volumes: |
||||
|
- name: nginx-trialytix-dev-conf |
||||
|
configMap: |
||||
|
name: nginx-trialytix-dev-conf |
||||
|
|
||||
|
# Env Configuration |
||||
|
--- |
||||
|
apiVersion: v1 |
||||
|
kind: ConfigMap |
||||
|
metadata: |
||||
|
namespace: dev-environment |
||||
|
name: trialytix-config-backend-dev |
||||
|
labels: |
||||
|
app: trialytix-dev |
||||
|
data: |
||||
|
DJANGO_DB_ENGINE: django.db.backends.postgresql_psycopg2 |
||||
|
DJANGO_DB_NAME: trialytix-dev |
||||
|
DJANGO_DB_USER: trialytix |
||||
|
DJANGO_DB_PASSWORD: 3uJQ2WGvvrZFbBHX8n6eo7qheE |
||||
|
DJANGO_DB_HOST: dbpg11.semapp.lan |
||||
|
DJANGO_DB_PORT: "5432" |
||||
|
ALLOWED_HOSTS: '["*"]' |
||||
|
FRONTEND_URL: 'http://trialytix-dev.k3s.semapp.lan' |
||||
|
API_URL: 'http://trialytix-dev.k3s.semapp.lan' |
||||
|
FRONTEND_PORT: '8100' |
||||
|
BACKEND_PORT: '5100' |
||||
|
|
||||
|
# Nginx configuration |
||||
|
--- |
||||
|
apiVersion: v1 |
||||
|
kind: ConfigMap |
||||
|
metadata: |
||||
|
namespace: dev-environment |
||||
|
name: nginx-trialytix-dev-conf |
||||
|
data: |
||||
|
default.conf: | |
||||
|
upstream backend { |
||||
|
server backend-trialytix-dev: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-dev |
||||
|
namespace: dev-environment |
||||
|
spec: |
||||
|
selector: |
||||
|
app: trialytix-dev |
||||
|
ports: |
||||
|
- name: trialytix-back |
||||
|
port: 5100 |
||||
|
targetPort: trialytix-back |
||||
|
type: NodePort |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 |
||||
|
kind: Service |
||||
|
metadata: |
||||
|
name: frontend-trialytix-dev |
||||
|
namespace: dev-environment |
||||
|
spec: |
||||
|
selector: |
||||
|
app: trialytix-dev |
||||
|
ports: |
||||
|
- name: trialytix-front |
||||
|
port: 8100 |
||||
|
targetPort: trialytix-front |
||||
|
type: NodePort |
||||
|
|
||||
|
# Ingress description |
||||
|
--- |
||||
|
apiVersion: networking.k8s.io/v1beta1 |
||||
|
kind: Ingress |
||||
|
metadata: |
||||
|
name: trialytix-ingress |
||||
|
namespace: dev-environment |
||||
|
annotations: |
||||
|
kubernetes.io/ingress.class: "traefik" |
||||
|
spec: |
||||
|
rules: |
||||
|
- host: trialytix-dev.k3s.semapp.lan |
||||
|
http: |
||||
|
paths: |
||||
|
- path: / |
||||
|
backend: |
||||
|
serviceName: frontend-trialytix-dev |
||||
|
servicePort: 8100 |
||||
@ -1,71 +0,0 @@ |
|||||
--- |
|
||||
apiVersion: v1 |
|
||||
kind: ConfigMap |
|
||||
metadata: |
|
||||
namespace: dev-environment |
|
||||
name: trialytix-config-backend-testing |
|
||||
labels: |
|
||||
app: trialytix |
|
||||
data: |
|
||||
DJANGO_DB_ENGINE: django.db.backends.postgresql_psycopg2 |
|
||||
DJANGO_DB_NAME: trialytix-testing |
|
||||
DJANGO_DB_USER: trialytix-testing |
|
||||
DJANGO_DB_PASSWORD: trialytix-testing |
|
||||
DJANGO_DB_HOST: postgres-lb |
|
||||
ALLOWED_HOSTS: '["*"]' |
|
||||
FRONTEND_URL: 'http://trialytix-testing.k3s.semapp.lan' |
|
||||
REACT_APP_PROD_API_URL: 'http://trialytix-testing.k3s.semapp.lan' |
|
||||
api_url: 'http://trialytix-testing.k3s.semapp.lan' |
|
||||
FRONTEND_PORT: '8100' |
|
||||
BACKEND_PORT: '5100' |
|
||||
|
|
||||
--- |
|
||||
apiVersion: v1 |
|
||||
kind: ConfigMap |
|
||||
metadata: |
|
||||
namespace: dev-environment |
|
||||
name: nginx-trialytix-conf |
|
||||
data: |
|
||||
default.conf: | |
|
||||
upstream backend { |
|
||||
server backend:5100; |
|
||||
} |
|
||||
|
|
||||
server { |
|
||||
listen 8100; |
|
||||
|
|
||||
#server_name trialytix-qa.semapp.lan; |
|
||||
|
|
||||
access_log /var/log/nginx/access.log; |
|
||||
charset utf-8; |
|
||||
client_max_body_size 1G; |
|
||||
|
|
||||
location / { |
|
||||
root /srv/trialytix; |
|
||||
#add_header X-Frame-Options "SAMEORIGIN"; |
|
||||
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; |
|
||||
} |
|
||||
|
|
||||
@ -1,49 +0,0 @@ |
|||||
--- |
|
||||
apiVersion: apps/v1 |
|
||||
kind: Deployment |
|
||||
metadata: |
|
||||
name: trialytix-testing |
|
||||
namespace: dev-environment |
|
||||
spec: |
|
||||
replicas: 1 |
|
||||
selector: |
|
||||
matchLabels: |
|
||||
environment: testing |
|
||||
app: trialytix |
|
||||
template: |
|
||||
metadata: |
|
||||
labels: |
|
||||
environment: testing |
|
||||
app: trialytix |
|
||||
spec: |
|
||||
containers: |
|
||||
# Backend container |
|
||||
- name: trialytix-backend |
|
||||
image: packages.semapp.lan:5000/trialytix_backend:kubernetes-test |
|
||||
ports: |
|
||||
- containerPort: 5100 |
|
||||
name: trialytix-back |
|
||||
protocol: TCP |
|
||||
envFrom: |
|
||||
- configMapRef: |
|
||||
name: trialytix-config-backend-testing |
|
||||
imagePullPolicy: Always |
|
||||
# Frontend container |
|
||||
- name: trialytix-frontend |
|
||||
image: packages.semapp.lan:5000/trialytix_frontend:kubernetes-test |
|
||||
ports: |
|
||||
- containerPort: 8100 |
|
||||
name: trialytix-front |
|
||||
protocol: TCP |
|
||||
volumeMounts: |
|
||||
- mountPath: /etc/nginx/conf.d |
|
||||
readOnly: true |
|
||||
name: nginx-trialytix-conf |
|
||||
envFrom: |
|
||||
- configMapRef: |
|
||||
name: trialytix-config-backend-testing |
|
||||
imagePullPolicy: Always |
|
||||
volumes: |
|
||||
- name: nginx-trialytix-conf |
|
||||
configMap: |
|
||||
name: nginx-trialytix-conf |
|
||||
@ -1,17 +0,0 @@ |
|||||
--- |
|
||||
apiVersion: networking.k8s.io/v1beta1 |
|
||||
kind: Ingress |
|
||||
metadata: |
|
||||
name: trialytix-ingress |
|
||||
namespace: dev-environment |
|
||||
annotations: |
|
||||
kubernetes.io/ingress.class: "traefik" |
|
||||
spec: |
|
||||
rules: |
|
||||
- host: trialytix-testing.k3s.semapp.lan |
|
||||
http: |
|
||||
paths: |
|
||||
- path: / |
|
||||
backend: |
|
||||
serviceName: frontend |
|
||||
servicePort: 8100 |
|
||||
@ -1,29 +0,0 @@ |
|||||
--- |
|
||||
apiVersion: v1 |
|
||||
kind: Service |
|
||||
metadata: |
|
||||
name: backend |
|
||||
namespace: dev-environment |
|
||||
spec: |
|
||||
selector: |
|
||||
app: trialytix |
|
||||
ports: |
|
||||
- name: trialytix-back |
|
||||
port: 5100 |
|
||||
targetPort: trialytix-back |
|
||||
type: NodePort |
|
||||
|
|
||||
--- |
|
||||
apiVersion: v1 |
|
||||
kind: Service |
|
||||
metadata: |
|
||||
name: frontend |
|
||||
namespace: dev-environment |
|
||||
spec: |
|
||||
selector: |
|
||||
app: trialytix |
|
||||
ports: |
|
||||
- name: trialytix-front |
|
||||
port: 8100 |
|
||||
targetPort: trialytix-front |
|
||||
type: NodePort |
|
||||
Loading…
Reference in new issue