From 3fea91c9473f4139401616c3ccdd07adb7fe8fee Mon Sep 17 00:00:00 2001 From: Ricardo Hernandez <430024+richerve@users.noreply.github.com> Date: Mon, 4 Feb 2019 14:08:06 +0000 Subject: [PATCH] [stable/traefik] HorizontalPodAutoscaler (#10288) * stable/traefik: Add hpa object Signed-off-by: Ricardo Hernandez * stable/traefik: bump version Signed-off-by: Ricardo Hernandez * stable/traefik: document autoscaling value Signed-off-by: Ricardo Hernandez * stable/traefik: Remove trailing whitespace in values Signed-off-by: Ricardo Hernandez * Comment autoscaling value Signed-off-by: Ricardo Hernandez --- stable/traefik/Chart.yaml | 2 +- stable/traefik/README.md | 1 + stable/traefik/templates/hpa.yaml | 20 ++++++++++++++++++++ stable/traefik/values.yaml | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 stable/traefik/templates/hpa.yaml diff --git a/stable/traefik/Chart.yaml b/stable/traefik/Chart.yaml index 05b477c57c..57315195b9 100644 --- a/stable/traefik/Chart.yaml +++ b/stable/traefik/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: traefik -version: 1.59.2 +version: 1.60.0 appVersion: 1.7.7 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 9b34a1c359..fa08954466 100644 --- a/stable/traefik/README.md +++ b/stable/traefik/README.md @@ -216,6 +216,7 @@ The following table lists the configurable parameters of the Traefik chart and t | `tracing.datadog.localAgentHostPort` | Location of the Datadog agent where spans will be sent | `127.0.0.1:8126` | | `tracing.datadog.debug` | Enables Datadog debugging | `false` | | `tracing.datadog.globalTag` | Apply shared tag in a form of Key:Value to all the traces | `""` | +| `autoscaling` | HorizontalPodAutoscaler for the traefik Deployment | `{}` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: diff --git a/stable/traefik/templates/hpa.yaml b/stable/traefik/templates/hpa.yaml new file mode 100644 index 0000000000..973f093e99 --- /dev/null +++ b/stable/traefik/templates/hpa.yaml @@ -0,0 +1,20 @@ +{{- if .Values.autoscaling }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "traefik.fullname" . }} + labels: + app: {{ template "traefik.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "traefik.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: +{{ toYaml .Values.autoscaling.metrics | indent 4 }} +{{- end }} diff --git a/stable/traefik/values.yaml b/stable/traefik/values.yaml index a9d2da9c10..5130bdd11a 100644 --- a/stable/traefik/values.yaml +++ b/stable/traefik/values.yaml @@ -374,3 +374,18 @@ tracing: # localAgentHostPort: "127.0.0.1:8126" # debug: false # globalTag: "" + +## Create HorizontalPodAutoscaler object. +## +# autoscaling: +# minReplicas: 1 +# maxReplicas: 10 +# metrics: +# - type: Resource +# resource: +# name: cpu +# targetAverageUtilization: 60 +# - type: Resource +# resource: +# name: memory +# targetAverageUtilization: 60