|
| 1 | +apiVersion: v1 |
| 2 | +kind: ConfigMap |
| 3 | +metadata: |
| 4 | + name: mindwtr-nginx-conf |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | +data: |
| 7 | + default.conf: | |
| 8 | + server { |
| 9 | + listen 5173; |
| 10 | + server_name _; |
| 11 | +
|
| 12 | + root /usr/share/nginx/html; |
| 13 | + index index.html; |
| 14 | + add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: file:; media-src 'self' data: blob: file:; font-src 'self' data:; connect-src 'self' https: http://localhost:* ws://localhost:*; object-src 'none'; frame-src 'none'; base-uri 'self'; form-action 'self'; manifest-src 'self'; worker-src 'self'" always; |
| 15 | + add_header X-Content-Type-Options "nosniff" always; |
| 16 | + add_header Referrer-Policy "no-referrer" always; |
| 17 | + add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; |
| 18 | + add_header X-Frame-Options "SAMEORIGIN" always; |
| 19 | +
|
| 20 | + location /v1/ { |
| 21 | + proxy_pass http://127.0.0.1:8787/v1/; |
| 22 | + proxy_set_header Host $host; |
| 23 | + proxy_set_header X-Real-IP $remote_addr; |
| 24 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 25 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 26 | + client_max_body_size 50M; |
| 27 | + } |
| 28 | +
|
| 29 | + location /health { |
| 30 | + proxy_pass http://127.0.0.1:8787/health; |
| 31 | + proxy_set_header Host $host; |
| 32 | + proxy_set_header X-Real-IP $remote_addr; |
| 33 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 34 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 35 | + } |
| 36 | +
|
| 37 | + location /ready { |
| 38 | + proxy_pass http://127.0.0.1:8787/ready; |
| 39 | + proxy_set_header Host $host; |
| 40 | + proxy_set_header X-Real-IP $remote_addr; |
| 41 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 42 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 43 | + } |
| 44 | +
|
| 45 | + location /assets/ { |
| 46 | + add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: file:; media-src 'self' data: blob: file:; font-src 'self' data:; connect-src 'self' https: http://localhost:* ws://localhost:*; object-src 'none'; frame-src 'none'; base-uri 'self'; form-action 'self'; manifest-src 'self'; worker-src 'self'" always; |
| 47 | + add_header X-Content-Type-Options "nosniff" always; |
| 48 | + add_header Referrer-Policy "no-referrer" always; |
| 49 | + add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; |
| 50 | + add_header X-Frame-Options "SAMEORIGIN" always; |
| 51 | + add_header Cache-Control "public, max-age=31536000, immutable" always; |
| 52 | + try_files $uri =404; |
| 53 | + } |
| 54 | +
|
| 55 | + location / { |
| 56 | + add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: file:; media-src 'self' data: blob: file:; font-src 'self' data:; connect-src 'self' https: http://localhost:* ws://localhost:*; object-src 'none'; frame-src 'none'; base-uri 'self'; form-action 'self'; manifest-src 'self'; worker-src 'self'" always; |
| 57 | + add_header X-Content-Type-Options "nosniff" always; |
| 58 | + add_header Referrer-Policy "no-referrer" always; |
| 59 | + add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; |
| 60 | + add_header X-Frame-Options "SAMEORIGIN" always; |
| 61 | + add_header Cache-Control "no-cache" always; |
| 62 | + try_files $uri /index.html; |
| 63 | + } |
| 64 | + } |
| 65 | +--- |
| 66 | +apiVersion: apps/v1 |
| 67 | +kind: Deployment |
| 68 | +metadata: |
| 69 | + name: mindwtr |
| 70 | + namespace: {{ .Release.Namespace }} |
| 71 | + labels: |
| 72 | + io.kompose.service: mindwtr |
| 73 | +spec: |
| 74 | + replicas: {{ .Values.workloads.mindwtr.replicaCount }} |
| 75 | + selector: |
| 76 | + matchLabels: |
| 77 | + io.kompose.service: mindwtr |
| 78 | + strategy: |
| 79 | + type: Recreate |
| 80 | + template: |
| 81 | + metadata: |
| 82 | + labels: |
| 83 | + io.kompose.service: mindwtr |
| 84 | + spec: |
| 85 | + securityContext: |
| 86 | + fsGroup: 1000 |
| 87 | + containers: |
| 88 | + - name: mindwtr-app |
| 89 | + image: "{{ .Values.image.app.repository }}:{{ .Values.image.app.tag }}" |
| 90 | + imagePullPolicy: {{ .Values.image.app.pullPolicy | default "IfNotPresent" }} |
| 91 | + ports: |
| 92 | + - name: http |
| 93 | + containerPort: 5173 |
| 94 | + protocol: TCP |
| 95 | + volumeMounts: |
| 96 | + - name: nginx-conf |
| 97 | + mountPath: /etc/nginx/conf.d/default.conf |
| 98 | + subPath: default.conf |
| 99 | + resources: |
| 100 | + requests: |
| 101 | + cpu: 50m |
| 102 | + memory: 64Mi |
| 103 | + limits: |
| 104 | + cpu: 500m |
| 105 | + memory: 256Mi |
| 106 | + - name: mindwtr-cloud |
| 107 | + image: "{{ .Values.image.cloud.repository }}:{{ .Values.image.cloud.tag }}" |
| 108 | + imagePullPolicy: {{ .Values.image.cloud.pullPolicy | default "IfNotPresent" }} |
| 109 | + env: |
| 110 | + - name: MINDWTR_CLOUD_DATA_DIR |
| 111 | + value: "/app/cloud_data" |
| 112 | + - name: MINDWTR_CLOUD_CORS_ORIGIN |
| 113 | + value: "http://localhost:5173" |
| 114 | + - name: MINDWTR_CLOUD_ALLOW_ANY_TOKEN |
| 115 | + value: {{ .Values.cloud.allowAnyToken | default "true" | quote }} |
| 116 | + {{- if .Values.cloud.authTokens }} |
| 117 | + - name: MINDWTR_CLOUD_AUTH_TOKENS |
| 118 | + value: {{ .Values.cloud.authTokens | quote }} |
| 119 | + {{- end }} |
| 120 | + ports: |
| 121 | + - name: cloud |
| 122 | + containerPort: 8787 |
| 123 | + protocol: TCP |
| 124 | + volumeMounts: |
| 125 | + - name: mindwtr-data |
| 126 | + mountPath: /app/cloud_data |
| 127 | + resources: |
| 128 | + requests: |
| 129 | + cpu: 100m |
| 130 | + memory: 128Mi |
| 131 | + limits: |
| 132 | + cpu: 1000m |
| 133 | + memory: 512Mi |
| 134 | + restartPolicy: Always |
| 135 | + volumes: |
| 136 | + - name: nginx-conf |
| 137 | + configMap: |
| 138 | + name: mindwtr-nginx-conf |
| 139 | + - name: mindwtr-data |
| 140 | + hostPath: |
| 141 | + type: DirectoryOrCreate |
| 142 | + path: '{{ .Values.userspace.appData }}/mindwtr' |
| 143 | +--- |
| 144 | +apiVersion: v1 |
| 145 | +kind: Service |
| 146 | +metadata: |
| 147 | + name: mindwtr-service |
| 148 | + namespace: {{ .Release.Namespace }} |
| 149 | + labels: |
| 150 | + io.kompose.service: mindwtr |
| 151 | +spec: |
| 152 | + ports: |
| 153 | + - name: http |
| 154 | + port: 5173 |
| 155 | + targetPort: 5173 |
| 156 | + protocol: TCP |
| 157 | + - name: cloud |
| 158 | + port: 8787 |
| 159 | + targetPort: 8787 |
| 160 | + protocol: TCP |
| 161 | + selector: |
| 162 | + io.kompose.service: mindwtr |
0 commit comments