Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/traefik] Allow enabling traefik access logs #1302

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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 stable/traefik/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ The following tables lists the configurable parameters of the Traefik chart and
| `gzip.enabled` | Whether to use gzip compression | `true` |
| `kubernetes.namespaces` | List of Kubernetes namespaces to watch | All namespaces |
| `kubernetes.labelSelector` | Valid Kubernetes ingress label selector to watch (e.g `realm=public`)| No label filter |
| `accessLogs.enabled` | Whether to enable Traefik's access logs | `false` |
| `accessLogs.filePath` | The path to the log file. Logs to stdout if omitted | None |
| `accessLogs.format` | What format the log entries shold be in. Either common or json | `common` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/shold/should

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in the description field, please enclose the words "common" and "json" in backticks (as you've done in the default column) to make it clear these are actual values that may be used.


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:

Expand Down
7 changes: 7 additions & 0 deletions stable/traefik/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ data:
labelselector = {{ .Values.kubernetes.labelSelector | quote }}
{{- end}}
{{- end}}
{{- if .Values.accessLogs.enabled }}
[accessLogs]
{{- if .Values.accessLogs.filePath }}
filePath = "{{ .Values.accessLogs.filePath }}"
{{- end}}
format = "{{ .Values.accessLogs.format }}"
{{- end}}
{{- if .Values.acme.enabled }}
[acme]
email = "{{ .Values.acme.email }}"
Expand Down
4 changes: 4 additions & 0 deletions stable/traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ service:
# key: value
gzip:
enabled: true
accessLogs:
enabled: false
filePath: "" # if empty, stdout is used
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work, but elsewhere in the file, attributes with no default value are commented instead of being set to the empty string. It will have the same effect and will promote consistency within this file.

format: "common" # choices are: common, json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, please remove quotes. Throughout the rest of this file, quotes aren't used in scenarios where they're optional.

# Kubernetes ingress filters
#kubernetes:
# namespaces:
Expand Down