diff --git a/chart/Chart.yaml b/chart/Chart.yaml index f3f51a3b2ab72950bbee3949e08a55c7cefa98a4..676d4188ef8388805df66e3e98c4382200797f8f 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -7,7 +7,7 @@ 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: 0.2.0 +version: 0.3.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/chart/files/index.html b/chart/files/index.html index 0e986eeffad3e2be05776efeacf9469dacd71b32..8bf037a5e94617645b860b06374eca032c01a247 100644 --- a/chart/files/index.html +++ b/chart/files/index.html @@ -3,15 +3,15 @@ <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta charset="UTF-8"> -<title>PRISM View Server</title> +<title>{{ .Values.config.client.title | default "PRISM View Server" }}</title> <link rel="icon" href="//eox.at/wp-content/uploads/2015/06/cropped-eox_eye-192x192.png" sizes="192x192" /> <link rel="apple-touch-icon-precomposed" href="//eox.at/wp-content/uploads/2015/06/cropped-eox_eye-180x180.png" /> </head> <body> <header id="header" style="width: 100%; height:70px;"> <h3 style="width:100%;text-align:center; - color: #006699;">PRISM View Server (PVS) Client powered by - <a href="//eox.at"><img src="//eox.at/wp-content/uploads/2017/09/EOX_Logo.svg" alt="EOX" style="height:25px;margin-left:10px"/></a> + color: #006699;"> + {{ .Values.config.client.header | default "PRISM View Server (PVS) Client powered by <a href=\"//eox.at\"><img src=\"//eox.at/wp-content/uploads/2017/09/EOX_Logo.svg\" alt=\"EOX\" style=\"height:25px;margin-left:10px\"/></a>" }} </h3> </header> <div id="app" style="width: 100%; top: 60px; bottom: 0; position: absolute; margin: 0; padding:0;"></div> diff --git a/chart/files/mapcache.xml b/chart/files/mapcache.xml index c84abb6d4fb052ff60a5f63916b571cf3af59522..51a6b3790005a8b37f9dee216b88463c0db3155c 100644 --- a/chart/files/mapcache.xml +++ b/chart/files/mapcache.xml @@ -63,9 +63,29 @@ <container>{{ .Values.config.objectStorage.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"}} # TODO + {{- else if eq .Values.config.objectStorage.cache.type "S3" }} + <cache name="cache" type="S3"> + <url>{{ .Values.config.objectStorage.cache.endpoint_url }}/{tileset}/{grid}/{z}/{x}/{y}/{ext}</url> + <!-- <headers> + <Host>foo.s3.amazonaws.com</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> + {{- 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 --> + <!-- no storage configured, using temp one --> + <cache name="cache" type="sqlite3"> + <dbfile>/tmp/cache.db</dbfile> + </cache> {{- end }} {{- define "mapcache-layerid" -}}{{ .collection_name }}{{ if .level_name }}__{{ .level_name }}{{ end }}{{ if .sub_layer_name }}__{{ .sub_layer_name }}{{ end }}{{- end }} diff --git a/chart/templates/cache-configmap.yaml b/chart/templates/cache-configmap.yaml index d72924e9c2aef9db31325844187e43e83613a32a..7a796859ad2d49796260b97901cd370c7b1fcc2e 100644 --- a/chart/templates/cache-configmap.yaml +++ b/chart/templates/cache-configmap.yaml @@ -1,6 +1,6 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "vs.fullname" . }}-cache + name: {{ include "vs.fullname" . }}-cache-config data: {{ (tpl (.Files.Glob "files/mapcache.xml").AsConfig . ) | nindent 2}} diff --git a/chart/templates/cache-deployment.yaml b/chart/templates/cache-deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f97370c6a9010b4dd0a449a7da5aec2eeff49418 --- /dev/null +++ b/chart/templates/cache-deployment.yaml @@ -0,0 +1,93 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "vs.fullname" . }}-cache + labels: + {{- include "vs.labels" . | nindent 4 }} + app.kubernetes.io/service: cache +spec: + replicas: {{ .Values.cache.replicaCount }} + selector: + matchLabels: + {{- include "vs.selectorLabels" . | nindent 6 }} + app.kubernetes.io/service: cache + strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + annotations: + prometheus.io/scrape: "false" + labels: + {{- include "vs.selectorLabels" . | nindent 8 }} + app.kubernetes.io/service: cache + spec: + {{- with .Values.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" }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + startupProbe: + httpGet: + path: / + port: http + failureThreshold: 30 + periodSeconds: 10 + resources: + {{- toYaml .Values.cache.resources | nindent 12 }} + args: + - /run-httpd.sh + env: + {{- range $key, $value := .Values.config.general }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- range $key, $value := .Values.config.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: {{ .Release.Name }}-renderer + - name: INSTANCE_ID + value: prism-view-server_cache + - name: WAIT_SERVICES + value: "{{ .Release.Name }}-database:{{ .Values.config.database.DB_PORT }} {{ .Release.Name }}-renderer:80" + - name: WAIT_TIMEOUT + value: "300" + volumeMounts: + - mountPath: /mapcache-template.xml + name: cache-config.xml + subPath: cache-config.xml + {{- with .Values.cache.affinity | default .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + - configMap: + items: + - key: cache-config.xml + path: cache-config.xml + name: {{ include "vs.fullname" . }}-cache-config + name: cache-config diff --git a/chart/templates/cache-service.yaml b/chart/templates/cache-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9d31c6d3006f76127522993337723ef969abc885 --- /dev/null +++ b/chart/templates/cache-service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "vs.fullname" . }}-cache + labels: + {{- include "vs.labels" . | nindent 4 }} + app.kubernetes.io/service: cache +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "vs.selectorLabels" . | nindent 4 }} + app.kubernetes.io/service: cache diff --git a/chart/templates/client-deployment.yaml b/chart/templates/client-deployment.yaml index c0ac1423a401176eec0284b952512ec28cadaf2c..4fad3c68e921b5fc1b4e590e10c3f7eb1e3a2dd6 100644 --- a/chart/templates/client-deployment.yaml +++ b/chart/templates/client-deployment.yaml @@ -29,8 +29,8 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }}-client - image: '{{ .Values.image.repository | default "registry.gitlab.eox.at/esa/prism/vs" }}/pvs_client:{{ .Values.image.tag | default .Chart.AppVersion }}' - imagePullPolicy: {{ .Values.image.pullPolicy }} + 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" }} ports: - name: http containerPort: 80 diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index deb7100d730f5726b987dae2d1bef6dd6b076d27..75634f8ed8cad42aaf83ee47726b4f6c8b5efd4f 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -43,12 +43,12 @@ spec: backend: serviceName: {{ $fullName }}-renderer servicePort: http + - path: /cache/(.*) + backend: + serviceName: {{ $fullName }}-cache + servicePort: http - path: /(.*) backend: serviceName: {{ $fullName }}-client servicePort: http - # - path: /cache/(.*) - # backend: - # serviceName: {{ $fullName }}-cache - # servicePort: http {{- end }} diff --git a/chart/templates/registrar-deployment.yaml b/chart/templates/registrar-deployment.yaml index b25992095b17ebf995f3425df4579782615cbcc7..cf7b232beeeea188e7d21e091460aafb9d8d8159 100644 --- a/chart/templates/registrar-deployment.yaml +++ b/chart/templates/registrar-deployment.yaml @@ -29,8 +29,8 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }}-registrar - image: "{{ .Values.image.repository | default "registry.gitlab.eox.at/esa/prism/vs" }}/{{ .Values.renderer.image | default "pvs_core" }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ .Values.registrar.image.repository | default "registry.gitlab.eox.at/esa/prism/vs/pvs_core" }}:{{ .Values.registrar.image.tag | default ( print "release-" .Chart.AppVersion ) }}" + imagePullPolicy: {{ .Values.registrar.image.pullPolicy | default "IfNotPresent" }} resources: {{- toYaml .Values.registrar.resources | nindent 12 }} args: diff --git a/chart/templates/renderer-deployment.yaml b/chart/templates/renderer-deployment.yaml index 7e39fd7d507e9af8098981526263062277d3ec66..875c23db5f66ee9d52ff6fc5ddfc4c2f9cdaa1e8 100644 --- a/chart/templates/renderer-deployment.yaml +++ b/chart/templates/renderer-deployment.yaml @@ -29,8 +29,8 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }}-renderer - image: "{{ .Values.image.repository | default "registry.gitlab.eox.at/esa/prism/vs" }}/{{ .Values.renderer.image | default "pvs_core" }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ .Values.renderer.image.repository | default "registry.gitlab.eox.at/esa/prism/vs/pvs_core" }}:{{ .Values.renderer.image.tag | default ( print "release-" .Chart.AppVersion ) }}" + imagePullPolicy: {{ .Values.renderer.image.pullPolicy | default "IfNotPresent" }} ports: - name: http containerPort: 80