EOX GitLab Instance

Commit 5041a034 authored by Fabian Schindler's avatar Fabian Schindler
Browse files

Merge branch 'configuration-overhaul' into 'v2.0'

Configuration overhaul

See merge request !106
parents ef6f0454 fd532069
apiVersion: v2
name: vs
description: A Helm chart for Kubernetes of the View Server (VS)
description: A Helm chart for a Kubernetes deployment of the View Server (VS)
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.4.0
version: 2.0.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
......
{{- toYaml .Values.serviceConfig.harvester | nindent 2 -}}
This diff is collapsed.
......@@ -85,70 +85,55 @@
{{- end -}}
# Check if collection exits in database and initialize database only if not
{{- if .Values.config.collections }}
if python3 manage.py id check {{ index (keys .Values.config.collections) 0 | quote }}; then
echo "Initialize database"
{{- if .Values.dataScheme.collections }}
if python3 manage.py id check {{ index (keys $.Values.dataScheme.collections) 0 | quote }}; then
echo "Initializing database"
python3 manage.py coveragetype import /rgbnir_definition.json \
--traceback
python3 manage.py coveragetype import /def-sentinel-2-l1c-l2a.json \
--traceback
echo "Initializing collection {{ index (keys .Values.config.collections) 0 | squote }}."
{{- if hasKey .Values.config.products "coverages" -}}
# import coverage types
python3 manage.py coveragetype import /rgbnir_definition.json --traceback
echo {{ toJson .Values.config.products.coverages | squote }} | python3 manage.py coveragetype import --in --traceback
python3 manage.py coveragetype import /def-sentinel-2-l1c-l2a.json --traceback
{{- end -}}
{{- range $product_type_name, $product_type := .Values.config.products.types | default dict }}
{{- if $.Values.dataScheme.coverageTypes }}
{{- range $coverageType := $.Values.dataScheme.coverageTypes }}
echo {{- toJson $coverageType | squote }} | python3 manage.py coveragetype import --in --traceback
{{- end }}
{{- end }}
#
# {{ $product_type_name }}
#
{{- range $product_type := $.Values.dataScheme.productTypes | default dict }}
# create the product type
python3 manage.py producttype create {{ $product_type_name | quote }} \
python3 manage.py producttype create {{ $product_type.name | quote }} \
{{ range $coverage_type_name, $coverage_type := $product_type.coverages }}--coverage-type {{ $coverage_type_name | quote }} \
{{ end }} --traceback
{{ end }}--traceback
{{- if hasKey $product_type "default_browse" }}
{{- template "browsetype.cli" dict "product_type_name" $product_type_name "browse_type_name" nil "browse_type" (get $product_type.browses $product_type.default_browse) -}}
{{- if hasKey $product_type "defaultBrowse" }}
{{ template "browsetype.cli" dict "product_type_name" $product_type.name "browse_type_name" nil "browse_type" (get $product_type.browses $product_type.defaultBrowse) }}
{{- end }}
{{- range $browse_type_name, $browse_type := $product_type.browses }}
{{- template "browsetype.cli" dict "product_type_name" $product_type_name "browse_type_name" $browse_type_name "browse_type" $browse_type -}}
{{ template "browsetype.cli" dict "product_type_name" $product_type.name "browse_type_name" $browse_type_name "browse_type" $browse_type }}
{{- end }}
# create mask type
{{- range $mask_type_name, $mask_type := $product_type.masks }}
python3 manage.py masktype create {{ $product_type_name | quote }} {{ $mask_type_name | quote }} \
{{ if $mask_type.validity -}} --validity \ {{- end }} --traceback
{{- range $mask_type := $product_type.masks }}
python3 manage.py masktype create {{ $product_type.name | quote }} {{ $mask_type.name | quote }} \
{{- if $mask_type.validity -}} --validity \ {{- end }} --traceback
{{- end }}
{{- end }} {{/* range .Values.config.products.types */}}
{{- end }}{{/* range $.Values.dataScheme.productTypes */}}
{{- range $collection_name, $collection := $.Values.dataScheme.collections }}
# set up collection type
{{- range $collection_name, $collection := .Values.config.collections }}
python3 manage.py collectiontype create "{{ $collection_name }}_type" \
{{- range $coverage_type := $collection.coverage_types }}
{{- range $coverage_type := $collection.coverageTypes }}
--coverage-type {{ $coverage_type | quote }} \
{{- end }}
{{- range $product_type_name := $collection.product_types }}
{{- range $product_type_name := $collection.productTypes }}
--product-type {{ $product_type_name | quote }} \
{{- end }}
--traceback
# Instantiate a collection for the collection itself and all levels
python3 manage.py collection create {{ $collection_name | quote }} \
--type "{{ $collection_name }}_type" \
--traceback
{{- end }} {{/* range .collections */}}
{{- end -}}{{/* range .collections */}}
else
echo "Using existing database"
fi
......
......@@ -11,7 +11,7 @@
<transparent>mypng</transparent>
<opaque>myjpeg</opaque>
</format>
{{- if .Values.config.cache.services.wms.enabled }}
{{- if .Values.serviceConfig.cache.wmsEnabled }}
<service type="wms" enabled="true">
<full_wms>assemble</full_wms>
<resample_mode>bilinear</resample_mode>
......@@ -19,32 +19,36 @@
<maxsize>4096</maxsize>
</service>
{{- end }}
{{- if .Values.config.cache.services.wmts.enabled }}
{{- if .Values.serviceConfig.cache.wmtsEnabled }}
<service type="wmts" enabled="true"/>
{{- end }}
{{- with .Values.config.cache.metadata }}
{{- with .Values.serviceMetadata }}
<metadata>
<title>{{ .title }}</title>
<abstract>{{ .abstract }}</abstract>
<url>{{ .url }}</url>
<keyword>{{ .keyword }}</keyword>
<accessconstraints>{{ .accessconstraints }}</accessconstraints>
<keywords>
{{- range $keyword := .keywords }}
<keyword>{{ $keyword }}</keyword>
{{ end -}}
</keywords>
<accessconstraints>{{ .accessConstraints }}</accessconstraints>
<fees>{{ .fees }}</fees>
<contactname>{{ .contactname }}</contactname>
<contactphone>{{ .contactphone }}</contactphone>
<contactfacsimile>{{ .contactfacsimile }}</contactfacsimile>
<contactorganization>{{ .contactorganization }}</contactorganization>
<contactcity>{{ .contactcity }}</contactcity>
<contactstateorprovince>{{ .contactstateorprovince }}</contactstateorprovince>
<contactpostcode>{{ .contactpostcode }}</contactpostcode>
<contactcountry>{{ .contactcountry }}</contactcountry>
<contactelectronicmailaddress>{{ .contactelectronicmailaddress }}</contactelectronicmailaddress>
<contactposition>{{ .contactposition }}</contactposition>
<providername>{{ .providername }}</providername>
<providerurl>{{ .providerurl }}</providerurl>
<inspire_profile>{{ .inspire_profile }}</inspire_profile>
<inspire_metadataurl>{{ .inspire_metadataurl }}</inspire_metadataurl>
<defaultlanguage>{{ .defaultlanguage }}</defaultlanguage>
<contactname>{{ .contactName }}</contactname>
<contactphone>{{ .contactPhone }}</contactphone>
<contactfacsimile>{{ .contactFacsimile }}</contactfacsimile>
<contactorganization>{{ .contactOrganization }}</contactorganization>
<contactcity>{{ .contactCity }}</contactcity>
<contactstateorprovince>{{ .contactStateOrProvince }}</contactstateorprovince>
<contactpostcode>{{ .contactPostcode }}</contactpostcode>
<contactcountry>{{ .contactCountry }}</contactcountry>
<contactelectronicmailaddress>{{ .contactElectronicMailAddress }}</contactelectronicmailaddress>
<contactposition>{{ .contactPosition }}</contactposition>
<providername>{{ .providerName }}</providername>
<providerurl>{{ .providerUrl }}</providerurl>
<inspire_profile>{{ .inspireProfile }}</inspire_profile>
<inspire_metadataurl>{{ .inspireMetadataUrl }}</inspire_metadataurl>
<defaultlanguage>{{ .defaultLanguage }}</defaultlanguage>
<language>{{ .language }}</language>
</metadata>
{{- end }}
......@@ -52,38 +56,30 @@
<lock_dir>/tmp</lock_dir>
<threaded_fetching>true</threaded_fetching>
<!-- Cache -->
{{- if .Values.config.objectStorage.cache.type }}
{{- if eq .Values.config.objectStorage.cache.type "swift" }}
{{- if .Values.storage.cache.type }}
{{ if eq .Values.storage.cache.type "swift" }}
<cache name="cache" type="swift">
<auth_url>{{ .Values.config.objectStorage.cache.auth_url_short }}</auth_url>
<auth_version>{{ .Values.config.objectStorage.cache.auth_version }}</auth_version>
<tenant>{{ .Values.config.objectStorage.cache.tenant_id }}</tenant>
<username>{{ .Values.config.objectStorage.cache.username }}</username>
<password>{{ .Values.config.objectStorage.cache.password }}</password>
<container>{{ .Values.config.objectStorage.cache.container }}</container>
<auth_url>{{ .Values.storage.cache.auth_url_short }}</auth_url>
<auth_version>{{ .Values.storage.cache.auth_version }}</auth_version>
<tenant>{{ .Values.storage.cache.tenant_id }}</tenant>
<username>{{ .Values.storage.cache.username }}</username>
<password>{{ .Values.storage.cache.password }}</password>
<container>{{ .Values.storage.cache.container }}</container>
<key>{{ .Values.config.objectStorage.key | default "/{tileset}/{grid}/{dim}/{z}/{x}/{y}.{ext}" }}</key>
</cache>
{{- else if eq .Values.config.objectStorage.cache.type "S3" }}
{{- else if eq .Values.storage.cache.type "S3" }}
<cache name="cache" type="s3">
<url>{{ .Values.config.objectStorage.cache.endpoint_url }}/{tileset}/{grid}/{dim}/{z}/{x}/{y}/{ext}</url>
<url>{{ .Values.storage.cache.endpoint_url }}/{tileset}/{grid}/{dim}/{z}/{x}/{y}/{ext}</url>
<headers>
<Host>{{ .Values.config.objectStorage.cache.host }}</Host>
<Host>{{ .Values.storage.cache.host }}</Host>
</headers>
<id>{{ .Values.config.objectStorage.cache.access_key_id }}</id>
<secret>{{ .Values.config.objectStorage.cache.secret_access_key }}</secret>
{{- if .Values.config.objectStorage.cache.region }}
<region>{{ .Values.config.objectStorage.cache.region }}</region>
<id>{{ .Values.storage.cache.access_key_id }}</id>
<secret>{{ .Values.storage.cache.secret_access_key }}</secret>
{{- if .Values.config.storage.cache.region }}
<region>{{ .Values.storage.cache.region }}</region>
{{- end }}
<!-- <operation type="put">
<headers>
<x-amz-storage-class>REDUCED_REDUNDANCY</x-amz-storage-class>
<x-amz-acl>public-read</x-amz-acl>
</headers>
</operation> -->
</cache>
{{- else }}
<!-- no storage configured, using temp one -->
<cache name="cache" type="sqlite3">
<dbfile>/tmp/cache.db</dbfile>
</cache>
......@@ -94,47 +90,30 @@
</cache>
{{- end }}
{{- define "mapcache-layerid" -}}{{ .collection_name }}{{ if .level_name }}_{{ .level_name }}{{ end }}{{ if .sub_type_name }}__{{ .sub_type_name }}{{ end }}{{- end }}
{{- range $layer := .Values.dataScheme.layers }}
{{- range $collection_name, $collection := .Values.config.collections -}}
{{- $sub_types := list nil -}}
{{- range $product_type_name := $collection.product_types }}
{{- $sub_types = concat $sub_types ((get $.Values.config.products.types $product_type_name | default dict).browses | default dict | keys) }}
{{- $sub_types = concat $sub_types ((get $.Values.config.products.types $product_type_name | default dict).masks | default dict | keys) }}
{{- end -}}
<!-- Sources for {{ $collection_name }} -->
{{- range $sub_type_name := ($sub_types | uniq) }}
{{- $layer_id := (include "mapcache-layerid" (dict "collection_name" $collection_name "sub_type_name" $sub_type_name)) | trim }}
<source type="wms" name="{{ $layer_id }}">
<source type="wms" name="{{ $layer.id }}">
<getmap>
<params>
<LAYERS>{{ $layer_id }}</LAYERS>
<TRANSPARENT>true</TRANSPARENT>
<STYLES>{{ get (get $.Values.config.cache.tilesets $layer_id | default dict) "style" }}</STYLES>
<LAYERS>{{ $layer.id }}</LAYERS>
<TRANSPARENT>true</TRANSPARENT>
<STYLES></STYLES>
</params>
</getmap>
<http>
<url>http://{{ include "vs.fullname" $ }}-renderer/ows</url>
<connection_timeout>{{ $.Values.config.cache.connection_timeout | default 10 }}</connection_timeout>
<timeout>{{ $.Values.config.cache.timeout | default 120 }}</timeout>
<connection_timeout>{{ $.Values.serviceConfig.cache.connectionTimeout | default 10 }}</connection_timeout>
<timeout>{{ $.Values.serviceConfig.cache.timeout | default 120 }}</timeout>
</http>
</source>
{{- end }}
<!-- Tilesets for {{ $collection_name }} -->
{{- range $sub_type_name := ($sub_types | uniq) }}
{{- $layer_id := (include "mapcache-layerid" (dict "collection_name" $collection_name "sub_type_name" $sub_type_name)) | trim }}
<tileset name="{{ $layer_id }}">
<tileset name="{{ $layer.id }}">
<metadata>
<title>{{ (get $.Values.config.cache.tilesets $layer_id | default dict ).title }}</title>
<abstract>{{ (get $.Values.config.cache.tilesets $layer_id | default dict ).abstract }}</abstract>
<title>{{ $layer.title }}</title>
<abstract>{{ $layer.abstract }}</abstract>
</metadata>
<source>{{ $layer_id }}</source>
<source>{{ $layer.id }}</source>
<cache>cache</cache>
<!-- Grids -->
{{- $grids := (get $.Values.config.cache.tilesets $layer_id | default dict ).grids }}
{{- $grids := $layer.grids }}
{{- if $grids }}
{{- range $grid := $grids }}
<grid max-cached-zoom="{{ $grid.zoom }}" out-of-zoom-strategy="reassemble">{{ $grid.name }}</grid>
......@@ -145,18 +124,19 @@
<format>mixed</format>
<metatile>1 1</metatile>
<metabuffer>1</metabuffer>
<expires>{{ $.Values.config.cache.expires | default 3600 }}</expires>
<expires>{{ $.Values.serviceConfig.cache.expires | default 3600 }}</expires>
<dimensions>
<assembly_type>stack</assembly_type>
<store_assemblies>false</store_assemblies>
<subdimensions_read_only>false</subdimensions_read_only>
<dimension type="postgresql" name="time" default="2017/2019" time="true" unit="ISO8601">
<connection>host={{ $.Release.Name }}-database user={{ $.Values.config.database.DB_USER }} password={{ $.Values.config.database.DB_PW }} dbname={{ $.Values.config.database.DB_NAME }} port={{ $.Values.config.database.DB_PORT | default 5432 }}</connection>
<list_query>SELECT to_char(MIN(mapcache_items.begin_time), 'YYYY-MM-DD"T"HH24:MI:SS"Z"') || '/' || to_char(MAX(mapcache_items.end_time), 'YYYY-MM-DD"T"HH24:MI:SS"Z"') FROM mapcache_items WHERE mapcache_items.collection = '{{ $collection_name }}';</list_query>
<validate_query>SELECT * FROM (SELECT to_char(mapcache_items.begin_time, 'YYYY-MM-DD"T"HH24:MI:SS"Z"') || '/' || to_char(mapcache_items.end_time, 'YYYY-MM-DD"T"HH24:MI:SS"Z"') AS "interval" FROM mapcache_items WHERE (mapcache_items.collection = '{{ $collection_name }}' AND ((mapcache_items."begin_time" &lt; to_timestamp(:end_timestamp) AND mapcache_items."end_time" &gt; to_timestamp(:start_timestamp)) or (mapcache_items."begin_time" = mapcache_items."end_time" AND mapcache_items."begin_time" &lt;= to_timestamp(:end_timestamp) AND mapcache_items."end_time" &gt;= to_timestamp(:start_timestamp)))) AND mapcache_items."footprint" &amp;&amp; ST_Transform(ST_MakeEnvelope(:minx, :miny, :maxx, :maxy, CAST(SUBSTRING(:gridsrs, 6) AS INTEGER)), 4326) ORDER BY mapcache_items."end_time" DESC LIMIT 20) AS sub ORDER BY interval ASC;</validate_query>
<connection>host={{ $.Release.Name }}-database user={{ $.Values.envVar.database.DB_USER }} password={{ $.Values.envVar.database.DB_PW }} dbname={{ $.Values.envVar.database.DB_NAME }} port={{ $.Values.envVar.database.DB_PORT | default 5432 }}</connection>
<list_query>SELECT to_char(MIN(mapcache_items.begin_time), 'YYYY-MM-DD"T"HH24:MI:SS"Z"') || '/' || to_char(MAX(mapcache_items.end_time), 'YYYY-MM-DD"T"HH24:MI:SS"Z"') FROM mapcache_items WHERE mapcache_items.collection = '{{ $layer.parentLayer }}';</list_query>
<validate_query>SELECT * FROM (SELECT to_char(mapcache_items.begin_time, 'YYYY-MM-DD"T"HH24:MI:SS"Z"') || '/' || to_char(mapcache_items.end_time, 'YYYY-MM-DD"T"HH24:MI:SS"Z"') AS "interval" FROM mapcache_items WHERE (mapcache_items.collection = '{{ $layer.parentLayer }}' AND ((mapcache_items."begin_time" &lt; to_timestamp(:end_timestamp) AND mapcache_items."end_time" &gt; to_timestamp(:start_timestamp)) or (mapcache_items."begin_time" = mapcache_items."end_time" AND mapcache_items."begin_time" &lt;= to_timestamp(:end_timestamp) AND mapcache_items."end_time" &gt;= to_timestamp(:start_timestamp)))) AND mapcache_items."footprint" &amp;&amp; ST_Transform(ST_MakeEnvelope(:minx, :miny, :maxx, :maxy, CAST(SUBSTRING(:gridsrs, 6) AS INTEGER)), 4326) ORDER BY mapcache_items."end_time" DESC LIMIT 20) AS sub ORDER BY interval ASC;</validate_query>
</dimension>
</dimensions>
</tileset>
{{- end }}
{{- end }}
</mapcache>
source:
{{- with .Values.config.objectStorage.download }}
type: {{ .type }}
kwargs:
{{- if eq .type "swift" }}
username: {{ .username }}
password: {{ .password }}
tenant_name: {{ .tenant_name }}
tenant_id: {{ .tenant_id }}
region_name: {{ .region_name }}
auth_url: {{ .auth_url }}
auth_version: {{ .auth_version }}
user_domain_name: {{ .user_domain_name }}
{{- else if eq .type "s3" }}
bucket: {{ .bucket }}
endpoint_url: {{ .endpoint_url }}
access_key_id: {{ .access_key_id }}
secret_access_key: {{ .secret_access_key }}
region: {{ .region }}
{{- end }}
{{- if .Values.storage.source -}}
{{ $source := .Values.storage.source -}}
{{ toYaml $source | nindent 4 }}
{{- end }}
target:
{{- with .Values.config.objectStorage.data }}
{{- $keys := keys . }}
{{- $first_key := index $keys 0 }}
{{- $storage := index . $first_key }}
{{- $type := $storage.type | lower }}
type: {{ $type }}
{{- if .Values.storage.target -}}
{{ $target := .Values.storage.target -}}
{{ toYaml $target | nindent 4 }}
{{- else -}}
{{ $target := .Values.storage.data -}}
{{ $first := index (keys $target) 0 }}
{{ $data := get .Values.storage.data $first -}}
type: {{ $data.type }}
{{ $_ := unset $data "type" -}}
kwargs:
{{- if eq $type "swift" }}
username: {{ $storage.username }}
password: {{ $storage.password }}
tenant_name: {{ $storage.tenant_name }}
tenant_id: {{ $storage.tenant_id }}
region_name: {{ $storage.region_name }}
auth_url: {{ $storage.auth_url }}
auth_version: {{ $storage.auth_version }}
user_domain_name: {{ $storage.user_domain_name }}
{{- else if eq $type "s3" }}
bucket: {{ $storage.bucket }}
endpoint_url: {{ $storage.endpoint_url }}
access_key_id: {{ $storage.access_key_id }}
secret_access_key: {{ $storage.secret_access_key }}
region: {{ $storage.region_name }}
{{- end -}}
{{- end -}}
{{- toYaml $data | nindent 6 }}
{{- end }}
{{ toYaml .Values.config.preprocessor | nindent 2 }}
{{- toYaml .Values.serviceConfig.preprocessor | nindent 2 }}
sources:
{{- range $name, $val := .Values.config.objectStorage.data }}
{{- range $name, $val := .Values.storage.data }}
{{- $type := ($val.type | lower ) }}
- type: {{ $type }}
name: {{ $name }}
......@@ -23,47 +23,18 @@ sources:
region_name: {{ $val.region_name }}
secret_access_key: {{ $val.secret_access_key }}
validate_bucket_name: {{ if hasKey $val "validate_bucket_name" }}{{ $val.validate_bucket_name }}{{ else }}true{{ end }}
# TODO: 'client_kwargs'
{{- end }}
{{- end }}
backends:
{{- if not ( .Values.config.registrar.disable_default_eoxserver | default false ) }}
{{- if not ( .Values.serviceConfig.registrar.disable_default_eoxserver | default false ) }}
- type: eoxserver
kwargs:
instance_base_path: /var/www/pvs/dev
instance_name: pvs_instance
product_types:
{{- range $product_type_name, $product_type := .Values.config.products.types }}
- product_type: {{ $product_type_name }}
filter:
{{- if hasKey $product_type "filter" }}
{{- toYaml $product_type.filter | nindent 14 }}
{{- end }}
coverages:
{{ toYaml $product_type.coverages | nindent 14}}
{{- if hasKey $product_type "masks" }}
masks:
- mask_type: {{ $product_type.masks.mask_type }}
assets: {{ $product_type.masks.assets }}
{{- end }}
{{- if hasKey $product_type "browses" }}
browses:
{{- range $browse_type_name, $browse_type := $product_type.browses }}
- browse_type: {{ $browse_type_name }}
{{ toYaml $browse_type | nindent 16 }}
{{- end }}
{{- end }}
collections:
{{- range $collection_name, $collection_cfg := $.Values.config.collections }}
{{- range $collection_product_type := $collection_cfg.product_types }}
{{- if eq $collection_product_type $product_type_name }}
- {{ $collection_name }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- toYaml .Values.dataScheme.productTypes | nindent 10 -}}
{{- end }}
{{- range .Values.config.registrar.backends | default list }}
{{- range .Values.serviceConfig.registrar.backends | default list }}
-{{ toYaml . | nindent 6 }}
{{- end }}
{{- toYaml .Values.serviceConfig.scheduler | nindent 2 -}}
......@@ -6,7 +6,7 @@ metadata:
{{- include "vs.labels" . | nindent 4 }}
app.kubernetes.io/service: cache
spec:
replicas: {{ .Values.cache.replicaCount }}
replicas: {{ .Values.kubeConfig.cache.replicaCount }}
selector:
matchLabels:
{{- include "vs.selectorLabels" . | nindent 6 }}
......@@ -23,20 +23,20 @@ spec:
{{- include "vs.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: cache
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.kubeConfig.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-cache
image: "{{ .Values.cache.image.repository | default "registry.gitlab.eox.at/esa/prism/vs/pvs_cache" }}:{{ .Values.cache.image.tag | default ( print "release-" .Chart.AppVersion ) }}"
imagePullPolicy: {{ .Values.cache.image.pullPolicy | default "IfNotPresent" }}
image: "{{ .Values.kubeConfig.cache.image.repository | default "registry.gitlab.eox.at/esa/prism/vs/pvs_cache" }}:{{ .Values.kubeConfig.cache.image.tag | default ( print "release-" .Chart.AppVersion ) }}"
imagePullPolicy: {{ .Values.kubeConfig.cache.image.pullPolicy | default "IfNotPresent" }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
{{- toYaml .Values.cache.livenessProbe | nindent 12 }}
{{- toYaml .Values.kubeConfig.cache.livenessProbe | nindent 12 }}
readinessProbe:
httpGet:
path: /
......@@ -48,35 +48,31 @@ spec:
failureThreshold: 30
periodSeconds: 10
resources:
{{- toYaml .Values.cache.resources | nindent 12 }}
{{- toYaml .Values.kubeConfig.cache.resources | nindent 12 }}
args:
- /run-httpd.sh
env:
{{- range $key, $value := .Values.config.general }}
{{- range $key, $value := .Values.envVar.general }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- range $key, $value := .Values.config.database }}
{{- range $key, $value := .Values.envVar.database }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: DB_HOST
value: {{ .Release.Name }}-database
{{- range $key, $value := .Values.config.objectStorage.data }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: RENDERER_HOST
value: {{ include "vs.fullname" . }}-renderer
- name: INSTANCE_ID
value: prism-view-server_cache
- name: WAIT_SERVICES
value: "{{ .Release.Name }}-database:{{ .Values.config.database.DB_PORT }} {{ include "vs.fullname" . }}-renderer:80"
value: "{{ .Release.Name }}-database:{{ .Values.envVar.database.DB_PORT }} {{ include "vs.fullname" . }}-renderer:80"
volumeMounts:
- mountPath: /mapcache-template.xml
name: cache-config
subPath: mapcache.xml
{{- with .Values.cache.affinity | default .Values.affinity }}
{{- with .Values.kubeConfig.cache.affinity | default .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
......
......@@ -6,9 +6,9 @@ metadata:
{{- include "vs.labels" . | nindent 4 }}
app.kubernetes.io/service: cache
spec:
type: {{ .Values.service.type }}
type: {{ .Values.kubeConfig.service.type }}
ports:
- port: {{ .Values.service.port }}
- port: {{ .Values.kubeConfig.service.port }}
targetPort: http
protocol: TCP
name: http
......
......@@ -6,7 +6,7 @@ metadata:
{{- include "vs.labels" . | nindent 4 }}
app.kubernetes.io/service: client
spec:
replicas: {{ .Values.client.replicaCount }}
replicas: {{ .Values.kubeConfig.client.replicaCount }}
selector:
matchLabels:
{{- include "vs.selectorLabels" . | nindent 6 }}
......@@ -23,31 +23,31 @@ spec:
{{- include "vs.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: client
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.kubeConfig.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-client
image: '{{ .Values.client.image.repository | default "registry.gitlab.eox.at/esa/prism/vs/pvs_client" }}:{{ .Values.client.image.tag | default ( print "release-" .Chart.AppVersion ) }}'
imagePullPolicy: {{ .Values.client.image.pullPolicy | default "IfNotPresent" }}
image: '{{ .Values.kubeConfig.client.image.repository | default "registry.gitlab.eox.at/esa/prism/vs/pvs_client" }}:{{ .Values.kubeConfig.client.image.tag | default ( print "release-" .Chart.AppVersion ) }}'
imagePullPolicy: {{ .Values.kubeConfig.client.image.pullPolicy | default "IfNotPresent" }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
{{- toYaml .Values.client.livenessProbe | nindent 12 }}
{{- toYaml .Values.kubeConfig.client.livenessProbe | nindent 12 }}
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.client.resources | nindent 12 }}
{{- toYaml .Values.kubeConfig.client.resources | nindent 12 }}
volumeMounts:
- mountPath: /usr/share/nginx/html/index.html
name: client
subPath: index.html
{{- with .Values.client.affinity | default .Values.affinity }}
{{- with .Values.kubeConfig.client.affinity | default .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
......
......@@ -6,9 +6,9 @@ metadata:
{{- include "vs.labels" . | nindent 4 }}
app.kubernetes.io/service: client
spec:
type: {{ .Values.service.type }}
type: {{ .Values.kubeConfig.service.type }}
ports:
- port: {{ .Values.service.port }}
- port: {{ .Values.kubeConfig.service.port }}
targetPort: http
protocol: TCP
name: http
......
......@@ -4,5 +4,4 @@ metadata:
name: django-secret-key
type: Opaque
data:
# Example:
DJANGO_SECRET_KEY: {{ .Values.config.django.DJANGO_SECRET_KEY | default (randAlphaNum 36) | b64enc }}
DJANGO_SECRET_KEY: {{ .Values.envVar.django.DJANGO_SECRET_KEY | default (randAlphaNum 36) | b64enc }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vs.fullname" . }}-harvester-config
data:
{{ (tpl (.Files.Glob "files/harvester-config.yaml").AsConfig . ) | nindent 2}}
......@@ -6,7 +6,7 @@ metadata:
{{- include "vs.labels" . | nindent 4 }}
app.kubernetes.io/service: harvester
spec: