EOX GitLab Instance

Commit 8cb55e00 authored by Nikola Jankovic's avatar Nikola Jankovic 💻
Browse files

added chart

updated dockerfile
updated cicd
parent cf0f78c0
Pipeline #18239 failed with stages
in 3 minutes and 7 seconds
......@@ -29,8 +29,7 @@ deploy:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
- cd ./seeder
- docker build --cache-from $CI_REGISTRY_IMAGE-seeder:latest -t $CI_REGISTRY_IMAGE-seeder:$CI_COMMIT_TAG .
- docker build --cache-from $CI_REGISTRY_IMAGE-seeder:latest -t $CI_REGISTRY_IMAGE-seeder:$CI_COMMIT_TAG seeder/.
- docker push $CI_REGISTRY_IMAGE-seeder:$CI_COMMIT_TAG
only:
- tags
......@@ -40,7 +39,9 @@ helm:
stage: chart
script:
# push Helm chart
- "upload_filename=$(helm package ./chart | sed 's/^Successfully packaged chart and saved it to: \\(.*\\)/\\1/')"
- "upload_filename=$(helm package ./charts/cache | sed 's/^Successfully packaged chart and saved it to: \\(.*\\)/\\1/')"
- curl -u $HELM_CHART_REPOSITORY_CREDENTIALS -v -X POST https://charts-public.hub.eox.at/api/charts --data-binary "@${upload_filename}"
- "upload_filename=$(helm package ./charts/seeder | sed 's/^Successfully packaged chart and saved it to: \\(.*\\)/\\1/')"
- curl -u $HELM_CHART_REPOSITORY_CREDENTIALS -v -X POST https://charts-public.hub.eox.at/api/charts --data-binary "@${upload_filename}"
only:
- tags
......
{{/*
Expand the name of the chart.
*/}}
{{- define "vs-cache.name" -}}
{{- define "vs-seeder.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
......@@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "vs-cache.fullname" -}}
{{- define "vs-seeder.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
......@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vs-cache.chart" -}}
{{- define "vs-seeder.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "vs-cache.labels" -}}
helm.sh/chart: {{ include "vs-cache.chart" . }}
{{ include "vs-cache.selectorLabels" . }}
{{- define "vs-seeder.labels" -}}
helm.sh/chart: {{ include "vs-seeder.chart" . }}
{{ include "vs-seeder.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
......@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "vs-cache.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vs-cache.name" . }}
{{- define "vs-seeder.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vs-seeder.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "vs-cache.serviceAccountName" -}}
{{- define "vs-seeder.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "vs-cache.fullname" .) .Values.serviceAccount.name }}
{{- default (include "vs-seeder.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
......
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vs-cache.fullname" . }}-config
data:
{{ (tpl (.Files.Glob "files/mapcache.xml").AsConfig . ) | nindent 2}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vs-cache.fullname" . }}
name: {{ include "vs-seeder.fullname" . }}
labels:
{{- include "vs-cache.labels" . | nindent 4 }}
app.kubernetes.io/service: cache
{{- include "vs-seeder.labels" . | nindent 4 }}
app.kubernetes.io/service: seeder
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "vs-cache.selectorLabels" . | nindent 6 }}
app.kubernetes.io/service: cache
{{- include "vs-seeder.selectorLabels" . | nindent 6 }}
app.kubernetes.io/service: seeder
strategy:
rollingUpdate:
maxUnavailable: 0
......@@ -20,8 +20,8 @@ spec:
annotations:
prometheus.io/scrape: "false"
labels:
{{- include "vs-cache.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: cache
{{- include "vs-seeder.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: seeder
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
......@@ -35,8 +35,6 @@ spec:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
httpGet:
path: /
......@@ -50,30 +48,13 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
args:
- /opt/cache/run-httpd.sh
- /opt/seeder/run-seeder.sh
env:
{{- range $key, $value := .Values.global.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: DB_HOST
value: {{ .Release.Name }}-database
- name: RENDERER_HOST
value: {{ .Release.Name }}-renderer
- name: WAIT_SERVICES
value: "{{ .Release.Name }}-database:{{ .Values.global.env.DB_PORT }} {{ .Release.Name }}-renderer:80"
volumeMounts:
- mountPath: /mapcache-template.xml
name: cache-config
subPath: mapcache.xml
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- configMap:
items:
- key: mapcache.xml
path: mapcache.xml
name: {{ include "vs-cache.fullname" . }}-config
name: cache-config
{{- $fullName := include "vs-cache.fullname" . -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "vs-cache.labels" . | nindent 4 }}
{{- with .Values.global.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
nginx.ingress.kubernetes.io/rewrite-target: /$1
{{- end }}
spec:
{{- if .Values.global.ingress.tls }}
tls:
{{- range .Values.global.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.global.ingress.hosts }}
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
- host: {{ .host | quote }}
http:
paths:
- path: /cache/(.*)
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: 80
{{- else }}
- host: {{ .host | quote }}
http:
paths:
- path: /cache/(.*)
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end -}}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "vs-cache.fullname" . }}
labels:
{{- include "vs-cache.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-cache.selectorLabels" . | nindent 4 }}
app.kubernetes.io/service: cache
......@@ -3,24 +3,12 @@ nameOverride:
fullNameOverride:
image:
repository: registry.gitlab.eox.at/vs/cache
repository: registry.gitlab.eox.at/vs/cache-seeder
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: []
config:
wmsEnabled: true
wmtsEnabled: true
connectionTimeout: 10
timeout: 120
expires: 3600
key: /{tileset}/{grid}/{dim}/{z}/{x}/{y}.{ext}
service:
type: ClusterIP
port: 80
resources:
limits:
cpu: 0.5
......@@ -29,62 +17,4 @@ resources:
cpu: 0.1
memory: 0.1Gi
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 80
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
affinity: {}
global:
env:
INSTANCE_ID: prism-view-server_cache
DB_PORT: 5432
metadata:
title: PRISM Data Access Service developed by EOX
header: PRISM Data Access View Server (VS) 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>
abstract: PRISM Data Access Service developed by EOX
url: https://ecma/cache/ows
keywords:
- view server
accessConstraints: UNKNOWN
fees: UNKNOWN
contactName: Stephan Meissl
contactPhone: Please contact via mail.
contactFacsimile: None
contactOrganization: EOX IT Services GmbH
contactCity: Vienna
contactStateOrProvince: Vienna
contactPostcode: 1090
contactCountry: Austria
contactElectronicMailAddress: office@eox.at
contactPosition: CTO
providerName: EOX
providerUrl: https://eox.at
inspireProfile: true
inspireMetadataUrl: TBD
defaultLanguage: eng
language: eng
storage:
cache: {}
layers: []
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/enable-cors: "true"
cert-manager.io/cluster-issuer: letsencrypt
hosts:
- host: vs.local
tls:
- hosts:
- vs.local
secretName: vs-secret
# hosts and tls will be redefined always
......@@ -25,23 +25,18 @@
# IN THE SOFTWARE.
#-----------------------------------------------------------------------------
FROM registry.gitlab.eox.at/vs/cache:latest
FROM registry.gitlab.eox.at/vs/cache:release-2.0.0
LABEL name="view server seeder" \
vendor="EOX IT Services GmbH <https://eox.at>" \
license="MIT Copyright (C) 2019 EOX IT Services GmbH <https://eox.at>" \
type="view server cache"
WORKDIR /opt/seeder
COPY . .
RUN apt update && apt --no-install-recommends install -y \
python3-pip
ADD requirements.txt \
/
RUN pip3 install -r /requirements.txt
RUN apt update && apt --no-install-recommends install -y python3-pip && \
pip3 install -r /requirements.txt
EXPOSE 80
ENTRYPOINT ["./entrypoint.sh"]
CMD ["./run-httpd.sh"]
CMD ["./run-seeder.sh"]
LABEL version="2.0.0"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment