fix(inventree): fix errors and restructure chart to be readable (#3594)
* fix(inventree): fix errors * update runas of init * no rofs * run init as root * fix typo * do some cleanup * lets test * more cleanup * nomount * rename * ughhh * hmm * encode * dont cd * root * update UI * change dir * back to default redis user * cleanup
This commit is contained in:
@@ -28,7 +28,7 @@ sources:
|
||||
- https://github.com/truecharts/charts/tree/master/charts/stable/inventree
|
||||
- https://inventree.readthedocs.io
|
||||
- https://github.com/inventree/InvenTree
|
||||
version: 3.0.45
|
||||
version: 4.0.0
|
||||
annotations:
|
||||
truecharts.org/catagories: |
|
||||
- utilities
|
||||
|
||||
@@ -12,133 +12,137 @@ questions:
|
||||
# Include{recreate}
|
||||
# Include{controllerExpert}
|
||||
# Include{controllerExpertExtraArgs}
|
||||
- variable: secretEnv
|
||||
group: "Container Configuration"
|
||||
label: "Image Secrets"
|
||||
- variable: inventree
|
||||
group: Container Configuration
|
||||
label: Inventree Configuration
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: INVENTREE_ADMIN_EMAIL
|
||||
label: "INVENTREE_ADMIN_EMAIL (Initial install only)"
|
||||
- variable: credentials
|
||||
label: Credentials
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: admin_mail
|
||||
label: Admin Mail (Initial Install Only)
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: INVENTREE_ADMIN_USER
|
||||
label: "INVENTREE_ADMIN_USER (Initial install only)"
|
||||
- variable: admin_user
|
||||
label: Admin User (Initial Install Only)
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: INVENTREE_ADMIN_PASSWORD
|
||||
label: "INVENTREE_ADMIN_PASSWORD (Initial install only)"
|
||||
- variable: admin_password
|
||||
label: Admin Password (Initial Install Only)
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
private: true
|
||||
default: ""
|
||||
- variable: env
|
||||
group: "Container Configuration"
|
||||
label: "Image Environment"
|
||||
- variable: general
|
||||
label: General
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: INVENTREE_LOGIN_CONFIRM_DAYS
|
||||
label: "INVENTREE_LOGIN_CONFIRM_DAYS"
|
||||
description: "Duration for which confirmation links are valid"
|
||||
schema:
|
||||
type: int
|
||||
default: 3
|
||||
- variable: INVENTREE_LOGIN_ATTEMPTS
|
||||
label: "INVENTREE_LOGIN_ATTEMPTS"
|
||||
description: "Count of allowed login attempts before blocking user"
|
||||
schema:
|
||||
type: int
|
||||
default: 5
|
||||
- variable: INVENTREE_PLUGINS_ENABLED
|
||||
label: "INVENTREE_PLUGINS_ENABLED"
|
||||
description: "Enable plugin support"
|
||||
- variable: plugins_enabled
|
||||
label: Enable Plugins
|
||||
description: Enable plugin support
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: INVENTREE_DEBUG
|
||||
label: "INVENTREE_DEBUG"
|
||||
- variable: login_confirm_days
|
||||
label: Login Confirm Days
|
||||
description: Duration for which confirmation links are valid
|
||||
schema:
|
||||
type: int
|
||||
default: 3
|
||||
- variable: login_attempts
|
||||
label: Login Attempts
|
||||
description: Count of allowed login attempts before blocking user
|
||||
schema:
|
||||
type: int
|
||||
default: 5
|
||||
- variable: debug
|
||||
label: "Debug"
|
||||
description: "Enable debug mode"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: INVENTREE_LOG_LEVEL
|
||||
label: "INVENTREE_LOG_LEVEL"
|
||||
description: "Set level of logging to terminal"
|
||||
- variable: log_level
|
||||
label: Log Level
|
||||
description: Set level of logging to terminal
|
||||
schema:
|
||||
type: string
|
||||
default: "INFO"
|
||||
default: INFO
|
||||
enum:
|
||||
- value: "INFO"
|
||||
description: "INFO"
|
||||
- value: "DEBUG"
|
||||
description: "DEBUG"
|
||||
- value: "WARNING"
|
||||
description: "WARNING"
|
||||
- value: "ERROR"
|
||||
description: "ERROR"
|
||||
- value: "CRITICAL"
|
||||
description: "CRITICAL"
|
||||
- variable: email_settings
|
||||
label: 'Show Email Settings'
|
||||
- value: INFO
|
||||
description: INFO
|
||||
- value: DEBUG
|
||||
description: DEBUG
|
||||
- value: WARNING
|
||||
description: WARNING
|
||||
- value: ERROR
|
||||
description: ERROR
|
||||
- value: CRITICAL
|
||||
description: CRITICAL
|
||||
- variable: mail
|
||||
label: Email Settings
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if:
|
||||
subquestions:
|
||||
- variable: INVENTREE_EMAIL_BACKEND
|
||||
label: "INVENTREE_EMAIL_BACKEND"
|
||||
description: "Email backend module"
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: backend
|
||||
label: Mail Backend
|
||||
description: Email backend module
|
||||
schema:
|
||||
type: string
|
||||
default: "django.core.mail.backends.smtp.EmailBackend"
|
||||
- variable: INVENTREE_EMAIL_HOST
|
||||
label: "INVENTREE_EMAIL_HOST"
|
||||
description: "Email server host"
|
||||
default: django.core.mail.backends.smtp.EmailBackend
|
||||
- variable: host
|
||||
label: Mail Host
|
||||
description: Email server host
|
||||
schema:
|
||||
type: string
|
||||
default: ""
|
||||
- variable: INVENTREE_EMAIL_PORT
|
||||
label: "INVENTREE_EMAIL_PORT"
|
||||
description: "Email server port"
|
||||
- variable: port
|
||||
label: Mail Port
|
||||
description: Email server port
|
||||
schema:
|
||||
type: int
|
||||
default: 587
|
||||
- variable: INVENTREE_EMAIL_USERNAME
|
||||
label: "INVENTREE_EMAIL_USERNAME"
|
||||
description: "Email account username"
|
||||
- variable: username
|
||||
label: Mail Username
|
||||
description: Email account username
|
||||
schema:
|
||||
type: string
|
||||
default: ""
|
||||
- variable: INVENTREE_EMAIL_PASSWORD
|
||||
label: "INVENTREE_EMAIL_PASSWORD"
|
||||
description: "Email account password"
|
||||
- variable: password
|
||||
label: Mail Password
|
||||
description: Email account password
|
||||
schema:
|
||||
type: string
|
||||
private: true
|
||||
default: ""
|
||||
- variable: INVENTREE_EMAIL_TLS
|
||||
label: "INVENTREE_EMAIL_TLS"
|
||||
description: "Enable TLS support"
|
||||
- variable: tls
|
||||
label: Mail TLS
|
||||
description: Enable TLS support
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: INVENTREE_EMAIL_SSL
|
||||
label: "INVENTREE_EMAIL_SSL"
|
||||
description: "Enable SSL support"
|
||||
- variable: ssl
|
||||
label: Mail SSL
|
||||
description: Enable SSL support
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: INVENTREE_EMAIL_SENDER
|
||||
label: "INVENTREE_EMAIL_SENDER"
|
||||
description: "Name of sender"
|
||||
- variable: sender
|
||||
label: Mail Sender
|
||||
description: Name of sender
|
||||
schema:
|
||||
type: string
|
||||
default: ""
|
||||
@@ -171,7 +175,7 @@ questions:
|
||||
description: "The internal(!) port on the container the Application runs on"
|
||||
schema:
|
||||
type: int
|
||||
default: 8000
|
||||
default: 10231
|
||||
# Include{serviceExpertRoot}
|
||||
default: false
|
||||
# Include{serviceExpert}
|
||||
@@ -220,7 +224,7 @@ questions:
|
||||
label: "runAsNonRoot"
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
default: false
|
||||
# Include{securityContextAdvanced}
|
||||
# Include{podSecurityContextRoot}
|
||||
- variable: runAsUser
|
||||
@@ -228,7 +232,7 @@ questions:
|
||||
description: "The UserID of the user running the application"
|
||||
schema:
|
||||
type: int
|
||||
default: 100
|
||||
default: 0
|
||||
- variable: runAsGroup
|
||||
label: "runAsGroup"
|
||||
description: "The groupID this App of the user running the application"
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
{{/* Define the secrets */}}
|
||||
{{- define "inventree.config" -}}
|
||||
|
||||
{{- $configName := printf "%s-inventree-config" (include "tc.common.names.fullname" .) }}
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ $configName }}
|
||||
labels:
|
||||
{{- include "tc.common.labels" . | nindent 4 }}
|
||||
data:
|
||||
INVENTREE_TIMEZONE: {{ .Values.TZ }}
|
||||
INVENTREE_DB_ENGINE: "postgresql"
|
||||
INVENTREE_DB_NAME: {{ .Values.postgresql.postgresqlDatabase }}
|
||||
INVENTREE_DB_USER: {{ .Values.postgresql.postgresqlUsername }}
|
||||
INVENTREE_DB_HOST: {{ printf "%v-%v" .Release.Name "postgresql" }}
|
||||
INVENTREE_DB_PORT: "5432"
|
||||
INVENTREE_CACHE_PORT: "6379"
|
||||
INVENTREE_WEB_PORT: "8000"
|
||||
{{- with .Values.inventree.mail.backend }}
|
||||
INVENTREE_EMAIL_BACKEND: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.mail.host }}
|
||||
INVENTREE_EMAIL_HOST: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.mail.port }}
|
||||
INVENTREE_EMAIL_PORT: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.mail.username }}
|
||||
INVENTREE_EMAIL_USERNAME: {{ . }}
|
||||
{{- end }}
|
||||
INVENTREE_EMAIL_TLS: '{{ ternary "True" "False" .Values.inventree.mail.tls | default "False" }}'
|
||||
INVENTREE_EMAIL_SSL: '{{ ternary "True" "False" .Values.inventree.mail.ssl | default "False" }}'
|
||||
{{- with .Values.inventree.mail.sender }}
|
||||
INVENTREE_EMAIL_SENDER: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.inventree.general.debug }}
|
||||
INVENTREE_DEBUG: {{ .Values.inventree.general.debug | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.general.log_level }}
|
||||
INVENTREE_LOG_LEVEL: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.inventree.general.plugins_enabled }}
|
||||
INVENTREE_PLUGINS_ENABLED: {{ .Values.inventree.general.plugins_enabled | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.general.login_confirm_days }}
|
||||
INVENTREE_LOGIN_CONFIRM_DAYS: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.general.login_attempts }}
|
||||
INVENTREE_LOGIN_ATTEMPTS: {{ . | quote }}
|
||||
{{- end }}
|
||||
nginx.conf: |-
|
||||
server {
|
||||
listen {{ .Values.service.main.ports.main.port }};
|
||||
real_ip_header proxy_protocol;
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-By $server_addr:$server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header CLIENT_IP $remote_addr;
|
||||
proxy_pass_request_headers on;
|
||||
proxy_redirect off;
|
||||
client_max_body_size 100M;
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
proxy_pass http://localhost:8000;
|
||||
}
|
||||
# Redirect any requests for static files
|
||||
location /static/ {
|
||||
alias /var/www/static/;
|
||||
autoindex on;
|
||||
# Caching settings
|
||||
expires 30d;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
# Redirect any requests for media files
|
||||
location /media/ {
|
||||
alias /var/www/media/;
|
||||
# Media files require user authentication
|
||||
auth_request /auth;
|
||||
}
|
||||
# Use the 'user' API endpoint for auth
|
||||
location /auth {
|
||||
internal;
|
||||
proxy_pass http://localhost:8000/auth/;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
}
|
||||
}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{/* Define the init container */}}
|
||||
{{- define "inventree.init" -}}
|
||||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||
imagePullPolicy: '{{ .Values.image.pullPolicy }}'
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- |-
|
||||
echo "Starting initialization..."
|
||||
cd /home/inventree || exit
|
||||
invoke update
|
||||
echo "Initialization finished!"
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.podSecurityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }}
|
||||
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
|
||||
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: "/home/inventree/data"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: '{{ include "tc.common.names.fullname" . }}-inventree-secret'
|
||||
- configMapRef:
|
||||
name: '{{ include "tc.common.names.fullname" . }}-inventree-config'
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,20 @@
|
||||
{{/* Define the nginx container */}}
|
||||
{{- define "inventree.nginx" -}}
|
||||
image: {{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }}
|
||||
imagePullPolicy: '{{ .Values.nginxImage.pullPolicy }}'
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.podSecurityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }}
|
||||
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
|
||||
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.service.main.ports.main.port }}
|
||||
name: main
|
||||
volumeMounts:
|
||||
- name: inventree-nginx
|
||||
mountPath: "/etc/nginx/conf.d/default.conf"
|
||||
subPath: nginx.conf
|
||||
readOnly: true
|
||||
- name: data
|
||||
mountPath: "/var/www"
|
||||
{{- end -}}
|
||||
@@ -1,20 +1,35 @@
|
||||
{{/* Define the secrets */}}
|
||||
{{- define "inventree.secrets" -}}
|
||||
---
|
||||
|
||||
{{- $secretName := printf "%s-inventree-secret" (include "tc.common.names.fullname" .) }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: Opaque
|
||||
metadata:
|
||||
name: inventree-secrets
|
||||
{{- $inventreeprevious := lookup "v1" "Secret" .Release.Namespace "inventree-secrets" }}
|
||||
{{- $secret_key := "" }}
|
||||
name: {{ $secretName }}
|
||||
labels:
|
||||
{{- include "tc.common.labels" . | nindent 4 }}
|
||||
data:
|
||||
{{- if $inventreeprevious}}
|
||||
INVENTREE_SECRET_KEY: {{ index $inventreeprevious.data "INVENTREE_SECRET_KEY" }}
|
||||
{{- with lookup "v1" "Secret" .Release.Namespace $secretName }}
|
||||
INVENTREE_SECRET_KEY: {{ index .data "INVENTREE_SECRET_KEY" }}
|
||||
{{- else }}
|
||||
{{- $secret_key := randAlphaNum 32 }}
|
||||
INVENTREE_SECRET_KEY: {{ $secret_key | b64enc }}
|
||||
INVENTREE_SECRET_KEY: {{ randAlphaNum 32 | b64enc }}
|
||||
{{- end }}
|
||||
INVENTREE_DB_PASSWORD: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" | b64enc }}
|
||||
{{- $redisPass := .Values.redis.redisPassword | trimAll "\"" }}
|
||||
INVENTREE_CACHE_HOST: {{ printf "%v:%v@%v-redis" .Values.redis.redisUsername $redisPass .Release.Name | b64enc }}
|
||||
{{- with .Values.inventree.credentials.admin_mail }}
|
||||
INVENTREE_ADMIN_EMAIL: {{ . | b64enc }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.credentials.admin_user }}
|
||||
INVENTREE_ADMIN_USER: {{ . | b64enc }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.credentials.admin_password }}
|
||||
INVENTREE_ADMIN_PASSWORD: {{ . | b64enc }}
|
||||
{{- end }}
|
||||
{{- with .Values.inventree.mail.password }}
|
||||
INVENTREE_EMAIL_PASSWORD: {{ . | b64enc }}
|
||||
{{- end }}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{{/* Define the worker container */}}
|
||||
{{- define "inventree.worker" -}}
|
||||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||
imagePullPolicy: '{{ .Values.image.pullPolicy }}'
|
||||
command: ["invoke", "worker"]
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.podSecurityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }}
|
||||
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
|
||||
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: "/home/inventree/data"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: '{{ include "tc.common.names.fullname" . }}-inventree-secret'
|
||||
- configMapRef:
|
||||
name: '{{ include "tc.common.names.fullname" . }}-inventree-config'
|
||||
{{- end -}}
|
||||
@@ -4,5 +4,12 @@
|
||||
{{/* Render secrets for inventree */}}
|
||||
{{- include "inventree.secrets" . }}
|
||||
|
||||
{{/* Render config for inventree */}}
|
||||
{{- include "inventree.config" . }}
|
||||
|
||||
{{- $_ := set .Values.initContainers "init" (include "inventree.init" . | fromYaml) -}}
|
||||
{{- $_ := set .Values.additionalContainers "nginx" (include "inventree.nginx" . | fromYaml) -}}
|
||||
{{- $_ := set .Values.additionalContainers "worker" (include "inventree.worker" . | fromYaml) -}}
|
||||
|
||||
{{/* Render the templates */}}
|
||||
{{ include "tc.common.loader.apply" . }}
|
||||
|
||||
@@ -9,225 +9,57 @@ nginxImage:
|
||||
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: false
|
||||
|
||||
runAsNonRoot: false
|
||||
# https://github.com/inventree/InvenTree/pull/3096
|
||||
podSecurityContext:
|
||||
runAsUser: 100
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
|
||||
secretEnv:
|
||||
INVENTREE_ADMIN_EMAIL: "test@example.com"
|
||||
INVENTREE_ADMIN_USER: "testuser"
|
||||
INVENTREE_ADMIN_PASSWORD: "secret"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: '{{ include "tc.common.names.fullname" . }}-inventree-secret'
|
||||
- configMapRef:
|
||||
name: '{{ include "tc.common.names.fullname" . }}-inventree-config'
|
||||
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
data:
|
||||
nginx-config: |-
|
||||
server {
|
||||
listen 10231;
|
||||
real_ip_header proxy_protocol;
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-By $server_addr:$server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header CLIENT_IP $remote_addr;
|
||||
proxy_pass_request_headers on;
|
||||
proxy_redirect off;
|
||||
client_max_body_size 100M;
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
proxy_pass http://localhost:8000;
|
||||
}
|
||||
# Redirect any requests for static files
|
||||
location /static/ {
|
||||
alias /var/www/static/;
|
||||
autoindex on;
|
||||
# Caching settings
|
||||
expires 30d;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
# Redirect any requests for media files
|
||||
location /media/ {
|
||||
alias /var/www/media/;
|
||||
# Media files require user authentication
|
||||
auth_request /auth;
|
||||
}
|
||||
# Use the 'user' API endpoint for auth
|
||||
location /auth {
|
||||
internal;
|
||||
proxy_pass http://localhost:8000/auth/;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
env:
|
||||
INVENTREE_TIMEZONE: "{{ .Values.TZ }}"
|
||||
INVENTREE_DB_ENGINE: "postgresql"
|
||||
INVENTREE_DB_NAME: "{{ .Values.postgresql.postgresqlDatabase }}"
|
||||
INVENTREE_DB_USER: "{{ .Values.postgresql.postgresqlUsername }}"
|
||||
INVENTREE_DB_PORT: "5432"
|
||||
INVENTREE_CACHE_PORT: "6379"
|
||||
INVENTREE_CACHE_HOST:
|
||||
secretKeyRef:
|
||||
name: rediscreds
|
||||
key: plainhostpass
|
||||
INVENTREE_DB_HOST:
|
||||
secretKeyRef:
|
||||
name: dbcreds
|
||||
key: plainhost
|
||||
INVENTREE_DB_PASSWORD:
|
||||
secretKeyRef:
|
||||
name: dbcreds
|
||||
key: postgresql-password
|
||||
INVENTREE_SECRET_KEY:
|
||||
secretKeyRef:
|
||||
name: inventree-secrets
|
||||
key: INVENTREE_SECRET_KEY
|
||||
# User Defined
|
||||
INVENTREE_DEBUG: false
|
||||
INVENTREE_LOG_LEVEL: "INFO"
|
||||
INVENTREE_PLUGINS_ENABLED: false
|
||||
INVENTREE_LOGIN_CONFIRM_DAYS: 3
|
||||
INVENTREE_LOGIN_ATTEMPTS: 5
|
||||
# INVENTREE_EMAIL_BACKEND: "django.core.mail.backends.smtp.EmailBackend"
|
||||
# INVENTREE_EMAIL_HOST: ""
|
||||
# INVENTREE_EMAIL_PORT: 587
|
||||
# INVENTREE_EMAIL_USERNAME: ""
|
||||
# INVENTREE_EMAIL_PASSWORD: ""
|
||||
# INVENTREE_EMAIL_TLS: False
|
||||
# INVENTREE_EMAIL_SSL: False
|
||||
# INVENTREE_EMAIL_SENDER: ""
|
||||
inventree:
|
||||
credentials:
|
||||
admin_mail: "test@example.com"
|
||||
admin_user: "testuser"
|
||||
admin_password: "secret"
|
||||
general:
|
||||
debug: false
|
||||
log_level: "INFO"
|
||||
plugins_enabled: false
|
||||
login_confirm_days: 3
|
||||
login_attempts: 5
|
||||
mail:
|
||||
backend: "django.core.mail.backends.smtp.EmailBackend"
|
||||
host: ""
|
||||
port: 587
|
||||
username: ""
|
||||
password: ""
|
||||
tls: false
|
||||
ssl: false
|
||||
sender: ""
|
||||
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
main:
|
||||
port: 10231
|
||||
targetPort: 10231
|
||||
|
||||
persistence:
|
||||
data:
|
||||
enabled: true
|
||||
mountPath: "/home/inventree/data"
|
||||
inventree-config:
|
||||
inventree-nginx:
|
||||
enabled: "true"
|
||||
mountPath: "/etc/nginx/nginx.conf"
|
||||
subPath: "nginx-confing"
|
||||
noMount: true
|
||||
subPath: "nginx.conf"
|
||||
type: "custom"
|
||||
volumeSpec:
|
||||
configMap:
|
||||
name: '{{ printf "%v-config" (include "tc.common.names.fullname" .) }}'
|
||||
|
||||
initContainers:
|
||||
init-migrate:
|
||||
name: init-migrate
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
securityContext:
|
||||
runAsUser: "{{ .Values.podSecurityContext.runAsUser }}"
|
||||
runAsGroup: "{{ .Values.podSecurityContext.runAsGroup }}"
|
||||
runAsNonRoot: true
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: "/home/inventree/data"
|
||||
env:
|
||||
- name: INVENTREE_DB_ENGINE
|
||||
value: "postgresql"
|
||||
- name: INVENTREE_DB_NAME
|
||||
value: "{{ .Values.postgresql.postgresqlDatabase }}"
|
||||
- name: INVENTREE_DB_USER
|
||||
value: "{{ .Values.postgresql.postgresqlUsername }}"
|
||||
- name: INVENTREE_DB_PORT
|
||||
value: "5432"
|
||||
- name: INVENTREE_CACHE_PORT
|
||||
value: "6379"
|
||||
- name: INVENTREE_CACHE_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rediscreds
|
||||
key: plainhostpass
|
||||
- name: INVENTREE_DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dbcreds
|
||||
key: plainhost
|
||||
- name: INVENTREE_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dbcreds
|
||||
key: postgresql-password
|
||||
- name: INVENTREE_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: inventree-secrets
|
||||
key: INVENTREE_SECRET_KEY
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- |-
|
||||
cd /home/inventree;
|
||||
invoke update;
|
||||
additionalContainers:
|
||||
nginx:
|
||||
name: nginx
|
||||
image: "{{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }}"
|
||||
ports:
|
||||
- containerPort: 10231
|
||||
name: main
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
runAsGroup: 100
|
||||
readOnlyRootFilesystem: false
|
||||
runAsNonRoot: false
|
||||
volumeMounts:
|
||||
- name: inventree-config
|
||||
mountPath: "/etc/nginx/conf.d/default.conf"
|
||||
subPath: nginx-config
|
||||
readOnly: true
|
||||
- name: data
|
||||
mountPath: "/var/www"
|
||||
worker:
|
||||
name: worker
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
command: ["invoke", "worker"]
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: "/home/inventree/data"
|
||||
env:
|
||||
- name: INVENTREE_DB_ENGINE
|
||||
value: "postgresql"
|
||||
- name: INVENTREE_DB_NAME
|
||||
value: "{{ .Values.postgresql.postgresqlDatabase }}"
|
||||
- name: INVENTREE_DB_USER
|
||||
value: "{{ .Values.postgresql.postgresqlUsername }}"
|
||||
- name: INVENTREE_DB_PORT
|
||||
value: "5432"
|
||||
- name: INVENTREE_CACHE_PORT
|
||||
value: "6379"
|
||||
- name: INVENTREE_CACHE_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rediscreds
|
||||
key: plainhostpass
|
||||
- name: INVENTREE_DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dbcreds
|
||||
key: plainhost
|
||||
- name: INVENTREE_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dbcreds
|
||||
key: postgresql-password
|
||||
- name: INVENTREE_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: inventree-secrets
|
||||
key: INVENTREE_SECRET_KEY
|
||||
name: '{{ include "tc.common.names.fullname" . }}-inventree-config'
|
||||
|
||||
postgresql:
|
||||
enabled: true
|
||||
@@ -238,6 +70,7 @@ postgresql:
|
||||
redis:
|
||||
enabled: true
|
||||
existingSecret: "rediscreds"
|
||||
redisUsername: default
|
||||
|
||||
portal:
|
||||
enabled: true
|
||||
|
||||
@@ -50,6 +50,7 @@ words:
|
||||
- ingressroutetcps
|
||||
- ingressrouteudps
|
||||
- integrationsenabled
|
||||
- inventree
|
||||
- ipaddr
|
||||
- ixcert
|
||||
- ixsystems
|
||||
|
||||
Reference in New Issue
Block a user