fix(inventree): re-add nginx (#2618)

* fix(inventree): re-add nginx

* configmap common

* newline

* port

* root

* run additional cont as root?

* grp

* test rofs true

* rofs false
This commit is contained in:
Stavros Kois
2022-05-06 12:30:47 +03:00
committed by GitHub
parent 4bb0723dd3
commit ae63a361dc
5 changed files with 40 additions and 24 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ name: inventree
sources: sources:
- https://inventree.readthedocs.io - https://inventree.readthedocs.io
- https://github.com/inventree/InvenTree - https://github.com/inventree/InvenTree
version: 0.0.4 version: 0.0.5
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- utilities - utilities
+2 -2
View File
@@ -344,7 +344,7 @@ questions:
label: "runAsNonRoot" label: "runAsNonRoot"
schema: schema:
type: boolean type: boolean
default: false default: true
# Include{securityContextAdvanced} # Include{securityContextAdvanced}
- variable: podSecurityContext - variable: podSecurityContext
@@ -359,7 +359,7 @@ questions:
description: "The UserID of the user running the application" description: "The UserID of the user running the application"
schema: schema:
type: int type: int
default: 0 default: 100
- variable: runAsGroup - variable: runAsGroup
label: "runAsGroup" label: "runAsGroup"
description: "The groupID this App of the user running the application" description: "The groupID this App of the user running the application"
@@ -1,6 +1,20 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "common.setup" . }} {{- include "common.setup" . }}
{{/* Append the hardcoded settings */}}
{{- define "inventree.harcodedValues" -}}
persistence:
inventree-config:
enabled: "true"
mountPath: "/etc/nginx/nginx.conf"
subPath: "nginx-confing"
type: "custom"
volumeSpec:
configMap:
name: {{ printf "%v-config" (include "common.names.fullname" .) }}
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "inventree.harcodedValues" . | fromYaml) -}}
{{/* Render secrets for inventree */}} {{/* Render secrets for inventree */}}
{{- include "inventree.secrets" . }} {{- include "inventree.secrets" . }}
@@ -66,5 +66,4 @@ data:
proxy_set_header Content-Length ""; proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri; proxy_set_header X-Original-URI $request_uri;
} }
} }
+23 -20
View File
@@ -3,17 +3,16 @@ image:
tag: 0.6.3@sha256:51f1e38f894a34dea12c0b9dfac7d59dc1c78319125ae24c8cb90a92fa75ae16 tag: 0.6.3@sha256:51f1e38f894a34dea12c0b9dfac7d59dc1c78319125ae24c8cb90a92fa75ae16
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# nginxImage: nginxImage:
# repository: tccr.io/truecharts/nginx repository: tccr.io/truecharts/nginx
# tag: v1.21.6@sha256:79875e354f6669f0fe8a31026a092734fd914ab041de0f3d8462e0117be37fd3 tag: v1.21.6@sha256:79875e354f6669f0fe8a31026a092734fd914ab041de0f3d8462e0117be37fd3
securityContext: securityContext:
readOnlyRootFilesystem: false readOnlyRootFilesystem: false
# runAsNonRoot: false
podSecurityContext: podSecurityContext:
runAsUser: 100 runAsUser: 100
# runAsGroup: 0 runAsGroup: 0
secret: secret:
INVENTREE_ADMIN_EMAIL: "test@example.com" INVENTREE_ADMIN_EMAIL: "test@example.com"
@@ -52,7 +51,7 @@ service:
ports: ports:
main: main:
port: 10231 port: 10231
targetPort: 8000 targetPort: 10231
persistence: persistence:
data: data:
@@ -108,21 +107,25 @@ initContainers:
cd /home/inventree; cd /home/inventree;
invoke update; invoke update;
additionalContainers: additionalContainers:
# nginx: nginx:
# name: nginx name: nginx
# image: "{{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }}" image: "{{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }}"
# ports: ports:
# - containerPort: 10231 - containerPort: 10231
# name: main name: main
# volumeMounts: securityContext:
# - name: inventree-config runAsUser: 0
# mountPath: "/etc/nginx/conf.d/default.conf" runAsGroup: 100
# subPath: nginx-config readOnlyRootFilesystem: false
# readOnly: true runAsNonRoot: false
# - name: data volumeMounts:
# mountPath: "/var/www" - name: inventree-config
mountPath: "/etc/nginx/conf.d/default.conf"
subPath: nginx-config
readOnly: true
- name: data
mountPath: "/var/www"
worker: worker:
name: worker name: worker
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"