Added StreifenCheck (Backend) Chart

This commit is contained in:
Daniel
2025-07-16 15:17:45 +02:00
parent 7460b245be
commit 625411fb1d
8 changed files with 324 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: streifencheck
description: A Helm chart for Kubernetes
type: application
version: 0.15-dev.1
appVersion: 0.15-dev.1

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "streifencheck.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 "streifencheck.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 "streifencheck.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "streifencheck.labels" -}}
helm.sh/chart: {{ include "streifencheck.chart" . }}
{{ include "streifencheck.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "streifencheck.selectorLabels" -}}
app.kubernetes.io/name: {{ include "streifencheck.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "streifencheck.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "streifencheck.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "streifencheck.fullname" . }}
labels:
app: {{ template "streifencheck.name" . }}
chart: {{ template "streifencheck.chart" . }}
component: streifencheck
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.deploymentLabels }}
{{- toYaml .Values.deploymentLabels | nindent 4 }}
{{- end }}
spec:
strategy:
{{ toYaml .Values.updateStrategy | nindent 4 }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "streifencheck.name" . }}
component: streifencheck
release: {{ .Release.Name }}
template:
metadata:
annotations:
labels:
app: {{ template "streifencheck.name" . }}
component: streifencheck
release: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "streifencheck.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
terminationMessagePolicy: FallbackToLogsOnError
ports:
- name: http
containerPort: {{ .Values.service.port }}
env:
{{- range $key := .Values.env }}
{{- if .value }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
{{- range $key := .Values.secretEnv }}
- name: {{ .name }}
valueFrom:
secretKeyRef:
name: {{ template "streifencheck.fullname" $ }}-secret
key: {{ .name }}
{{- end }}
envFrom:
{{- with .Values.extraEnvFrom }}
{{- tpl . $ | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

View File

@@ -0,0 +1,18 @@
{{- if .Values.autoscaling.enabled -}}
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "streifencheck.fullname" . }}
labels:
app: {{ template "streifencheck.name" . }}
chart: {{ template "streifencheck.chart" . }}
component: streifencheck
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "streifencheck.fullname" . }}
{{ toYaml .Values.autoscaling.config | indent 2 }}
{{- end -}}

View File

@@ -0,0 +1,45 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "streifencheck.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- $ingressPathType := .Values.ingress.pathtype -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app: {{ template "streifencheck.name" . }}
chart: {{ template "streifencheck.chart" . }}
component: streifencheck
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $fullName }}
port:
number: 3000
{{- end }}
{{- end }}

View File

@@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
name: {{ template "streifencheck.fullname" . }}
labels:
app: {{ template "streifencheck.name" . }}
chart: {{ template "streifencheck.chart" . }}
component: streifencheck
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 3000
protocol: TCP
name: npm
selector:
app: {{ template "streifencheck.name" . }}
component: streifencheck
release: {{ .Release.Name }}

View File

@@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "streifencheck.serviceAccountName" . }}
labels:
{{- include "streifencheck.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}

View File

@@ -0,0 +1,76 @@
platform: kubernetes
serviceAccount:
create: true
name: ""
annotations: ""
automount: false
image:
repository: gitea.innovation-hub-niedersachsen.de/innohub/streifencheck-dev
tag: 0.15-dev.1
pullPolicy: IfNotPresent
insecure: true
replicaCount: 1
service:
type: ClusterIP
port: 3000
annotations: {}
endpoint: streifencheck.local
ingress:
enabled: false
annotations: {}
path: /
pathtype: ImplementationSpecific
hosts:
- streifencheck.innohub.local
tls:
route:
enabled: false
resources:
requests:
memory: 128Mi
cpu: 300m
limits:
memory: 1Gi
cpu: 500m
nodeSelector: {}
tolerations: []
affinity: {}
autoscaling:
enabled: true
config:
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
deploymentLabels: {}
podLabels: {}
sharedDataFolder:
enabled: true
path: /daten
accessMode: ReadWriteOnce
storageClass:
resources:
requests:
storage: 5Gi
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
podSecurityContext: {}
securityContext: {}
extraDeploy: []