fixed workout manifest
This commit is contained in:
+67
-13
@@ -79,20 +79,26 @@ spec:
|
|||||||
app.kubernetes.io/instance: wger
|
app.kubernetes.io/instance: wger
|
||||||
app.kubernetes.io/name: wger
|
app.kubernetes.io/name: wger
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
securityContext:
|
||||||
- name: fix-permissions
|
fsGroup: 1000
|
||||||
image: alpine:latest
|
runAsUser: 1000
|
||||||
# Change ownership of both folders to user 1000 (wger)
|
runAsGroup: 1000
|
||||||
command: ["sh", "-c", "chown -R 1000:1000 /home/wger/static /home/wger/media"]
|
containers:
|
||||||
securityContext:
|
- name: nginx
|
||||||
runAsUser: 0
|
image: nginx:alpine
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
name: http
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: static
|
- name: static
|
||||||
mountPath: /home/wger/static
|
mountPath: /home/wger/static
|
||||||
# ADD THIS: We need to fix the media volume too
|
readOnly: true
|
||||||
- name: media
|
- name: media
|
||||||
mountPath: /home/wger/media
|
mountPath: /home/wger/media
|
||||||
containers:
|
readOnly: true
|
||||||
|
- name: nginx-config
|
||||||
|
mountPath: /etc/nginx/conf.d/default.conf
|
||||||
|
subPath: nginx.conf
|
||||||
- name: wger
|
- name: wger
|
||||||
image: wger/server:latest
|
image: wger/server:latest
|
||||||
env:
|
env:
|
||||||
@@ -200,6 +206,9 @@ spec:
|
|||||||
initialDelaySeconds: 60
|
initialDelaySeconds: 60
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
volumes:
|
volumes:
|
||||||
|
- name: nginx-config
|
||||||
|
configMap:
|
||||||
|
name: wger-nginx-config
|
||||||
- name: media
|
- name: media
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: wger-media
|
claimName: wger-media
|
||||||
@@ -228,6 +237,10 @@ spec:
|
|||||||
app.kubernetes.io/instance: wger
|
app.kubernetes.io/instance: wger
|
||||||
app.kubernetes.io/name: wger-celery-worker
|
app.kubernetes.io/name: wger-celery-worker
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 1000
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
containers:
|
containers:
|
||||||
- name: celery-worker
|
- name: celery-worker
|
||||||
image: wger/server:latest
|
image: wger/server:latest
|
||||||
@@ -302,6 +315,10 @@ spec:
|
|||||||
app.kubernetes.io/instance: wger
|
app.kubernetes.io/instance: wger
|
||||||
app.kubernetes.io/name: wger-celery-beat
|
app.kubernetes.io/name: wger-celery-beat
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 1000
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
containers:
|
containers:
|
||||||
- name: celery-beat
|
- name: celery-beat
|
||||||
image: wger/server:latest
|
image: wger/server:latest
|
||||||
@@ -381,8 +398,8 @@ spec:
|
|||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: 8000
|
port: 80
|
||||||
targetPort: http
|
targetPort: 80
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/instance: wger
|
app.kubernetes.io/instance: wger
|
||||||
app.kubernetes.io/name: wger
|
app.kubernetes.io/name: wger
|
||||||
@@ -419,7 +436,7 @@ spec:
|
|||||||
service:
|
service:
|
||||||
name: wger
|
name: wger
|
||||||
port:
|
port:
|
||||||
number: 8000
|
number: 80
|
||||||
- host: workout.home
|
- host: workout.home
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
@@ -429,7 +446,7 @@ spec:
|
|||||||
service:
|
service:
|
||||||
name: wger
|
name: wger
|
||||||
port:
|
port:
|
||||||
number: 8000
|
number: 80
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- workout.dooplex.hu
|
- workout.dooplex.hu
|
||||||
@@ -468,3 +485,40 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: wger-nginx-config
|
||||||
|
namespace: workout-system
|
||||||
|
data:
|
||||||
|
nginx.conf: |
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
client_max_body_size 4G;
|
||||||
|
|
||||||
|
# Official Wger Logic
|
||||||
|
root /var/www/html/; # This is just a dummy root, aliases do the work
|
||||||
|
|
||||||
|
location /static/ {
|
||||||
|
alias /home/wger/static/;
|
||||||
|
expires 30d;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /media/ {
|
||||||
|
alias /home/wger/media/;
|
||||||
|
expires 30d;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://localhost:8000;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
---
|
||||||
Reference in New Issue
Block a user