From c8b99af1a940b885ef81a6eb202978e69c5ba0fa Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Thu, 24 Feb 2022 20:53:22 +0100 Subject: [PATCH] feat(docker-compose): Add autoloading for compose file (#1958) * feat(docker-compose): Add autoloading for compose file * hmm * hmm2 * longer delay for startup probe --- charts/dev/docker-compose/Chart.yaml | 2 +- charts/dev/docker-compose/questions.yaml | 30 ++++++------------------ charts/dev/docker-compose/values.yaml | 28 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/charts/dev/docker-compose/Chart.yaml b/charts/dev/docker-compose/Chart.yaml index 64593704f87..e94825422d2 100644 --- a/charts/dev/docker-compose/Chart.yaml +++ b/charts/dev/docker-compose/Chart.yaml @@ -20,7 +20,7 @@ name: docker-compose sources: - https://github.com/Jackett/Jackett type: application -version: 0.0.2 +version: 0.0.3 annotations: truecharts.org/catagories: | - docker diff --git a/charts/dev/docker-compose/questions.yaml b/charts/dev/docker-compose/questions.yaml index e7cd20cad6f..a70c9fd2193 100644 --- a/charts/dev/docker-compose/questions.yaml +++ b/charts/dev/docker-compose/questions.yaml @@ -1,28 +1,7 @@ # Include{groups} -portals: - open: - protocols: - - "$kubernetes-resource_configmap_portal_protocol" - host: - - "$kubernetes-resource_configmap_portal_host" - ports: - - "$kubernetes-resource_configmap_portal_port" +portals: {} + questions: - - variable: portal - group: "Container Image" - label: "Configure Portal Button" - schema: - type: dict - hidden: true - attrs: - - variable: enabled - label: "Enable" - description: "enable the portal button" - schema: - hidden: true - editable: false - type: boolean - default: true # Include{global} - variable: controller @@ -84,6 +63,11 @@ questions: type: dict attrs: # Include{fixedEnv} + - variable: COMPOSE_FILE + label: "COMPOSE_FILE" + description: "Path on the host of the composefile you want to load. Supported are paths inside /mnt, /root and /cluster" + schema: + type: string # Include{containerConfig} diff --git a/charts/dev/docker-compose/values.yaml b/charts/dev/docker-compose/values.yaml index 8d2150ca140..6dcb614f90e 100644 --- a/charts/dev/docker-compose/values.yaml +++ b/charts/dev/docker-compose/values.yaml @@ -47,6 +47,27 @@ service: env: DOCKER_TLS_CERTDIR: "/certs" + COMPOSE_FILE: "" + +lifecycle: + postStart: + exec: + command: + - "/bin/sh" + - "-c" + - 'sleep 20 && if [ ${COMPOSE_FILE} ]; then docker-compose up -d -f ${COMPOSE_FILE} && echo "Loading COMPOSE_FILE at location ${COMPOSE_FILE}"; else echo "COMPOSE_FILE not set, not auto-loading compose-file"; fi' + + +probes: + liveness: + spec: + initialDelaySeconds: 30 + readiness: + spec: + initialDelaySeconds: 30 + startup: + spec: + initialDelaySeconds: 30 persistence: varrun: @@ -65,6 +86,13 @@ persistence: mountPath: /root hostPathType: "" readOnly: false + cluster: + enabled: true + type: hostPath + hostPath: /cluster + mountPath: /cluster + hostPathType: "" + readOnly: false docker-certs-ca: enabled: true mountPath: "/config"