Traefik la gi

[email protected]"

  storage="acme.json"

  entryPoint="web-secure"

  onHostRule=true

  [acme.httpChallenge]

    entryPoint ="web"

# static configuration

[entryPoints]

  [entryPoints.web]

    address=":80"

  [entryPoints.web-secure]

    address=":443"

[certificatesResolvers.sample.acme]

  email="[email protected]"

  storage="acme.json"

  [certificatesResolvers.sample.acme.httpChallenge]

    # used during the challenge

    entryPoint="web"

Traefik Logs

Có một thay đổi nhỏ đối với cấu hình logs của Traefik. Lưu ý, có nhiều loại cấu hình logs như: Traefik log, access log, metric logs… và phần này mình đang đề cập tới là Traefik log nhé. Ở version 2, tất cả các config cho traefik log bây giờ đã vào trong [log]; logLevel sẽ rút gọn thành level, trông như sau:

logLevel="INFO"

[traefikLog]

    filePath="/path/to/file"

    format="json"

[log]

    level="INFO"

    filePath="/path/to/file"

    format="json"

Tracing

Traefik vẫn implement tuân thủ theo các đặc tả của OpenTracing. V2 sẽ hỗ trợ nhiều distributed tracing system hơn:

Distributed SystemVersion 1Version 2
Jaeger
Zipkin
Datadog
Instana
Haystack

Cùng với đó là một thay đổi nhỏ trong config. Key backend sẽ không còn trên version 2:

# static configuration

[tracing]

  backend="jaeger"

  servicename="tracing"

  [tracing.jaeger]

    samplingParam =1.0

    samplingServerURL="//12.0.0.1:5778/sampling"

    samplingType="const"

    localAgentHostPort="12.0.0.1:6831"

# static configuration

[tracing]

  servicename="tracing"

  [tracing.jaeger]

    samplingParam=1.0

    samplingServerURL ="//12.0.0.1:5778/sampling"

    samplingType="const"

    localAgentHostPort="12.0.0.1:6831"

Metrics

Metrics trong version 2 sẽ support cho các services. Ngoài ra, Traefik vẫn support metric cho entry point giống version 1. Còn về config thì vẫn giống v1.

# static configuration

[metrics.prometheus]

  buckets=[0.1,0.3,1.2,5.0]

  entryPoint="metrics"

Version 2 vẫn hỗ trợ 4 system gồm:

Backend SystemVersion 1Version 2
Datadog
InfluxDB
Prometheus
StatsD

Không còn config ở Root Level

Nếu bạn để ý các config thay đổi ở trên thì sẽ nhận ra rằng các key ở root level đều đã bị chuyển vào trong một group nào đó. Thực sự thì phiên bản này đã loại bỏ toàn bộ các key ở root level trong file config. Chẳng hạn:

# static configuration

checkNewVersion=false

sendAnonymousUsage=true

logLevel="DEBUG"

insecureSkipVerify=true

rootCAs= ["/mycert.cert"]

maxIdleConnsPerHost=200

providersThrottleDuration="2s"

AllowMinWeightZero=true

debug=true

defaultEntryPoints =["web","web-secure"]

keepTrailingSlash=false

# static configuration

[global]

  checkNewVersion=true

  sendAnonymousUsage=true

[log]

  level= "DEBUG"

[serversTransport]

  insecureSkipVerify=true

  rootCAs=["/mycert.cert"]

  maxIdleConnsPerHost= 42

[providers]

  providersThrottleDuration=42

Bài Viết Liên Quan

Chủ Đề