Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[promtail] Add enable service links for Promtail #1863

Merged
merged 8 commits into from
Nov 12, 2022
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
2 changes: 1 addition & 1 deletion charts/promtail/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: promtail
description: Promtail is an agent which ships the contents of local logs to a Loki instance
type: application
appVersion: 2.6.1
version: 6.6.1
version: 6.6.2
home: https://grafana.com/loki
sources:
- https://github.com/grafana/loki
Expand Down
3 changes: 2 additions & 1 deletion charts/promtail/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# promtail

![Version: 6.6.1](https://img.shields.io/badge/Version-6.6.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.1](https://img.shields.io/badge/AppVersion-2.6.1-informational?style=flat-square)
![Version: 6.6.2](https://img.shields.io/badge/Version-6.6.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.1](https://img.shields.io/badge/AppVersion-2.6.1-informational?style=flat-square)

Promtail is an agent which ships the contents of local logs to a Loki instance

Expand Down Expand Up @@ -92,6 +92,7 @@ The new release which will pick up again from the existing `positions.yaml`.
| deployment.autoscaling.targetMemoryUtilizationPercentage | string | `nil` | |
| deployment.enabled | bool | `false` | Deploys Promtail as a Deployment |
| deployment.replicaCount | int | `1` | |
| enableServiceLinks | bool | `true` | Configure enableServiceLinks in pod |
| extraArgs | list | `[]` | |
| extraContainers | object | `{}` | |
| extraEnv | list | `[]` | Extra environment variables |
Expand Down
11 changes: 11 additions & 0 deletions charts/promtail/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,14 @@ The service name to connect to Loki. Defaults to the same logic as "loki.fullnam
{{- end -}}
{{- end -}}
{{- end -}}

{{/* Configure enableServiceLinks in pod */}}
{{- define "promtail.enableServiceLinks" -}}
{{- if semverCompare ">=1.13-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if or (.Values.enableServiceLinks) (eq (.Values.enableServiceLinks | toString) "<nil>") -}}
enableServiceLinks: true
{{- else -}}
enableServiceLinks: false
{{- end -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions charts/promtail/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Pod template used in Daemonset and Deployment
{{- end }}
spec:
serviceAccountName: {{ include "promtail.serviceAccountName" . }}
{{ include "promtail.enableServiceLinks" . }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/promtail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ extraEnv: []
# -- Extra environment variables from secrets or configmaps
extraEnvFrom: []

# -- Configure enableServiceLinks in pod
enableServiceLinks: true

# ServiceMonitor configuration
serviceMonitor:
# -- If enabled, ServiceMonitor resources for Prometheus Operator are created
Expand Down