Skip to content

Commit

Permalink
Merge pull request #2990 from emilkor1/main
Browse files Browse the repository at this point in the history
[promtail] Add automount option for service account and pod
  • Loading branch information
zanhsieh authored Aug 26, 2024
2 parents 0af99fa + 2dbb6d0 commit f2ee54a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
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: 3.0.0
version: 6.16.4
version: 6.16.5
home: https://grafana.com/loki
sources:
- https://github.com/grafana/loki
Expand Down
4 changes: 3 additions & 1 deletion charts/promtail/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# promtail

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

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

Expand Down Expand Up @@ -70,6 +70,7 @@ The new release which will pick up again from the existing `positions.yaml`.
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity configuration for pods |
| annotations | object | `{}` | Annotations for the DaemonSet |
| automountServiceAccountToken | bool | `true` | Automatically mount API credentials for a particular Pod |
| config | object | See `values.yaml` | Section for crafting Promtails config file. The only directly relevant value is `config.file` which is a templated string that references the other values and snippets below this key. |
| config.clients | list | See `values.yaml` | The config of clients of the Promtail server Must be reference in `config.file` to configure `clients` |
| config.enableTracing | bool | `false` | The config to enable tracing |
Expand Down Expand Up @@ -147,6 +148,7 @@ The new release which will pick up again from the existing `positions.yaml`.
| service.enabled | bool | `false` | |
| service.labels | object | `{}` | Labels for the service |
| serviceAccount.annotations | object | `{}` | Annotations for the service account |
| serviceAccount.automountServiceAccountToken | bool | `true` | Automatically mount a ServiceAccount's API credentials |
| serviceAccount.create | bool | `true` | Specifies whether a ServiceAccount should be created |
| serviceAccount.imagePullSecrets | list | `[]` | Image pull secrets for the service account |
| serviceAccount.name | string | `nil` | The name of the ServiceAccount to use. If not set and `create` is true, a name is generated using the fullname template |
Expand Down
1 change: 1 addition & 0 deletions charts/promtail/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ metadata:
{{- end }}
spec:
serviceAccountName: {{ include "promtail.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- include "promtail.enableServiceLinks" . | nindent 2 }}
{{- with .Values.hostNetwork }}
hostNetwork: {{ . }}
Expand Down
1 change: 1 addition & 0 deletions charts/promtail/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metadata:
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- with .Values.serviceAccount.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
Expand Down
5 changes: 5 additions & 0 deletions charts/promtail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ serviceAccount:
imagePullSecrets: []
# -- Annotations for the service account
annotations: {}
# -- Automatically mount a ServiceAccount's API credentials
automountServiceAccountToken: true

# -- Automatically mount API credentials for a particular Pod
automountServiceAccountToken: true

# -- Node selector for pods
nodeSelector: {}
Expand Down

0 comments on commit f2ee54a

Please sign in to comment.