From 5b482a4ef8b0b591f0ae0eb0d6a0e1dd5824e7d2 Mon Sep 17 00:00:00 2001 From: "Kevin J. Qiu" Date: Thu, 6 Jul 2017 12:52:41 -0400 Subject: [PATCH] [stable/traefik] Allow enabling traefik access logs (#1302) * Added `accessLogs` section for traefik config * Update Traefik chart README * Fix typos and format consistency issues * Increment Traefik chart minor version --- stable/traefik/Chart.yaml | 2 +- stable/traefik/README.md | 3 +++ stable/traefik/templates/configmap.yaml | 7 +++++++ stable/traefik/values.yaml | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/stable/traefik/Chart.yaml b/stable/traefik/Chart.yaml index 8693b1f99972..b3709b04cb61 100755 --- a/stable/traefik/Chart.yaml +++ b/stable/traefik/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: traefik -version: 1.6.0 +version: 1.7.0 appVersion: 1.3.1 description: A Traefik based Kubernetes ingress controller with Let's Encrypt support keywords: diff --git a/stable/traefik/README.md b/stable/traefik/README.md index d81df221928f..bf70ac9c33f1 100644 --- a/stable/traefik/README.md +++ b/stable/traefik/README.md @@ -119,6 +119,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 should be in. Either `common` or `json` | `common` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: diff --git a/stable/traefik/templates/configmap.yaml b/stable/traefik/templates/configmap.yaml index db25629765f5..f06989f69941 100644 --- a/stable/traefik/templates/configmap.yaml +++ b/stable/traefik/templates/configmap.yaml @@ -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 }}" diff --git a/stable/traefik/values.yaml b/stable/traefik/values.yaml index 29d8011f083e..07038df5f13c 100644 --- a/stable/traefik/values.yaml +++ b/stable/traefik/values.yaml @@ -49,6 +49,11 @@ service: # key: value gzip: enabled: true +accessLogs: + enabled: false + ## Path to the access logs file. If not provided, Traefik defaults it to stdout. + # filePath: "" + format: common # choices are: common, json # Kubernetes ingress filters #kubernetes: # namespaces: