diff --git a/stable/datacube-data/Chart.yaml b/stable/datacube-data/Chart.yaml index 4cc1064..a22bc60 100644 --- a/stable/datacube-data/Chart.yaml +++ b/stable/datacube-data/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for running datacube data management name: datacube-data -version: 0.2.3 +version: 0.2.4 diff --git a/stable/datacube-data/templates/deployment.yaml b/stable/datacube-data/templates/deployment.yaml index bff81b7..49ff019 100644 --- a/stable/datacube-data/templates/deployment.yaml +++ b/stable/datacube-data/templates/deployment.yaml @@ -29,6 +29,20 @@ spec: dnsConfig: options: - name: single-request-reopen + # Copy over WMS config from container image during init + initContainers: +{{- if .Values.wmsConfig.image }} + - name: wms-config + image: "{{ $.Values.wmsConfig.image.repository }}:{{ $.Values.wmsConfig.image.tag }}" + imagePullPolicy: {{ $.Values.wmsConfig.image.pullPolicy }} + args: [ "cp", "-f", "{{ .Values.wmsConfig.image.src }}", "{{ .Values.wmsConfig.path }}/{{ .Values.wmsConfig.filename }}" ] + volumeMounts: + - mountPath: {{ .Values.wmsConfig.path }} + name: wms-config-volume +{{- if .Values.wmsConfig.subpath }} + subPath: {{ .Values.wmsConfig.subpath }} +{{- end }} +{{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -39,8 +53,15 @@ spec: value: {{ .Values.aws_region }} - name: SQS_QUEUE_NAME value: {{ .Values.sqs_queue_name }} + # Merge config URL for download or local file mounted via volume +{{- if .Values.wmsConfig.url }} - name: WMS_CONFIG_URL - value: {{ $dc.wmsConfigURL | quote }} + value: {{ .Values.wmsConfig.url | quote }} +{{- end }} +{{- if or .Values.wmsConfig.configMap .Values.wmsConfig.image }} + - value: "{{ .Values.wmsConfig.path }}/{{ .Values.wmsConfig.filename }}" + name: WMS_CONFIG_PATH +{{- end }} - name: DB_HOSTNAME value: {{ .Values.database.host | quote }} - name: DB_PORT @@ -65,6 +86,12 @@ spec: value: {{ $value | quote }} {{- end }} {{- end }} + # Mount the config volume + volumeMounts: +{{- if or .Values.wmsConfig.configMap .Values.wmsConfig.image }} + - mountPath: {{ .Values.wmsConfig.path }} + name: wms-config-volume +{{- end }} resources: {{ toYaml .Values.resources | indent 12 }} {{- with .Values.nodeSelector }} @@ -75,6 +102,17 @@ spec: affinity: {{ toYaml . | indent 8 }} {{- end }} + # Define the config volume + volumes: +{{- if or .Values.wmsConfig.configMap .Values.wmsConfig.image }} + - name: wms-config-volume +{{- if .Values.wmsConfig.configMap }} + configMap: + name: {{ .Values.wmsConfig.configMap }} +{{- else if .Values.wmsConfig.image }} + emptyDir: {} +{{- end }} +{{- end }} {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 8 }} diff --git a/stable/datacube-data/values.yaml b/stable/datacube-data/values.yaml index d49efc5..d40a5f6 100644 --- a/stable/datacube-data/values.yaml +++ b/stable/datacube-data/values.yaml @@ -45,4 +45,8 @@ tolerations: [] affinity: {} global: - externalDatabase: {} \ No newline at end of file + externalDatabase: {} + +# Image to pull WMS Config from +wmsConfig: + image: { } \ No newline at end of file diff --git a/stable/datacube-index/Chart.yaml b/stable/datacube-index/Chart.yaml index b8cfd54..51baae9 100644 --- a/stable/datacube-index/Chart.yaml +++ b/stable/datacube-index/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Datacube OGC Web Services Indexing name: datacube-index -version: 0.4.1 +version: 0.4.2 keywords: - datacube - http diff --git a/stable/datacube-index/templates/index.yaml b/stable/datacube-index/templates/index.yaml index 75c0d26..207c8d3 100644 --- a/stable/datacube-index/templates/index.yaml +++ b/stable/datacube-index/templates/index.yaml @@ -30,6 +30,18 @@ spec: - name: postgres-listener image: alpine command: ["sh", "-c", "for i in $(seq 1 200); do nc -z -w3 {{ .Values.database.host }} {{ .Values.database.port }} && exit 0 || sleep 3; done; exit 1"] +{{- if .Values.wmsConfig.image }} + - name: wms-config + image: "{{ $.Values.wmsConfig.image.repository }}:{{ $.Values.wmsConfig.image.tag }}" + imagePullPolicy: {{ $.Values.wmsConfig.image.pullPolicy }} + args: [ "cp", "-f", "{{ .Values.wmsConfig.image.src }}", "{{ .Values.wmsConfig.path }}/{{ .Values.wmsConfig.filename }}" ] + volumeMounts: + - mountPath: {{ .Values.wmsConfig.path }} + name: wms-config-volume +{{- if .Values.wmsConfig.subpath }} + subPath: {{ .Values.wmsConfig.subpath }} +{{- end }} +{{- end }} containers: - name: datacube-index image: "{{ $image.repository }}:{{ $image.tag }}" @@ -44,6 +56,10 @@ spec: {{- else }} value: {{ $dc.wmsConfigURL | quote }} {{- end }} +{{- if or .Values.wmsConfig.configMap .Values.wmsConfig.image }} + - value: "{{ .Values.wmsConfig.path }}/{{ .Values.wmsConfig.filename }}" + name: WMS_CONFIG_PATH +{{- end }} {{- if $index.products }} - name: PRODUCT_URLS value: {{ template "helm-toolkit.utils.joinListWithSpace" $index.products }} @@ -103,4 +119,21 @@ spec: value: {{ $value | quote }} {{- end }} {{- end }} + # Mount the config volume + volumeMounts: +{{- if or .Values.wmsConfig.configMap .Values.wmsConfig.image }} + - mountPath: {{ .Values.wmsConfig.path }} + name: wms-config-volume +{{- end }} restartPolicy: Never + # Define the config volume + volumes: +{{- if or .Values.wmsConfig.configMap .Values.wmsConfig.image }} + - name: wms-config-volume +{{- if .Values.wmsConfig.configMap }} + configMap: + name: {{ .Values.wmsConfig.configMap }} +{{- else if .Values.wmsConfig.image }} + emptyDir: {} +{{- end }} +{{- end }} diff --git a/stable/datacube-index/values.yaml b/stable/datacube-index/values.yaml index 6dac017..a87ce40 100644 --- a/stable/datacube-index/values.yaml +++ b/stable/datacube-index/values.yaml @@ -75,3 +75,7 @@ database: host: localhost port: 5432 existingSecret: datacube + +# Image to pull WMS Config from +wmsConfig: + image: { }