Skip to content

Commit

Permalink
Helm: Fix the reference error of loki/loki helm chart (grafana#1056)
Browse files Browse the repository at this point in the history
* fix a reference error of loki/loki helm chart
add new valuable "client.name"
instead of "promtail.name"

* bump loki-stack chart

* Add missing chart version

Co-authored-by: cyriltovena <cyril.tovena@gmail.com>
  • Loading branch information
polar3130 and cyriltovena committed Oct 24, 2019
1 parent e586ced commit 23a86d0
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions production/helm/fluent-bit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apiVersion: "v1"
name: fluent-bit
version: 0.0.2
appVersion: v0.0.1
Expand Down
3 changes: 2 additions & 1 deletion production/helm/loki-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apiVersion: "v1"
name: loki-stack
version: 0.17.3
version: 0.17.4
appVersion: v0.3.0
kubeVersion: "^1.10.0-0"
description: "Loki: like Prometheus, but for logs."
Expand Down
3 changes: 2 additions & 1 deletion production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apiVersion: "v1"
name: loki
version: 0.16.0
version: 0.16.1
appVersion: v0.3.0
kubeVersion: "^1.10.0-0"
description: "Loki: like Prometheus, but for logs."
Expand Down
18 changes: 18 additions & 0 deletions production/helm/loki/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,21 @@ Create the name of the service account
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Create the app name of loki clients. Defaults to the same logic as "loki.fullname", and default client expects "promtail".
*/}}
{{- define "client.name" -}}
{{- if .Values.client.name -}}
{{- .Values.client.name -}}
{{- else if .Values.client.fullnameOverride -}}
{{- .Values.client.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "promtail" .Values.client.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion production/helm/loki/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- from:
- podSelector:
matchLabels:
app: {{ template "promtail.name" . }}
app: {{ template "client.name" . }}
release: {{ .Release.Name }}
- ports:
- port: {{ .Values.service.port }}
Expand Down
4 changes: 4 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ livenessProbe:
networkPolicy:
enabled: false

## The app name of loki clients
client: {}
# name:

## ref: https://kubernetes.io/docs/user-guide/node-selection/
nodeSelector: {}

Expand Down
1 change: 1 addition & 0 deletions production/helm/promtail/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apiVersion: "v1"
name: promtail
version: 0.12.3
appVersion: v0.3.0
Expand Down

0 comments on commit 23a86d0

Please sign in to comment.