Skip to content

Commit

Permalink
feat: ➖ remove Traefik Hub v1 integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur committed May 23, 2023
1 parent 379f417 commit 1f29975
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 351 deletions.
3 changes: 1 addition & 2 deletions traefik/VALUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Kubernetes: `>=1.16.0-0`
| affinity | object | `{}` | on nodes where no other traefik pods are scheduled. It should be used when hostNetwork: true to prevent port conflicts |
| autoscaling.enabled | bool | `false` | Create HorizontalPodAutoscaler object. |
| certResolvers | object | `{}` | Certificates resolvers configuration |
| commonLabels | object | `{}` | Add additional label to all resources |
| deployment.additionalContainers | list | `[]` | Additional containers (e.g. for metric offloading sidecars) |
| deployment.additionalVolumes | list | `[]` | Additional volumes available for use with initContainers and additionalContainers |
| deployment.annotations | object | `{}` | Additional deployment annotations (e.g. for jaeger-operator sidecar injection) |
Expand All @@ -59,8 +60,6 @@ Kubernetes: `>=1.16.0-0`
| extraObjects | list | `[]` | Extra objects to deploy (value evaluated as a template) In some cases, it can avoid the need for additional, extended or adhoc deployments. See #595 for more details and traefik/tests/values/extra.yaml for example. |
| globalArguments | list | `["--global.checknewversion","--global.sendanonymoususage"]` | Global command arguments to be passed to all traefik's pods |
| hostNetwork | bool | `false` | If hostNetwork is true, runs traefik in the host network namespace To prevent unschedulabel pods due to port collisions, if hostNetwork=true and replicas>1, a pod anti-affinity is recommended and will be set if the affinity is left as default. |
| hub | object | `{"enabled":false}` | Add additional label to all resources commonLabels: key: value Traefik Hub integration |
| hub.enabled | bool | `false` | Enabling Hub will: <ul><li>enable Traefik Hub integration on Traefik</li> <li>add `traefikhub-tunl` endpoint</li> <li>enable Prometheus metrics with addRoutersLabels</li> <li>enable allowExternalNameServices on KubernetesIngress provider</li> <li>enable allowCrossNamespace on KubernetesCRD provider</li> <li>add an internal (ClusterIP) Service, dedicated for Traefik Hub</li> |
| image.pullPolicy | string | `"IfNotPresent"` | Traefik image pull policy |
| image.registry | string | `"docker.io"` | Traefik image host registry |
| image.repository | string | `"traefik"` | Traefik image repository |
Expand Down
15 changes: 0 additions & 15 deletions traefik/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@
Traefik Proxy {{ .Values.image.tag | default .Chart.AppVersion }} has been deployed successfully
on {{ template "traefik.namespace" . }} namespace !

{{- if .Values.hub.enabled }}
{{- if coalesce (ne (include "traefik.namespace" .) "hub-agent") .Values.hub.tunnelPort (ne (.Values.ports.metrics.port | int) 9100) }}

Traefik Hub integration is enabled ! With your specific parameters,
`metricsURL`, `tunnelHost` and `tunnelPort` needs to be set accordingly
on hub-agent Helm Chart. Based on this Chart, it should be:

--set controllerDeployment.traefik.metricsURL=http://traefik-hub.{{ template "traefik.namespace" . }}.svc.cluster.local:{{ .Values.ports.metrics.port }}/metrics
--set tunnelDeployment.traefik.tunnelHost=traefik-hub.{{ template "traefik.namespace" . }}.svc.cluster.local
--set tunnelDeployment.traefik.tunnelPort={{ default 9901 .Values.hub.tunnelPort }}

See https://doc.traefik.io/traefik-hub/install/#traefik-hub-agent-install-with-helmchart

{{- end }}
{{- end }}
{{- if .Values.persistence }}
{{- if and .Values.persistence.enabled (empty .Values.deployment.initContainer)}}

