|
|
|
@ -23,8 +23,8 @@ spec: |
|
|
|
# runAsGroup: 1000 |
|
|
|
# fsGroup: 1000 |
|
|
|
containers: |
|
|
|
- name: rm |
|
|
|
image: packages.semapp.lan:5000/rm:0.0.1 |
|
|
|
- name: rm-backend |
|
|
|
image: packages.semapp.lan:5000/rm-backend:0.0.1 |
|
|
|
resources: |
|
|
|
requests: |
|
|
|
memory: "256Mi" |
|
|
|
@ -34,20 +34,42 @@ spec: |
|
|
|
cpu: "4" |
|
|
|
ports: |
|
|
|
- containerPort: 5000 |
|
|
|
name: rm-http |
|
|
|
name: rm-backend |
|
|
|
protocol: TCP |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /etc/flexrm/ |
|
|
|
readOnly: true |
|
|
|
name: flexrm-conf |
|
|
|
imagePullPolicy: Always |
|
|
|
- name: rm-frontend |
|
|
|
image: packages.semapp.lan:5000/rm-frontend:0.0.1 |
|
|
|
resources: |
|
|
|
requests: |
|
|
|
memory: "256Mi" |
|
|
|
cpu: "100m" |
|
|
|
limits: |
|
|
|
memory: "512Mi" |
|
|
|
cpu: "4" |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
name: rm-frontend |
|
|
|
protocol: TCP |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /etc/nginx/conf.d/ |
|
|
|
readOnly: true |
|
|
|
name: flexrm-frontend-conf |
|
|
|
imagePullPolicy: Always |
|
|
|
volumes: |
|
|
|
- name: flexrm-frontend-conf |
|
|
|
configMap: |
|
|
|
name: flexrm-frontend-conf |
|
|
|
- name: flexrm-conf |
|
|
|
configMap: |
|
|
|
name: flexrm-conf |
|
|
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
# Backend configuration |
|
|
|
apiVersion: v1 |
|
|
|
kind: ConfigMap |
|
|
|
metadata: |
|
|
|
@ -116,23 +138,96 @@ data: |
|
|
|
minio_secret_key = "Semapp123456!" |
|
|
|
minio_auto_create_bucket = True |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
# Frontend nginx configuration |
|
|
|
apiVersion: v1 |
|
|
|
kind: ConfigMap |
|
|
|
metadata: |
|
|
|
namespace: dev-environment |
|
|
|
name: flexrm-frontend-conf |
|
|
|
data: |
|
|
|
default.conf: | |
|
|
|
upstream backend { |
|
|
|
server rm-backend-srv:5000; |
|
|
|
} |
|
|
|
|
|
|
|
server { |
|
|
|
listen 80; |
|
|
|
|
|
|
|
server_name $K8S_HOSTNAME; |
|
|
|
|
|
|
|
#access_log /var/log/rm/access.log; |
|
|
|
#error_log /var/log/rm/error.log; |
|
|
|
|
|
|
|
charset utf-8; |
|
|
|
client_max_body_size 1G; |
|
|
|
|
|
|
|
location / { |
|
|
|
root /srv/rm-web; |
|
|
|
|
|
|
|
try_files $uri /index.html =404; |
|
|
|
} |
|
|
|
|
|
|
|
location ~ ^/(api|drf|manage) { |
|
|
|
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; |
|
|
|
} |
|
|
|
|
|
|
|
location /storage { |
|
|
|
# TODO: still needed when we use minio? |
|
|
|
alias /srv/media; |
|
|
|
} |
|
|
|
|
|
|
|
location /static { |
|
|
|
# TODO: still needed when we use minio? |
|
|
|
alias /srv/public; |
|
|
|
} |
|
|
|
|
|
|
|
# Redirect Angular routes |
|
|
|
error_page 404 =200 /index.html; |
|
|
|
} |
|
|
|
|
|
|
|
--- |
|
|
|
# RM Service |
|
|
|
|
|
|
|
# RM backend Service |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: rm-dev |
|
|
|
name: rm-backend-srv |
|
|
|
namespace: dev-environment |
|
|
|
spec: |
|
|
|
selector: |
|
|
|
app: rm-dev |
|
|
|
ports: |
|
|
|
- name: rm-http |
|
|
|
- name: rm-backend |
|
|
|
port: 5000 |
|
|
|
targetPort: rm-http |
|
|
|
targetPort: rm-backend |
|
|
|
type: NodePort |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
#RM frontend service |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: rm-frontend-srv |
|
|
|
namespace: dev-environment |
|
|
|
spec: |
|
|
|
selector: |
|
|
|
app: rm-dev |
|
|
|
ports: |
|
|
|
- name: rm-frontend |
|
|
|
port: 80 |
|
|
|
targetPort: rm-frontend |
|
|
|
type: NodePort |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
# Ingress description |
|
|
|
apiVersion: networking.k8s.io/v1beta1 |
|
|
|
kind: Ingress |
|
|
|
@ -148,5 +243,5 @@ spec: |
|
|
|
paths: |
|
|
|
- path: / |
|
|
|
backend: |
|
|
|
serviceName: rm-dev |
|
|
|
servicePort: 5000 |
|
|
|
serviceName: rm-frontend-srv |
|
|
|
servicePort: 80 |