From e42532ebe11930bdb9f56e0d368e8dd453706e3f Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Sun, 19 Dec 2021 00:54:40 +0200 Subject: [PATCH] feat(leantime): use official image (#1562) * feat(leantime): use official image * test perms * needs full access * update image --- charts/stable/leantime/Chart.yaml | 2 +- charts/stable/leantime/questions.yaml | 115 ------------------ charts/stable/leantime/templates/_secrets.tpl | 20 +++ charts/stable/leantime/templates/common.yaml | 7 +- charts/stable/leantime/values.yaml | 24 ++-- 5 files changed, 34 insertions(+), 134 deletions(-) create mode 100644 charts/stable/leantime/templates/_secrets.tpl diff --git a/charts/stable/leantime/Chart.yaml b/charts/stable/leantime/Chart.yaml index 0784d7492d8..59ce972154d 100644 --- a/charts/stable/leantime/Chart.yaml +++ b/charts/stable/leantime/Chart.yaml @@ -24,7 +24,7 @@ name: leantime sources: - https://leantime.io/ - https://hub.docker.com/r/nicholaswilde/leantime -version: 0.0.12 +version: 1.0.0 annotations: truecharts.org/catagories: | - management diff --git a/charts/stable/leantime/questions.yaml b/charts/stable/leantime/questions.yaml index a9587308afe..6b2ff75551f 100644 --- a/charts/stable/leantime/questions.yaml +++ b/charts/stable/leantime/questions.yaml @@ -149,64 +149,6 @@ questions: schema: type: int default: 80 - - variable: extra - label: "extra Service" - description: "The extra service " - schema: - type: dict - attrs: -# Include{serviceSelector} - - variable: extra - label: "extra Service Port Configuration" - schema: - type: dict - attrs: - - variable: port - label: "Port" - description: "This port exposes the container port on the service" - schema: - type: int - default: 10118 - required: true - - variable: advanced - label: "Show Advanced settings" - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: enabled - label: "Enable the port" - schema: - type: boolean - default: true - - variable: protocol - label: "Port Type" - schema: - type: string - default: "HTTP" - enum: - - value: HTTP - description: "HTTP" - - value: "HTTPS" - description: "HTTPS" - - value: TCP - description: "TCP" - - value: "UDP" - description: "UDP" - - variable: nodePort - label: "Node Port (Optional)" - description: "This port gets exposed to the node. Only considered when service type is NodePort, Simple or LoadBalancer" - schema: - type: int - min: 9000 - max: 65535 - - variable: targetPort - label: "Target Port" - description: "The internal(!) port on the container the Application runs on" - schema: - type: int - default: 9000 - variable: serviceexpert group: "Networking and Services" @@ -227,63 +169,6 @@ questions: # Include{serviceList} - - variable: persistence - label: "Integrated Persistent Storage" - description: "Integrated Persistent Storage" - group: "Storage and Persistence" - schema: - type: dict - attrs: - - variable: sessions - label: "App sessions Storage" - description: "Stores the Application sessions." - schema: - type: dict - attrs: - - variable: type - label: "Type of Storage" - description: "Sets the persistence type, Anything other than PVC could break rollback!" - schema: - type: string - default: "simplePVC" - enum: - - value: "simplePVC" - description: "PVC (simple)" - - value: "simpleHP" - description: "HostPath (simple)" - - value: "emptyDir" - description: "emptyDir" - - value: "pvc" - description: "pvc" - - value: "hostPath" - description: "hostPath" -# Include{persistenceBasic} - - variable: hostPath - label: "hostPath" - description: "Path inside the container the storage is mounted" - schema: - show_if: [["type", "=", "hostPath"]] - type: hostpath - - variable: medium - label: "EmptyDir Medium" - schema: - show_if: [["type", "=", "emptyDir"]] - type: string - default: "" - enum: - - value: "" - description: "Default" - - value: "Memory" - description: "Memory" -# Include{persistenceAdvanced} - - variable: mountPath - label: "mountPath (Non-editable" - description: "Path inside the container the storage is mounted" - schema: - type: string - default: "/sessions" - editable: false - valid_chars: '^\/([a-zA-Z0-9._-]+(\s?[a-zA-Z0-9._-]+|\/?))+$' # Include{persistenceList} - variable: ingress diff --git a/charts/stable/leantime/templates/_secrets.tpl b/charts/stable/leantime/templates/_secrets.tpl new file mode 100644 index 00000000000..0634831f9e5 --- /dev/null +++ b/charts/stable/leantime/templates/_secrets.tpl @@ -0,0 +1,20 @@ +{{/* Define the secrets */}} +{{- define "leantime.secrets" -}} +--- + +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: leantime-secrets +{{- $leantimeprevious := lookup "v1" "Secret" .Release.Namespace "leantime-secrets" }} +{{- $session_password := "" }} +data: + {{- if $leantimeprevious}} + LEAN_SESSION_PASSWORD: {{ index $leantimeprevious.data "LEAN_SESSION_PASSWORD" }} + {{- else }} + {{- $session_password := randAlphaNum 32 }} + LEAN_SESSION_PASSWORD: {{ $session_password | b64enc | quote }} + {{- end }} + +{{- end -}} diff --git a/charts/stable/leantime/templates/common.yaml b/charts/stable/leantime/templates/common.yaml index 9705d4f5fa6..f967b92d3a2 100644 --- a/charts/stable/leantime/templates/common.yaml +++ b/charts/stable/leantime/templates/common.yaml @@ -1,2 +1,7 @@ +{{- include "common.setup" . }} -{{ include "common.all" . }} +{{/* Render secrets for leantime */}} +{{- include "leantime.secrets" . }} + +{{/* Render the templates */}} +{{ include "common.postSetup" . }} diff --git a/charts/stable/leantime/values.yaml b/charts/stable/leantime/values.yaml index 38b29d96d0e..817384b4c71 100644 --- a/charts/stable/leantime/values.yaml +++ b/charts/stable/leantime/values.yaml @@ -1,20 +1,19 @@ image: repository: tccr.io/truecharts/leantime pullPolicy: IfNotPresent - tag: v2.1.7-ls6@sha256:09f51955b47e8bf7cf8c95b7fa4e023ce2fae4aa15ef42db1568b4c23830b5a6 + tag: v2.1.8@sha256:c2a5025fb6019f0fea9d3d8fb37a52f6a91a7d72117a081b759a1d0762dea513 securityContext: runAsNonRoot: false readOnlyRootFilesystem: false - podSecurityContext: runAsUser: 0 runAsGroup: 0 env: - LEAN_DB_DATABASE: "leantime" - LEAN_DB_USER: leantime + LEAN_DB_DATABASE: "{{ .Values.mariadb.mariadbDatabase }}" + LEAN_DB_USER: "{{ .Values.mariadb.mariadbUsername }}" service: main: @@ -22,19 +21,6 @@ service: main: port: 10117 targetPort: 80 - extra: - enabled: true - ports: - extra: - enabled: true - port: 10118 - targetPort: 9000 - protocol: UDP - -persistence: - sessions: - enabled: true - mountPath: "/sessions" envValueFrom: LEAN_DB_HOST: @@ -45,6 +31,10 @@ envValueFrom: secretKeyRef: name: mariadbcreds key: mariadb-password + LEAN_SESSION_PASSWORD: + secretKeyRef: + name: leantime-secrets + key: LEAN_SESSION_PASSWORD mariadb: enabled: true