Expand Down
4 changes: 2 additions & 2 deletions traefik/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ app.kubernetes.io/instance: {{ template "traefik.instance-name" . }}
{{ include "traefik.labelselector" . }}
helm.sh/chart: {{ template "traefik.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.commonLabels }}
{{ toYaml .Values.commonLabels }}
{{- with .Values.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}

Expand Down
38 changes: 5 additions & 33 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.hub.enabled }}
- name: "traefikhub-tunl"
containerPort: {{ default 9901 .Values.hub.tunnelPort }}
protocol: "TCP"
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
Expand Down Expand Up @@ -248,10 +243,10 @@
{{- end }}
{{- end }}
{{- end }}
{{- if (or .Values.metrics.prometheus .Values.hub.enabled) }}
{{- if (.Values.metrics.prometheus) }}
- "--metrics.prometheus=true"
- "--metrics.prometheus.entrypoint={{ .Values.metrics.prometheus.entryPoint }}"
{{- if (or (eq (.Values.metrics.prometheus.addRoutersLabels | toString) "true") .Values.hub.enabled) }}
{{- if (eq (.Values.metrics.prometheus.addRoutersLabels | toString) "true") }}
- "--metrics.prometheus.addRoutersLabels=true"
{{- end }}
{{- if ne .Values.metrics.prometheus.addEntryPointsLabels nil }}
Expand Down Expand Up @@ -483,10 +478,10 @@
{{- if .Values.providers.kubernetesCRD.ingressClass }}
- "--providers.kubernetescrd.ingressClass={{ .Values.providers.kubernetesCRD.ingressClass }}"
{{- end }}
{{- if (or .Values.providers.kubernetesCRD.allowCrossNamespace .Values.hub.enabled) }}
{{- if .Values.providers.kubernetesCRD.allowCrossNamespace }}
- "--providers.kubernetescrd.allowCrossNamespace=true"
{{- end }}
{{- if (or .Values.providers.kubernetesCRD.allowExternalNameServices .Values.hub.enabled) }}
{{- if .Values.providers.kubernetesCRD.allowExternalNameServices }}
- "--providers.kubernetescrd.allowExternalNameServices=true"
{{- end }}
{{- if .Values.providers.kubernetesCRD.allowEmptyServices }}
Expand All @@ -495,7 +490,7 @@
{{- end }}
{{- if .Values.providers.kubernetesIngress.enabled }}
- "--providers.kubernetesingress"
{{- if (or .Values.providers.kubernetesIngress.allowExternalNameServices .Values.hub.enabled) }}
{{- if .Values.providers.kubernetesIngress.allowExternalNameServices }}
- "--providers.kubernetesingress.allowExternalNameServices=true"
{{- end }}
{{- if .Values.providers.kubernetesIngress.allowEmptyServices }}
Expand Down Expand Up @@ -636,29 +631,6 @@
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.hub.enabled }}
- "--hub"
{{- if .Values.hub.tunnelPort }}
- --entrypoints.traefikhub-tunl.address=:{{.Values.hub.tunnelPort}}
{{- end }}
{{- with .Values.hub.tls }}
{{- if (and .insecure (coalesce .ca .cert .key)) }}
{{- fail "ERROR: You cannot specify insecure and certs on TLS for Traefik Hub at the same time" }}
{{- end }}
{{- if .insecure }}
- "--hub.tls.insecure=true"
{{- end }}
{{- if .ca }}
- "--hub.tls.ca={{ .ca }}"
{{- end }}
{{- if .cert }}
- "--hub.tls.cert={{ .cert }}"
{{- end }}
{{- if .key }}
- "--hub.tls.key={{ .key }}"
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.additionalArguments }}
{{- range . }}
- {{ . | quote }}
Expand Down
3 changes: 3 additions & 0 deletions traefik/templates/_service-metrics.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ app.kubernetes.io/component: metrics
{{ include "traefik.metricslabelselector" . }}
helm.sh/chart: {{ template "traefik.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}

25 changes: 0 additions & 25 deletions traefik/templates/service-hub.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion traefik/templates/service-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.metrics.prometheus }}
{{- if .Values.metrics.prometheus.service }}
{{- if (and (.Values.metrics.prometheus.service).enabled (not .Values.hub.enabled)) -}}
{{- if (.Values.metrics.prometheus.service).enabled -}}

{{- $fullname := include "traefik.fullname" . }}
{{- if ge (len $fullname) 50 }}
Expand Down
2 changes: 1 addition & 1 deletion traefik/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{{- end -}}
{{- end -}}

{{- if and (eq $exposedPorts false) (not .Values.hub.enabled) -}}
{{- if (eq $exposedPorts false) -}}
{{- fail "You need to expose at least one port or set enabled=false to service" -}}
{{- end -}}

Expand Down
4 changes: 2 additions & 2 deletions traefik/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
namespace: {{ . }}
{{- end }}
labels:
{{- if (and (.Values.metrics.prometheus.service).enabled (not .Values.hub.enabled)) }}
{{- if (.Values.metrics.prometheus.service).enabled }}
{{- include "traefik.metricsservicelabels" . | nindent 4 }}
{{- else }}
{{- include "traefik.labels" . | nindent 4 }}
Expand Down Expand Up @@ -62,7 +62,7 @@ spec:
{{- end }}
selector:
matchLabels:
{{- if (and (.Values.metrics.prometheus.service).enabled (not .Values.hub.enabled)) }}
{{- if (.Values.metrics.prometheus.service).enabled }}
{{- include "traefik.metricslabelselector" . | nindent 6 }}
{{- else }}
{{- include "traefik.labelselector" . | nindent 6 }}
Expand Down
2 changes: 0 additions & 2 deletions traefik/tests/common-metadata_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ templates:
- poddisruptionbudget.yaml
- prometheusrules.yaml
- pvc.yaml
- service-hub.yaml
- service-internal.yaml
- servicemonitor.yaml
- service.yaml
Expand All @@ -35,7 +34,6 @@ tests:
metrics.prometheus.service.enabled: true
service.internal.a: {}
persistence.enabled: true
hub.enabled: enabled
tlsStore.a: {}
tlsOptions.a: {}
podSecurityPolicy.enabled: true
Expand Down

0 comments on commit 1f29975

Please sign in to comment.