feat(mealie): Adapt to the new multi container upstream release (#3858)

* feat(mealie): Adapt to the new multi container upstream release

* update UI a bit

* finish UI

* well... also render things

* fix configmap and pin images

* quote

* port

* handle int...

* moar ints

* test again

* don't change api_port due to an upstream bug (?)

* test

* whops

* default port

* /docs is used for healthcheck (even by the Dockerfile it self)

* http probe on frontend
This commit is contained in:
Stavros Kois
2022-09-24 02:26:26 +03:00
committed by GitHub
parent df5227ba99
commit 8d1917982e
8 changed files with 648 additions and 51 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ name: mealie
sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/mealie
- https://github.com/hay-kot/mealie
version: 9.0.3
version: 10.0.0
annotations:
truecharts.org/catagories: |
- utilities
+337 -23
View File
@@ -12,12 +12,297 @@ questions:
# Include{recreate}
# Include{controllerExpert}
# Include{controllerExpertExtraArgs}
# Docker specific env
- variable: mealie_frontend
group: Container Configuration
label: Mealie Frontend Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: theme
label: Theme
schema:
additional_attrs: true
type: dict
attrs:
- variable: light_primary
label: Light Primary
description: Light Theme Config Variable
schema:
type: string
default: "#E58325"
- variable: light_accent
label: Light Accent
description: Light Theme Config Variable
schema:
type: string
default: "#007A99"
- variable: light_secondary
label: Light Secondary
description: Light Theme Config Variable
schema:
type: string
default: "#973542"
- variable: light_success
label: Light Success
description: Light Theme Config Variable
schema:
type: string
default: "#43A047"
- variable: light_info
label: Light Info
description: Light Theme Config Variable
schema:
type: string
default: "#1976D2"
- variable: light_warning
label: Light Warning
description: Light Theme Config Variable
schema:
type: string
default: "#FF6D00"
- variable: light_error
label: Light Error
description: Light Theme Config Variable
schema:
type: string
default: "#EF5350"
- variable: dark_primary
label: Dark Primary
description: Dark Theme Config Variable
schema:
type: string
default: "#E58325"
- variable: dark_accent
label: Dark Accent
description: Dark Theme Config Variable
schema:
type: string
default: "#007A99"
- variable: dark_secondary
label: Dark Secondary
description: Dark Theme Config Variable
schema:
type: string
default: "#973542"
- variable: dark_success
label: Dark Success
description: Dark Theme Config Variable
schema:
type: string
default: "#43A047"
- variable: dark_info
label: Dark Info
description: Dark Theme Config Variable
schema:
type: string
default: "#1976D2"
- variable: dark_warning
label: Dark Warning
description: Dark Theme Config Variable
schema:
type: string
default: "#FF6D00"
- variable: dark_error
label: Dark Error
description: Dark Theme Config Variable
schema:
type: string
default: "#EF5350"
- variable: mealie_frontend
group: Container Configuration
label: Mealie Frontend Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: general
label: General
schema:
additional_attrs: true
type: dict
attrs:
- variable: allow_signup
label: Allow Sign up
description: Allow user sign-up without token
schema:
type: boolean
default: true
- variable: default_group
label: Default Group
description: The default group for users
schema:
type: string
default: Home
- variable: default_email
label: Default Email
description: The default username for the superuser
schema:
type: string
default: changeme@email.com
- variable: base_url
label: Base URL
description: Used for Notifications
schema:
type: string
default: ""
- variable: token_time
label: Token Time
description: The time in hours that a login/auth token is valid
schema:
type: int
default: 48
- variable: security
label: Security
schema:
additional_attrs: true
type: dict
attrs:
- variable: max_login_attempts
label: Max Login Attempts
description: Maximum times a user can provide an invalid password before their account is locked
schema:
type: int
default: 5
- variable: user_lockout_time
label: User Lockout Time
description: Time in hours for how long a users account is locked
schema:
type: int
default: 24
- variable: webworkers
label: Web Workers
schema:
additional_attrs: true
type: dict
attrs:
- variable: workers_per_core
label: Workers Per Core
description: Set the number of workers to the number of CPU cores multiplied by this value.
schema:
type: int
default: 1
- variable: max_workers
label: Max Workers
description: Set the maximum number of workers to use. Default is not set meaning unlimited.
schema:
type: int
default: 1
- variable: web_concurrency
label: Web Concurrency
description: Override the automatic definition of number of workers.
schema:
type: int
default: 1
- variable: smtp
label: SMTP
schema:
additional_attrs: true
type: dict
attrs:
- variable: user
label: User
description: Mail User
schema:
type: string
default: ""
- variable: password
label: Password
description: Mail Password
schema:
type: string
private: true
default: ""
- variable: host
label: Host
description: Mail Host
schema:
type: string
default: ""
- variable: port
label: Port
description: Mail Port
schema:
type: int
default: 587
- variable: from_name
label: From Name
description: Mail From Name
schema:
type: string
default: Mealie
- variable: from_email
label: From Email
description: Mail From Email
schema:
type: string
default: ""
- variable: auth_strategy
label: Auth Strategy
description: Mail Auth Strategy
schema:
type: string
default: "TLS"
enum:
- value: TLS
description: TLS
- value: SSL
description: SSL
- value: NONE
description: NONE
- variable: ldap
label: LDAP
schema:
additional_attrs: true
type: dict
attrs:
- variable: auth_enabled
label: Auth Enabled
description: Authenticate via an external LDAP server in addition to built-in Mealie auth
schema:
type: boolean
default: false
- variable: server_url
label: Server URL
description: LDAP server URL
schema:
type: string
default: ""
- variable: tls_insecure
label: TLS Insecure
description: Do not verify server certificate when using secure LDAP
schema:
type: boolean
default: false
- variable: tls_cacertfile
label: TLS CA Cert File
description: File path to Certificate Authority used to verify server certificate
schema:
type: string
default: ""
- variable: bind_template
label: Bind Template
description: Templated DN for users, {} will be replaced with the username.
schema:
type: string
default: ""
- variable: base_dn
label: Base DN
description: Starting point when searching for users authentication.
schema:
type: string
default: ""
- variable: admin_filter
label: Admin Filter
description: Optional LDAP filter, which tells Mealie the LDAP user .is an admin
schema:
type: string
default: ""
# Include{containerConfig}
# Include{serviceRoot}
- variable: main
label: "Main Service"
description: "The Primary service on which the healthcheck runs, often the webUI"
label: Main Service
description: The Primary service on which the healthcheck runs, often the webUI
schema:
additional_attrs: true
type: dict
@@ -25,33 +310,62 @@ questions:
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
label: "Main Service Port Configuration"
label: Main Service Port Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
label: Port
description: This port exposes the container port on the service
schema:
type: int
default: 10018
required: true
# Include{advancedPortHTTP}
- variable: targetPort
label: "Target Port"
description: "The internal(!) port on the container the Application runs on"
label: Target Port
description: The internal(!) port on the container the Application runs on
schema:
type: int
default: 80
default: 3000
- variable: api
label: API Service
description: The API Service
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceSelectorClusterIP}
# Include{serviceSelectorExtras}
- variable: api
label: API Service Port Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: Port
description: This port exposes the container port on the service
schema:
type: int
default: 10019
required: true
# Include{advancedPortHTTP}
- variable: targetPort
label: Target Port
description: The internal(!) port on the container the Application runs on
schema:
type: int
default: 9000
# Include{serviceExpertRoot}
default: false
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: config
label: "App Config Storage"
description: "Stores the Application Configuration."
- variable: data
label: App Data Storage
description: Stores the Application Data.
schema:
additional_attrs: true
type: dict
@@ -61,7 +375,7 @@ questions:
# Include{persistenceList}
# Include{ingressRoot}
- variable: main
label: "Main Ingress"
label: Main Ingress
schema:
additional_attrs: true
type: dict
@@ -74,42 +388,42 @@ questions:
# Include{security}
# Include{securityContextAdvancedRoot}
- variable: privileged
label: "Privileged mode"
label: Privileged mode
schema:
type: boolean
default: false
- variable: readOnlyRootFilesystem
label: "ReadOnly Root Filesystem"
label: ReadOnly Root Filesystem
schema:
type: boolean
default: false
- variable: allowPrivilegeEscalation
label: "Allow Privilege Escalation"
label: Allow Privilege Escalation
schema:
type: boolean
default: false
- variable: runAsNonRoot
label: "runAsNonRoot"
label: runAsNonRoot
schema:
type: boolean
default: false
# Include{securityContextAdvanced}
# Include{podSecurityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
label: runAsUser
description: The UserID of the user running the application
schema:
type: int
default: 0
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID this App of the user running the application"
label: runAsGroup
description: The groupID this App of the user running the application
schema:
type: int
default: 0
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
label: fsGroup
description: The group that should own ALL storage.
schema:
type: int
default: 568
+44
View File
@@ -0,0 +1,44 @@
{{- define "mealie.api" -}}
image: {{ .Values.apiImage.repository }}:{{ .Values.apiImage.tag }}
imagePullPolicy: {{ .Values.apiImage.pullPolicy }}
securityContext:
runAsUser: {{ .Values.podSecurityContext.runAsUser }}
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }}
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
envFrom:
- secretRef:
name: '{{ include "tc.common.names.fullname" . }}-api-secret'
- configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-api-config'
volumeMounts:
- name: data
mountPath: "/app/data"
readinessProbe:
httpGet:
path: /docs
port: {{ .Values.service.api.ports.api.targetPort }}
{{/* port: {{ .Values.service.api.ports.api.targetPort }} */}}
initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }}
timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }}
periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }}
failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }}
livenessProbe:
httpGet:
path: /docs
port: {{ .Values.service.api.ports.api.targetPort }}
{{/* port: {{ .Values.service.api.ports.api.targetPort }} */}}
initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }}
timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }}
periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }}
failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }}
startupProbe:
httpGet:
path: /docs
port: {{ .Values.service.api.ports.api.targetPort }}
{{/* port: {{ .Values.service.api.ports.api.targetPort }} */}}
initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }}
timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }}
periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }}
failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }}
{{- end -}}
@@ -0,0 +1,135 @@
{{/* Define the configmap */}}
{{- define "mealie.config" -}}
{{- $frontendConfigName := printf "%s-frontend-config" (include "tc.common.names.fullname" .) }}
{{- $apiConfigName := printf "%s-api-config" (include "tc.common.names.fullname" .) }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $frontendConfigName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
API_URL: http://localhost:{{ .Values.service.api.ports.api.targetPort }}
{{/* https://github.com/hay-kot/mealie/issues/1666 */}}
{{/* API_URL: http://localhost:{{ .Values.service.api.ports.api.port }} */}}
THEME_LIGHT_PRIMARY: {{ .Values.mealie_frontend.theme.light_primary | default "#E58325" | quote }}
THEME_LIGHT_ACCENT: {{ .Values.mealie_frontend.theme.light_accent | default "#007A99" | quote }}
THEME_LIGHT_SECONDARY: {{ .Values.mealie_frontend.theme.light_secondary | default "#973542" | quote }}
THEME_LIGHT_SUCCESS: {{ .Values.mealie_frontend.theme.light_success | default "#43A047" | quote }}
THEME_LIGHT_INFO: {{ .Values.mealie_frontend.theme.light_info | default "#1976D2" | quote }}
THEME_LIGHT_WARNING: {{ .Values.mealie_frontend.theme.light_warning | default "#FF6D00" | quote }}
THEME_LIGHT_ERROR: {{ .Values.mealie_frontend.theme.light_error | default "#EF5350" | quote }}
THEME_DARK_PRIMARY: {{ .Values.mealie_frontend.theme.dark_primary | default "#E58325" | quote }}
THEME_DARK_ACCENT: {{ .Values.mealie_frontend.theme.dark_accent | default "#007A99" | quote }}
THEME_DARK_SECONDARY: {{ .Values.mealie_frontend.theme.dark_secondary | default "#973542" | quote }}
THEME_DARK_SUCCESS: {{ .Values.mealie_frontend.theme.dark_success | default "#43A047" | quote }}
THEME_DARK_INFO: {{ .Values.mealie_frontend.theme.dark_info | default "#1976D2" | quote }}
THEME_DARK_WARNING: {{ .Values.mealie_frontend.theme.dark_warning | default "#FF6D00" | quote }}
THEME_DARK_ERROR: {{ .Values.mealie_frontend.theme.dark_error | default "#EF5350" | quote }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $apiConfigName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
PUID: {{ .Values.security.PUID | quote }}
PGID: {{ .Values.podSecurityContext.fsGroup | quote }}
TZ: {{ .Values.TZ }}
DB_ENGINE: "postgres"
POSTGRES_PORT: "5432"
POSTGRES_USER: {{ .Values.postgresql.postgresqlUsername }}
POSTGRES_DB: {{ .Values.postgresql.postgresqlDatabase }}
POSTGRES_SERVER: {{ printf "%v-%v" .Release.Name "postgresql" }}
API_PORT: {{ .Values.service.api.ports.api.targetPort | quote }}
{{/* https://github.com/hay-kot/mealie/issues/1666 */}}
{{/* API_PORT: {{ .Values.service.api.ports.api.port | quote }} */}}
{{/* User Defined */}}
{{/* General */}}
ALLOW_SIGNUP: {{ .Values.mealie_backend.general.allow_signup | quote }}
API_DOCS: "true"
{{- with .Values.mealie_backend.general.default_group }}
DEFAULT_GROUP: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.general.default_email }}
DEFAULT_EMAIL: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.general.base_url }}
BASE_URL: {{ . }}
{{- end }}
{{- if hasKey .Values.mealie_backend.general "token_time" }}
{{- if or .Values.mealie_backend.general.token_time (eq 0 (int .Values.mealie_backend.general.token_time)) }}
TOKEN_TIME: {{ .Values.mealie_backend.general.token_time | quote }}
{{- end }}
{{- end }}
{{/* Security */}}
{{- if hasKey .Values.mealie_backend.security "max_login_attempts" }}
{{- if or .Values.mealie_backend.security.max_login_attempts (eq 0 (int .Values.mealie_backend.security.max_login_attempts)) }}
SECURITY_MAX_LOGIN_ATTEMPTS: {{ .Values.mealie_backend.security.max_login_attempts | quote }}
{{- end }}
{{- end }}
{{- if hasKey .Values.mealie_backend.security "user_lockout_time" }}
{{- if or .Values.mealie_backend.security.user_lockout_time (eq 0 (int .Values.mealie_backend.security.user_lockout_time)) }}
SECURITY_USER_LOCKOUT_TIME: {{ .Values.mealie_backend.security.user_lockout_time | quote }}
{{- end }}
{{- end }}
{{/* Security */}}
{{- if hasKey .Values.mealie_backend.webworkers "workers_per_core" }}
{{- if or .Values.mealie_backend.webworkers.workers_per_core (eq 0 (int .Values.mealie_backend.webworkers.workers_per_core)) }}
WORKERS_PER_CORE: {{ .Values.mealie_backend.webworkers.workers_per_core | quote }}
{{- end }}
{{- end }}
{{- if hasKey .Values.mealie_backend.webworkers "max_workers" }}
{{- if or .Values.mealie_backend.webworkers.max_workers (eq 0 (int .Values.mealie_backend.webworkers.max_workers)) }}
MAX_WORKERS: {{ .Values.mealie_backend.webworkers.max_workers | quote }}
{{- end }}
{{- end }}
{{- if hasKey .Values.mealie_backend.webworkers "web_concurrency" }}
{{- if or .Values.mealie_backend.webworkers.web_concurrency (eq 0 (int .Values.mealie_backend.webworkers.web_concurrency)) }}
WEB_CONCURRENCY: {{ .Values.mealie_backend.webworkers.web_concurrency | quote }}
{{- end }}
{{- end }}
{{/* SMTP */}}
{{- if hasKey .Values.mealie_backend.smtp "port" }}
{{- if or .Values.mealie_backend.smtp.port (eq 0 (int .Values.mealie_backend.smtp.port)) }}
SMTP_PORT: {{ .Values.mealie_backend.smtp.port | quote }}
{{- end }}
{{- end }}
{{- with .Values.mealie_backend.smtp.host }}
SMTP_HOST: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.smtp.from_name }}
SMTP_FROM_NAME: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.smtp.auth_strategy }}
SMTP_AUTH_STRATEGY: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.smtp.from_email }}
SMTP_FROM_EMAIL: {{ . }}
{{- end }}
{{/* SMTP */}}
LDAP_AUTH_ENABLED: {{ .Values.mealie_backend.ldap.auth_enabled | quote }}
LDAP_TLS_INSECURE: {{ .Values.mealie_backend.ldap.tls_insecure | quote }}
{{- with .Values.mealie_backend.ldap.server_url }}
LDAP_SERVER_URL: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.ldap.tls_cacertfile }}
LDAP_TLS_CACERTFILE: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.ldap.bind_template }}
LDAP_BIND_TEMPLATE: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.ldap.base_dn }}
LDAP_BASE_DN: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.ldap.admin_filter }}
LDAP_ADMIN_FILTER: {{ . }}
{{- end }}
{{- end -}}
@@ -0,0 +1,24 @@
{{/* Define the secret */}}
{{- define "mealie.secret" -}}
{{- $apiSecretName := printf "%s-api-secret" (include "tc.common.names.fullname" .) }}
---
{{/* This secrets are loaded on both main authentik container and worker */}}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ $apiSecretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
POSTGRES_PASSWORD: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" | b64enc }}
{{- with .Values.mealie_backend.smtp.user | b64enc }}
SMTP_USER: {{ . }}
{{- end }}
{{- with .Values.mealie_backend.smtp.password | b64enc }}
SMTP_PASSWORD: {{ . }}
{{- end }}
{{- end }}
+13 -1
View File
@@ -1 +1,13 @@
{{ include "tc.common.loader.all" . }}
{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{/* Render secret */}}
{{- include "mealie.secret" . }}
{{/* Render config */}}
{{- include "mealie.config" . }}
{{- $_ := set .Values.additionalContainers "api" (include "mealie.api" . | fromYaml) -}}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}
+92 -26
View File
@@ -1,6 +1,11 @@
image:
repository: tccr.io/truecharts/mealie
tag: v0.5.6@sha256:e54cf37a3da0d6853197c200ddbb858de03e0f12752c1f862856376b0733af0a
repository: tccr.io/truecharts/mealie-frontend
tag: v1.0.0beta@sha256:be031b8c1c6a1698f18e7750a1482ca85f6c311bbb594cf8da46d0e206b0729a
pullPolicy: IfNotPresent
apiImage:
repository: tccr.io/truecharts/mealie-api
tag: v1.0.0beta@sha256:4dad1521060d896c2e4782f57ca48007e831b2df497746637eb8f2d6a4a23c90
pullPolicy: IfNotPresent
securityContext:
@@ -11,18 +16,91 @@ podSecurityContext:
runAsUser: 0
runAsGroup: 0
env:
DB_ENGINE: postgres
POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}"
POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}"
POSTGRES_PASSWORD:
secretKeyRef:
name: dbcreds
key: postgresql-password
POSTGRES_SERVER:
secretKeyRef:
name: dbcreds
key: plainporthost
mealie_frontend:
theme:
light_primary: "#E58325"
light_accent: "#007A99"
light_secondary: "#973542"
light_success: "#43A047"
light_info: "#1976D2"
light_warning: "#FF6D00"
light_error: "#EF5350"
dark_primary: "#E58325"
dark_accent: "#007A99"
dark_secondary: "#973542"
dark_success: "#43A047"
dark_info: "#1976D2"
dark_warning: "#FF6D00"
dark_error: "#EF5350"
mealie_backend:
general:
allow_signup: true
default_group: Home
default_email: changeme@email.com
base_url: ""
token_time: 48
security:
max_login_attempts: 5
user_lockout_time: 24
webworkers:
workers_per_core: 1
max_workers: 1
web_concurrency: 1
smtp:
user: ""
password: ""
host: ""
port: 587
from_name: Mealie
from_email: ""
# TLS | SSL | NONE
auth_strategy: TLS
ldap:
auth_enabled: false
server_url: ""
tls_insecure: false
tls_cacertfile: ""
bind_template: ""
base_dn: ""
admin_filter: ""
envFrom:
- configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-frontend-config'
probes:
liveness:
type: HTTP
path: "/"
readiness:
type: HTTP
path: "/"
startup:
type: HTTP
path: "/"
service:
main:
ports:
main:
port: 10018
protocol: HTTP
targetPort: 3000
api:
enabled: true
type: ClusterIP
ports:
api:
enabled: true
protocol: HTTP
port: 10019
targetPort: 9000
persistence:
data:
enabled: true
mountPath: "/app/data"
postgresql:
enabled: true
@@ -30,17 +108,5 @@ postgresql:
postgresqlUsername: mealie
postgresqlDatabase: mealie
service:
main:
ports:
main:
port: 10018
targetPort: 80
persistence:
config:
enabled: true
mountPath: "/app/data"
portal:
enabled: true
+2
View File
@@ -209,6 +209,7 @@ words:
- serverstransports
- serviceexpert
- sgateway
- signup
- smallblock
- somefile
- somethingelse
@@ -259,6 +260,7 @@ words:
- webpanel
- websecure
- websockets
- webworkers
- weejewel
- wger
- whisparr