Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ dependencies:
- name: nginx
version: 1.3.0
repository: oci://acrarolibotnonprod.azurecr.io/helm
- name: mclabels
version: 1.0.1
repository: oci://acrarolibotnonprod.azurecr.io/helm/infra
43 changes: 43 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,46 @@ Expand the name of the chart.
{{- define "files-server.name" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "files-server.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Returns the environment from global if exists or from the chart's values, defaults to development
*/}}
{{- define "files-server.environment" -}}
{{- if .Values.global.environment }}
{{- .Values.global.environment -}}
{{- else -}}
{{- .Values.environment | default "development" -}}
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "files-server.labels" -}}
app.kubernetes.io/name: {{ include "files-server.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
helm.sh/chart: {{ include "files-server.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: backend
environment: {{ include "files-server.environment" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
{{ include "mclabels.labels" . }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "files-server.selectorLabels" -}}
app.kubernetes.io/name: {{ include "files-server.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ include "mclabels.selectorLabels" . }}
{{- end }}
5 changes: 1 addition & 4 deletions helm/templates/nginx/nginx-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ kind: ConfigMap
metadata:
name: {{ $nginxConfigmapName }}
labels:
app: {{ $releaseName }}-{{ $chartName }}
component: nginx-configmap
environment: {{ .Values.environment }}
release: {{ $releaseName }}
{{ include "files-server.labels" . | indent 4 }}
data:
nginx.conf: {{ tpl (.Files.Get "config/nginx.conf") . | quote }}
{{- end }}
10 changes: 10 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ global:
gpkgSubPath: ""
ingress:
domain: "example.com"

mclabels:
#environment: development
component: backend
partOf: export
owner: raster
gisDomain: raster
prometheus:
enabled: true
port: 9117

enabled: true
environment: development
Expand Down