Skip to content
Snippets Groups Projects
Select Git revision
  • fceb6a332180726e1c332cca61c550cbf4e32079
  • main default protected
  • ods-button-cleanup
  • OZG-8490-E2E-Tests
  • tooltip-improvements
  • admin-cleanup
  • OZG-8376-ods-select
  • OZG-8405-Alfa-Bearbeiter-auswählen-und-entfernen-Design
  • OZG-7981-Statistik-Anzeige-von-Mandanten
  • OZG-6319-inlcude-externe-fachstelle-to-collaboration
  • OZG-8430-radio-button-card-styling
  • OZG-7981-Statistik-Anzeige-von-Mandanten-2
  • wip-sebo-sebastian
  • fix-storybook
  • OZG-8314-Alfa-Vorgang-Bearbeiter-Zuweisung-entfernen
  • testing-imports
  • storybook-improvements
  • release-administration
  • OZG-8422-BenutzerSpeichern
  • release-info
  • release
  • 1.12.1-administration
  • 1.12.0-administration
  • 1.12.0-info
  • 2.27.0-alfa
  • 1.11.0-info
  • 1.11.0-administration
  • 2.26.0-alfa
  • 1.10.0-info
  • 1.10.0-administration
  • 2.25.0-alfa
  • 1.9.0-info
  • 1.9.0-administration
  • 2.24.0-alfa
  • 1.8.0-info
  • 1.8.0-administration
  • 2.23.0-alfa
  • 1.7.0-info
  • 1.7.0-administration
  • 2.22.0-alfa
  • 1.6.0-info
41 results

README.md

Blame
  • _helpers.tpl 3.70 KiB
    {{/* vim: set filetype=mustache: */}}
    
    {{/* Truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec) */}}
    {{/* Name */}}
    {{- define "app.name" -}}
    {{- default .Release.Name | toString | trunc 63 | trimSuffix "-" -}}
    {{- end -}}
    
    {{/* Namespace */}}
    {{- define "app.namespace" -}}
    {{- default .Release.Namespace | toString | trunc 63 | trimSuffix "-" -}}
    {{- end -}}
    
    {{/* Version */}}
    {{- define "app.version" -}}
    {{- default .Chart.Version | toString | trunc 63 | trimSuffix "-" -}}
    {{- end -}}
    
    {{/* Chart: Name + Version */}}
    {{- define "app.chart" -}}
    {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
    {{- end -}}
    
    {{/* Managed-by -> On Helm, this value is always Helm */}}
    {{- define "app.managedBy" -}}
    {{- default .Release.Service | toString | trunc 63 | trimSuffix "-" -}}
    {{- end -}}
    
    {{/* Default Labels: Helm recommended best-practice labels https://helm.sh/docs/chart_best_practices/labels/ */}}
    {{- define "app.defaultLabels" }}
    app.kubernetes.io/instance: user-manager
    app.kubernetes.io/managed-by: {{ include "app.managedBy" . }}
    app.kubernetes.io/name: {{ include "app.name" . }}
    app.kubernetes.io/namespace: {{ include "app.namespace" . }}
    app.kubernetes.io/part-of: kop
    app.kubernetes.io/version: {{ include "app.version" . }}
    helm.sh/chart: {{ include "app.chart" . }}
    {{- end -}}
    
    {{- define "app.matchLabels" }}
    app.kubernetes.io/name: {{ include "app.name" . }}
    app.kubernetes.io/namespace: {{ include "app.namespace" . }}
    {{- end -}}
    
    {{- define "app.imagePullSecret" }}
    {{- with .Values.imageCredentials }}
    {{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
    {{- end }}
    {{- end }}
    
    {{- define "app.cronjobScheduler" }}
    {{- printf "%d %d * * *" (div (randNumeric 2) 2) (div (randNumeric 1) 2) -}}
    {{- end -}}
    
    {{- define "app.kopEnvironment" -}}
    {{- required "Environment muss angegeben sein" (.Values.kop).environment -}}
    {{- end -}}
    
    {{- define "app.databasePassword" -}}
    {{- required "Database Passwort muss angegeben sein" (.Values.database).password -}}
    {{- end -}}
    
    {{- define "app.resources" }}
    {{- if eq (include "app.kopEnvironment" . ) "prod" }}
      limits:
        cpu: "500m"
        memory: "2000Mi"
      requests:
        cpu: "50m"
        memory: "250Mi"
    {{- else }}
      limits:
        cpu: "500m"
        memory: "100Mi"
      requests:
        cpu: "50m"
        memory: "100Mi"
    {{- end }}
    {{- end -}}
    
    {{- define "app.ssoServerUrl" -}}
    {{- if contains "https://" .Values.sso.serverUrl -}}
    {{- .Values.sso.serverUrl -}}
    {{- else -}}
    {{- printf "https://%s" .Values.sso.serverUrl -}}
    {{- end -}}
    {{- end -}}
    
    {{- define "app.kopBundesland" -}}
    {{- required "kop.bundesland must be set " (.Values.kop).bundesland }}
    {{- end -}}
    
    {{- define "app.kopBezeichner" -}}
    {{- if (.Values.kop).bezeichner -}}
    
    {{ $length := len (.Values.kop).bezeichner }}
    {{- if lt 27 $length -}}
    {{ required (printf "Bezeichner %s ist zu lang (max. 27 Zeichen)" (.Values.kop).bezeichner) nil }}
    {{- else -}}
    {{- required "Bezeichner muss angegeben sein" (.Values.kop).bezeichner -}}
    {{- end -}}
    {{- else -}}
    {{- required "Bezeichner muss angegeben sein" (.Values.kop).bezeichner -}}
    {{- end -}}
    {{- end -}}
    
    {{- define "app.ssoRealm" -}}
    {{ printf "%s-%s-%s" (include "app.kopBundesland" .) ( include "app.kopBezeichner" . ) ( include "app.kopEnvironment" . ) | trunc 63 | trimSuffix "-" }}
    {{- end -}}
    
    {{- define "app.baseUrl" -}}
    {{ printf "https://%s-%s.%s" (include "app.kopBezeichner" .) (include "app.name" .) .Values.baseUrl }}
    {{- end -}}
    
    {{- define "app.goofyAddress" -}}
    {{ printf "https://%s.%s" (include "app.kopBezeichner" .) .Values.baseUrl }}
    {{- end -}}