From dfb4e63f2b8ba4ec3c6b51ae81bd5642ca9b4fb1 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Tue, 22 Feb 2022 11:15:25 +0200 Subject: [PATCH] feat(pydio-cells): Add db and use official image (#1908) * feat(pydio-cells): Add db and use official image * whoops * try mounting * unique how? * aha * try again * chagne port * bind not binds * add healtheck endpoint * try another host for healthcheck and update questiosn * try with healtch service * try this * add missing quote and tpl port * update image * typo * check output * linr * remove init * yml * fix host * try password * revert to mariadbPassword * try tpl * enable maridb * eof * Let's try! --- charts/stable/pydio-cells/Chart.yaml | 7 +- charts/stable/pydio-cells/questions.yaml | 135 ++++++++++++++++-- .../pydio-cells/templates/_configmap.tpl | 21 +++ .../stable/pydio-cells/templates/common.yaml | 21 ++- charts/stable/pydio-cells/values.yaml | 56 ++++++-- 5 files changed, 212 insertions(+), 28 deletions(-) create mode 100644 charts/stable/pydio-cells/templates/_configmap.tpl diff --git a/charts/stable/pydio-cells/Chart.yaml b/charts/stable/pydio-cells/Chart.yaml index 0da848224c6..e94fbba877a 100644 --- a/charts/stable/pydio-cells/Chart.yaml +++ b/charts/stable/pydio-cells/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 kubeVersion: ">=1.16.0-0" name: pydio-cells -version: 0.0.24 +version: 1.0.0 appVersion: "3.0.4" description: Pydio-cells is the nextgen file sharing platform for organizations. type: application @@ -16,7 +16,10 @@ dependencies: - name: common repository: https://truecharts.org version: 8.16.0 - # condition: +- condition: mariadb.enabled + name: mariadb + repository: https://truecharts.org/ + version: 1.0.71 maintainers: - email: info@truecharts.org name: TrueCharts diff --git a/charts/stable/pydio-cells/questions.yaml b/charts/stable/pydio-cells/questions.yaml index 0d011d955fd..ef0188c43b9 100644 --- a/charts/stable/pydio-cells/questions.yaml +++ b/charts/stable/pydio-cells/questions.yaml @@ -84,14 +84,41 @@ questions: type: dict attrs: # Include{fixedEnv} - - variable: EXTERNALURL - label: "EXTERNALURL" - description: "EXTERNALURL" + - variable: CELLS_EXTERNAL + label: "Cells External URL" + description: "https://cells.mydomain.com" schema: type: string default: "" + - variable: pydioinstall + group: "Container Configuration" + label: "Pydio Cells Initial Configuration" + schema: + additional_attrs: true + type: dict + attrs: + - variable: title + label: "Cells Frontend Title (First install only)" + description: "Cells Frontend title" + schema: + type: string + required: true + default: "My Pydio Cells" + - variable: username + label: "Cells Admin Username (First install only)" + description: "Cells Admin Username" + schema: + type: string + required: true + default: "" + - variable: title + label: "Cells Admin Password (First install only)" + description: "Cells Admin Password" + schema: + type: string + required: true + default: "" # Include{containerConfig} - - variable: service group: "Networking and Services" label: "Configure Service(s)" @@ -158,7 +185,7 @@ questions: description: "The internal(!) port on the container the Application runs on" schema: type: int - default: 8080 + default: 10150 - variable: gprc label: "gprc Service" description: "The gprc service." @@ -247,9 +274,95 @@ questions: additional_attrs: true type: dict attrs: - - variable: config - label: "App Config Storage" - description: "Stores the Application Configuration." + - variable: data + label: "Data Storage" + description: "Stores the Data" + schema: + additional_attrs: true + 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: logs + label: "Logs Storage" + description: "Stores the Logs" + schema: + additional_attrs: true + 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: services + label: "Services Storage" + description: "Stores the Services" schema: additional_attrs: true type: dict @@ -348,7 +461,7 @@ questions: label: "runAsNonRoot" schema: type: boolean - default: false + default: true # Include{securityContextAdvanced} - variable: podSecurityContext @@ -363,13 +476,13 @@ questions: description: "The UserID of the user running the application" schema: type: int - default: 0 + default: 568 - variable: runAsGroup label: "runAsGroup" description: The groupID this App of the user running the application" schema: type: int - default: 0 + default: 568 - variable: fsGroup label: "fsGroup" description: "The group that should own ALL storage." diff --git a/charts/stable/pydio-cells/templates/_configmap.tpl b/charts/stable/pydio-cells/templates/_configmap.tpl new file mode 100644 index 00000000000..330fcd62565 --- /dev/null +++ b/charts/stable/pydio-cells/templates/_configmap.tpl @@ -0,0 +1,21 @@ +{{- define "pydiocells.configmap" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.names.fullname" . }}-install + labels: + {{- include "common.labels" . | nindent 4 }} +data: + pydiocells-install: |- + frontendapplicationtitle: {{ .Values.pydioinstall.title }} + frontendLogin: {{ .Values.pydioinstall.username }} + frontendPassword: {{ .Values.pydioinstall.password }} + frontendRepeatPassword: {{ .Values.pydioinstall.password }} + dbConnectionType: tcp + dbTCPHostname: {{ printf "%v-%v" .Release.Name "mariadb" }} + dbTCPPort: 3306 + dbTCPName: {{ .Values.mariadb.mariadbDatabase }} + dbTCPUser: {{ .Values.mariadb.mariadbUsername }} + dbTCPPassword: {{ .Values.mariadb.mariadbPassword }} +{{- end -}} diff --git a/charts/stable/pydio-cells/templates/common.yaml b/charts/stable/pydio-cells/templates/common.yaml index a6613c2ce21..57c94523e6d 100644 --- a/charts/stable/pydio-cells/templates/common.yaml +++ b/charts/stable/pydio-cells/templates/common.yaml @@ -1 +1,20 @@ -{{ include "common.all" . }} +{{- include "common.setup" . }} + +{{/* Append the hardcoded settings */}} +{{- define "pydiocells.harcodedValues" -}} +persistence: + pydiocells-install: + enabled: "true" + mountPath: "/cells/install.yml" + subPath: "pydiocells-install" + type: "custom" + volumeSpec: + configMap: + name: {{ printf "%v-install" (include "common.names.fullname" .) }} +{{- end -}} +{{- $_ := mergeOverwrite .Values (include "pydiocells.harcodedValues" . | fromYaml) -}} + +{{- include "pydiocells.configmap" . }} + +{{/* Render the templates */}} +{{ include "common.postSetup" . }} diff --git a/charts/stable/pydio-cells/values.yaml b/charts/stable/pydio-cells/values.yaml index d33c137fc5b..c9934887c6c 100644 --- a/charts/stable/pydio-cells/values.yaml +++ b/charts/stable/pydio-cells/values.yaml @@ -1,24 +1,39 @@ image: repository: tccr.io/truecharts/pydio-cells pullPolicy: IfNotPresent - tag: v3.0.4 - -securityContext: - runAsNonRoot: false - -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 + tag: v3.0.4@sha256:81c6f8675ffc243af9ffab5a43da0ed50f33f0c153c352aad027127c3c0318ad env: - PUID: 568 - EXTERNALURL: "" + CELLS_EXTERNAL: "" + CELLS_GRPC_EXTERNAL: "{{ .Values.service.gprc.ports.gprc.targetPort }}" + CELLS_HEALTHCHECK: "{{ .Values.service.main.ports.main.targetPort }}" + CELLS_BIND: "0.0.0.0:{{ .Values.service.main.ports.main.targetPort }}" + CELLS_WORKING_DIR: "/cells" + CELLS_DATA_DIR: "/cells/data" + CELLS_LOG_DIR: "/cells/logs" + CELLS_SERVICES_DIR: "/cells/services" + CELLS_INSTALL_YAML: "/cells/install.yml" + +pydioinstall: + username: "admin" + password: "supersecret" + title: "Pydio Cells" + +probes: + liveness: + path: "/healthcheck" + + readiness: + path: "/healthcheck" + + startup: + path: "/healthcheck" service: main: ports: main: - targetPort: 8080 + targetPort: 10150 port: 10150 gprc: enabled: true @@ -29,8 +44,21 @@ service: port: 33060 persistence: - config: + cells: enabled: true - mountPath: "/config" - varrun: + mountPath: "/cells" + data: enabled: true + mountPath: "/cells/data" + logs: + enabled: true + mountPath: "/cells/logs" + services: + enabled: true + mountPath: "/cells/services" + +mariadb: + enabled: true + mariadbUsername: pydiocells + mariadbDatabase: pydiocells + existingSecret: "mariadbcreds"