Commit 44a168ff authored by Thomas Beermann's avatar Thomas Beermann
Browse files

first commit

parent ee0f71c5
Pipeline #86424 passed with stages
in 9 seconds
lint:
image:
name: registry.hzdr.de/hifis-technical-platform/helm-charts
entrypoint: ["/bin/sh", "-c"]
stage: test
script:
- helm lint hifiscp/
chartmuseum:
image:
name: registry.hzdr.de/hifis-technical-platform/helm-charts
entrypoint: ["/bin/sh", "-c"]
stage: deploy
script:
- helm push -f hifiscp/ desy-it
only:
- main
apiVersion: v1
name: hifiscp
version: 0.0.1
description: A Helm chart to deploy the HIFIS Cloud Portal Backend and Frontend
keywords:
- HIFIS
home: https://cloud.helmholtz.de
sources:
- https://gitlab.hzdr.de/hifis-technical-platform/
maintainers:
- name: Thomas Beermann
email: thomas.beermann@desy.de
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "hifiscp.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
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 "hifiscp.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "hifiscp.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
\ No newline at end of file
{{- if gt .Values.cerebrum.replicas 0.0 -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "hifiscp.fullname" . }}-cerebrum
labels:
app: {{ template "hifiscp.name" . }}-cerebrum
chart: {{ template "hifiscp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.cerebrum.replicas }}
selector:
matchLabels:
app: {{ template "hifiscp.name" . }}-cerebrum
template:
metadata:
labels:
app: {{ template "hifiscp.name" . }}-cerebrum
chart: {{ template "hifiscp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
containers:
- env:
{{- if .Values.cerebrum.config.mongodb.database }}
- name: MONGODB_DB
value: {{ .Values.cerebrum.config.mongodb.database | quote }}
{{- end }}
{{- if .Values.cerebrum.config.mongodb.host }}
- name: MONGODB_HOST
value: {{ .Values.cerebrum.config.mongodb.host | quote }}
{{- end }}
{{- if .Values.cerebrum.config.mongodb.port }}
- name: MONGODB_PORT
value: {{ .Values.cerebrum.config.mongodb.port | quote }}
{{- end }}
{{- if .Values.cerebrum.config.mongodb.authdb }}
- name: MONGODB_AUTH_DB
value: {{ .Values.cerebrum.config.mongodb.authdb | quote }}
{{- end }}
- name: MONGODB_USERNAME
valueFrom:
secretKeyRef:
name: {{ template "hifiscp.fullname" . }}-mongodb-credentials
key: username
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "hifiscp.fullname" . }}-mongodb-credentials
key: password
{{- if .Values.cerebrum.config.oauth2.registered_uri }}
- name: OAUTH2_REGISTERED_URI
value: {{ .Values.cerebrum.config.mongodb.registered_uri | quote }}
{{- end }}
{{- if .Values.cerebrum.config.oauth2.use_current_uri }}
- name: OAUTH2_USE_CURRENT_URI
value: {{ .Values.cerebrum.config.oauth2.use_current_uri | quote }}
{{- end }}
{{- if .Values.cerebrum.config.context_path }}
- name: CONTEXT_PATH
value: {{ .Values.cerebrum.config.context_path | quote }}
{{- end }}
name: cerebrum
image: {{ .Values.cerebrum.image.repository }}:{{ .Values.cerebrum.image.tag }}
imagePullPolicy: {{ .Values.cerebrum.image.pullPolicy }}
ports:
- containerPort: {{ .Values.cerebrum.service.targetPort }}
resources:
{{ toYaml .Values.cerebrum.resources | indent 10 }}
{{- with .Values.cerebrum.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.cerebrum.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.cerebrum.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
\ No newline at end of file
{{- if gt .Values.cerebrum.replicas 0.0 -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "hifiscp.fullname" . }}-cerebrum
labels:
app: {{ template "hifiscp.name" . }}-cerebrum
chart: {{ template "hifiscp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.cerebrum.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
type: {{ .Values.cerebrum.service.type }}
ports:
- port: {{ .Values.cerebrum.service.port }}
targetPort: {{ .Values.cerebrum.service.targetPort }}
protocol: {{ .Values.cerebrum.service.protocol }}
selector:
app: {{ template "hifiscp.name" . }}-cerebrum
release: {{ .Release.Name }}
{{- end }}
\ No newline at end of file
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "hifiscp.fullname" . -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "hifiscp.fullname" . }}
labels:
app: {{ template "hifiscp.name" . }}
chart: {{ template "hifiscp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
{{- with .Values.ingress.annotations }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}-webapp
port:
number: 80
- path: /api
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}-cerebrum
port:
number: 80
- path: /swagger-ui
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}-cerebrum
port:
number: 80
{{- end }}
{{- end }}
{{- if gt .Values.webapp.replicas 0.0 -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "hifiscp.fullname" . }}-webapp
labels:
app: {{ template "hifiscp.name" . }}-webapp
chart: {{ template "hifiscp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.webapp.replicas }}
selector:
matchLabels:
app: {{ template "hifiscp.name" . }}-webapp
template:
metadata:
labels:
app: {{ template "hifiscp.name" . }}-webapp
chart: {{ template "hifiscp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
containers:
- name: webapp
image: {{ .Values.webapp.image.repository }}:{{ .Values.webapp.image.tag }}
imagePullPolicy: {{ .Values.webapp.image.pullPolicy }}
ports:
- containerPort: {{ .Values.webapp.service.targetPort }}
env:
- name: CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ template "hifiscp.fullname" . }}-oidc-credentials
key: client_secret
{{- if .Values.webapp.config.context_path }}
- name: CONTEXT_PATH
value: {{ .Values.webapp.config.context_path | quote }}
{{- end }}
resources:
{{ toYaml .Values.cerebrum.resources | indent 10 }}
{{- with .Values.cerebrum.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.cerebrum.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.cerebrum.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
\ No newline at end of file
{{- if gt .Values.webapp.replicas 0.0 -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "hifiscp.fullname" . }}-webapp
labels:
app: {{ template "hifiscp.name" . }}-webapp
chart: {{ template "hifiscp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.webapp.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
type: {{ .Values.webapp.service.type }}
ports:
- port: {{ .Values.webapp.service.port }}
targetPort: {{ .Values.webapp.service.targetPort }}
protocol: {{ .Values.webapp.service.protocol }}
selector:
app: {{ template "hifiscp.name" . }}-webapp
release: {{ .Release.Name }}
{{- end }}
\ No newline at end of file
cerebrum:
replicas: 1
image:
repository: registry.hzdr.de/hifis-technical-platform/helmholtz-cerebrum
tag: latest
pullPolicy: Always
service:
type: ClusterIP
targetPort: 8090
port: 80
protocol: TCP
name: http
annotations: {}
config:
mongodb:
host: helmholtz-mongo-mongodb
port: 27017
database: admin
authdb: admin
oauth2:
registered_uri: ""
use_current_uri: "false"
context_path: "/"
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 100m
memory: 500Mi
nodeSelector: {}
tolerations: []
affinity: {}
webapp:
replicas: 1
image:
repository: registry.hzdr.de/hifis-technical-platform/helmholtz-marketplace-server
tag: latest
pullPolicy: Always
service:
type: ClusterIP
targetPort: 8080
port: 80
protocol: TCP
name: http
annotations: {}
config:
context_path: "/"
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 100m
memory: 500Mi
nodeSelector: {}
tolerations: []
affinity: {}
ingress:
enabled: true
annotations: {}
hosts:
- hifis.cloud.portal
tls: []
\ No newline at end of file
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