Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Add extensible label support on Kibana #555

Merged
merged 1 commit into from
May 29, 2020
Merged
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
[kibana] Add extensible label support
Common labels were moved to helpers template to have only one source of truth of common/added labels shared between all Kibana resources.

Also, this extends the capability to add a custom label and this will be common between all the resources.
  • Loading branch information
ramrodo committed May 28, 2020
commit 753a6774873f04dbb2ba1759c740d47061724647
12 changes: 12 additions & 0 deletions kibana/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,15 @@ Return the appropriate apiVersion for ingress.
{{- print "networking.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "kibana.labels" -}}
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels }}
{{- end }}
{{- end -}}
4 changes: 1 addition & 3 deletions kibana/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "kibana.fullname" . }}-config
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
labels: {{ include "kibana.labels" . | nindent 4 }}
data:
{{- range $path, $config := .Values.kibanaConfig }}
{{ $path }}: |
Expand Down
7 changes: 1 addition & 6 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "kibana.fullname" . }}
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
{{- range $key, $value := .Values.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels: {{ include "kibana.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicas }}
strategy:
Expand Down
5 changes: 1 addition & 4 deletions kibana/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ apiVersion: {{ template "kibana.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
labels: {{ include "kibana.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
Expand Down
5 changes: 1 addition & 4 deletions kibana/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ template "kibana.fullname" . }}
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service }}
labels: {{ include "kibana.labels" . | nindent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4}}
{{- end }}
Expand Down