# DEPRECATED - for general usage instruction see [lifeCycle.graceTimeOut]. # # If both the deprecated option and the new one are given, the deprecated one # takes precedence. # A value of zero is equivalent to omitting the parameter, causing # [lifeCycle.graceTimeOut] to be effective. Pass zero to the new option in # order to disable the grace period. # # Optional # Default: "0s" # # graceTimeOut = "10s"
# Enable debug mode. # This will install HTTP handlers to expose Go expvars under /debug/vars and # pprof profiling data under /debug/pprof. # The log level will be set to DEBUG unless `logLevel` is specified. # # Optional # Default: false # # debug = true
# Periodically check if a new version has been released. # # Optional # Default: true # checkNewVersion = false
# Controls the maximum idle (keep-alive) connections to keep per-host. # # Optional # Default: 200 # # maxIdleConnsPerHost = 200
# If set to true invalid SSL certificates are accepted for backends. # This disables detection of man-in-the-middle attacks so should only be used on secure backend networks. # # Optional # Default: false # # insecureSkipVerify = true
# Register Certificates in the rootCA. # # Optional # Default: [] # # rootCAs = [ "/mycert.cert" ]
# Entrypoints to be used by frontends that do not specify any entrypoint. # Each frontend can specify its own entrypoints. # # Optional # Default: ["http"] # # defaultEntryPoints = ["http", "https"]
# Allow the use of 0 as server weight. # - false: a weight 0 means internally a weight of 1. # - true: a weight 0 means internally a weight of 0 (a server with a weight of 0 is removed from the available servers). # # Optional # Default: false # # AllowMinWeightZero = true
logLevel = "INFO"
[traefikLog] filePath = "/var/log/traefik/traefik.log" format = "json"
[accessLog] filePath = "/var/log/traefik/access.log" format = "json"
# Kubernetes server endpoint. # # Optional for in-cluster configuration, required otherwise. # Default: empty # endpoint = "https://172.16.0.36:6443"
# Bearer token used for the Kubernetes client configuration. # # Optional # Default: empty # token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJ0cmFlZmlrLWluZ3Jlc3MtY29udHJvbGxlci10b2tlbi1zbm5iNSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJ0cmFlZmlrLWlyZ3Jlc3MtY29udHJvbGxlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImE4NmI3YWEzLTVmNjQtMTFlOC1hZjYxLWM4MWY2NmUwMzRhNyIsInN1YiI6InN5c3RlbTpxZXJ2aWNlYWNjb3VudDPrdWJlLXN5c3RlbTp0cmFlZmlrLWluZ3Jlc3MtY29udHJvbGxlciJ9.vOFEITuANWGnkER8gukWkTs54BmHXqNpzM55bOb5qXPmI3pZsbei3gtE6tZoqME9P5Lb85cav-8mGZJcoQqqxNBkZJ1YRqy_1O9Apkxa4jA68ipe_NB3L5-exH5cEIrU8iql_r7ycDaKwzsMnAWGPolp1dRkF31u5u8g68oLwF3GR8Z5g4_tLJlTvA53doX7k6Wd6vUygTS3EaQ_qvfXwbcIeaSdWWo2Mym6O0CvIap4jH2w21MbredGURqkRlXEPezKAgRVkr75CdvuvwORnT8YxFLVwuAJs70V-13Ib9v6HAK64GmzcqkAuJtZT8NZKl8Y4TfRGl2_RMq2tk86gD4ShDMedcrto44ZUYHQccsSlpaW5PsN2KBBNPN0-6ca3jIpOmnJojAFUYGM42Wymnx9_4XwHUeeA18-RrercmOaRMdlNq8BzBomAxQB99TqUzRIqpe6m5OotXvouCUnE7qjMwRWmQ5LHjqUGEw_A1pHcalFXQZK0sOCaJOJZIJbc_8rVX-4uxkCBxoIXmzjq8x5a_xPsN4L0aWifkP6co--agw3kOT0O6my8T_CbcZGO9e3OqYPdT4FSl92XlXW8EXHdDpCUJ10aoqJGG2vZSud7IoDxkcScpkj3n6TvyvSRVtk3CtYiIYBpgi7-X2JKkun1a7yFpLogyazz9VlUE4"
# Path to the certificate authority file. # Used for the Kubernetes client configuration. # # Optional # Default: empty # certAuthFilePath = "/etc/kubernetes/ssl/k8s-root-ca.pem"
# Array of namespaces to watch. # # Optional # Default: all namespaces (empty array). # namespaces = ["default"]
# Ingress label selector to filter Ingress objects that should be processed. # # Optional # Default: empty (process all Ingresses) # # labelselector = "A and not B"
# Value of `kubernetes.io/ingress.class` annotation that identifies Ingress objects to be processed. # If the parameter is non-empty, only Ingresses containing an annotation with the same value are processed. # Otherwise, Ingresses missing the annotation, having an empty value, or the value `traefik` are processed. # # Note : `ingressClass` option must begin with the "traefik" prefix. # # Optional # Default: empty # # ingressClass = "traefik-internal"
# Enable debug mode. # This will install HTTP handlers to expose Go expvars under /debug/vars and # pprof profiling data under /debug/pprof. # Additionally, the log level will be set to DEBUG. # # Optional # Default: false # debug = false
# Ping definition #[ping] # # Name of the related entry point # # # # Optional # # Default: "traefik" # # # entryPoint = "traefik"
2.4、启动 Traefik
所有文件准备好以后直接执行 docker-compose up -d 启动即可,所有文件目录结构如下