From 5c3c125d2348136a49ad97c782950d10adf108f2 Mon Sep 17 00:00:00 2001 From: Matthias Theuermann Date: Thu, 15 Feb 2024 12:05:19 +0100 Subject: [PATCH] fix: update Traefik to v3 to use OpenTelemetry --- .../traefik/traefik-dashboard-ingress.yaml | 25 ++++++-------- .../traefik/traefik-values.yaml | 33 +++++++++++++++++++ .../traefik/update-traefik.sh | 14 ++++++++ 3 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 dapr-distributed-calendar/traefik/traefik-values.yaml create mode 100755 dapr-distributed-calendar/traefik/update-traefik.sh diff --git a/dapr-distributed-calendar/traefik/traefik-dashboard-ingress.yaml b/dapr-distributed-calendar/traefik/traefik-dashboard-ingress.yaml index a097e93..38e24c1 100644 --- a/dapr-distributed-calendar/traefik/traefik-dashboard-ingress.yaml +++ b/dapr-distributed-calendar/traefik/traefik-dashboard-ingress.yaml @@ -1,20 +1,15 @@ --- -apiVersion: networking.k8s.io/v1 -kind: Ingress +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute metadata: name: traefik-ingress namespace: kube-system - annotations: - kubernetes.io/ingress.class: traefik spec: - rules: - - host: traefik.--01.. - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: traefik-dashboard - port: - number: 9000 + entryPoints: + - web + routes: + - match: Host(`traefik.--01..`) && PathPrefix(`/`) + kind: Rule + services: + - name: traefik-dashboard + port: 9000 \ No newline at end of file diff --git a/dapr-distributed-calendar/traefik/traefik-values.yaml b/dapr-distributed-calendar/traefik/traefik-values.yaml new file mode 100644 index 0000000..1134c9b --- /dev/null +++ b/dapr-distributed-calendar/traefik/traefik-values.yaml @@ -0,0 +1,33 @@ +image: + tag: "v3.0.0-beta3" +logs: + access: + enabled: true +metrics: + prometheus: null + openTelemetry: + ## Address of the OpenTelemetry Collector to send metrics to. + address: "otel-dapr-collector.opentelemetry:4317" + ## Enable metrics on entry points. + addEntryPointsLabels: true + ## Enable metrics on routers. + addRoutersLabels: true + ## Enable metrics on services. + addServicesLabels: true + ## Explicit boundaries for Histogram data points. + explicitBoundaries: + - "0.1" + - "0.3" + - "1.2" + - "5.0" + ## Allows reporter to send metrics to the OpenTelemetry Collector without using a secured protocol. + insecure: true + ## Interval at which metrics are sent to the OpenTelemetry Collector. + pushInterval: 10s + ## This instructs the reporter to send metrics to the OpenTelemetry Collector using gRPC. + grpc: true +tracing: + openTelemetry: + grpc: true + insecure: true + address: otel-dapr-collector.opentelemetry:4317 \ No newline at end of file diff --git a/dapr-distributed-calendar/traefik/update-traefik.sh b/dapr-distributed-calendar/traefik/update-traefik.sh new file mode 100755 index 0000000..0a7f1b0 --- /dev/null +++ b/dapr-distributed-calendar/traefik/update-traefik.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Add the Traefik Helm repository +helm repo add traefik https://traefik.github.io/charts + +# Update the Helm repositories +helm repo update + +# Uninstall Traefik +helm uninstall traefik --namespace kube-system + +# Reinstall Traefik +helm install traefik traefik/traefik --namespace kube-system --values traefik-values.yaml --wait +