diff --git a/docs/content/reference/dynamic-configuration/kubernetes-crd-resource.yml b/docs/content/reference/dynamic-configuration/kubernetes-crd-resource.yml index 0a9a98bd7..f6ef713d6 100644 --- a/docs/content/reference/dynamic-configuration/kubernetes-crd-resource.yml +++ b/docs/content/reference/dynamic-configuration/kubernetes-crd-resource.yml @@ -91,21 +91,11 @@ spec: services: - name: s1 port: 80 - healthCheck: - path: /health - host: baz.com - intervalSeconds: 7 - timeoutSeconds: 60 # strategy defines the load balancing strategy between the servers. It defaults # to Round Robin, and for now only Round Robin is supported anyway. strategy: RoundRobin - name: s2 port: 433 - healthCheck: - path: /health - host: baz.com - intervalSeconds: 7 - timeoutSeconds: 60 - match: PathPrefix(`/misc`) services: - name: s3 diff --git a/docs/content/reference/static-configuration/cli-ref.md b/docs/content/reference/static-configuration/cli-ref.md index 4d63cc971..900786896 100644 --- a/docs/content/reference/static-configuration/cli-ref.md +++ b/docs/content/reference/static-configuration/cli-ref.md @@ -106,13 +106,13 @@ HTTP configuration. Default middlewares for the routers linked to the entry point. `--entrypoints..http.redirections.entrypoint.permanent`: -Applied a permanent redirection. Defaults to true. (Default: ```true```) +Applied a permanent redirection. (Default: ```true```) `--entrypoints..http.redirections.entrypoint.priority`: -Priority of the generated router. Defaults to 1. (Default: ```1```) +Priority of the generated router. (Default: ```2147483647```) `--entrypoints..http.redirections.entrypoint.scheme`: -Scheme used for the redirection. Defaults to https. (Default: ```https```) +Scheme used for the redirection. (Default: ```https```) `--entrypoints..http.redirections.entrypoint.to`: Targeted entry point of the redirection. diff --git a/docs/content/reference/static-configuration/env-ref.md b/docs/content/reference/static-configuration/env-ref.md index 6800f51f9..70c7803e4 100644 --- a/docs/content/reference/static-configuration/env-ref.md +++ b/docs/content/reference/static-configuration/env-ref.md @@ -106,13 +106,13 @@ HTTP configuration. Default middlewares for the routers linked to the entry point. `TRAEFIK_ENTRYPOINTS__HTTP_REDIRECTIONS_ENTRYPOINT_PERMANENT`: -Applied a permanent redirection. Defaults to true. (Default: ```true```) +Applied a permanent redirection. (Default: ```true```) `TRAEFIK_ENTRYPOINTS__HTTP_REDIRECTIONS_ENTRYPOINT_PRIORITY`: -Priority of the generated router. Defaults to 1. (Default: ```1```) +Priority of the generated router. (Default: ```2147483647```) `TRAEFIK_ENTRYPOINTS__HTTP_REDIRECTIONS_ENTRYPOINT_SCHEME`: -Scheme used for the redirection. Defaults to https. (Default: ```https```) +Scheme used for the redirection. (Default: ```https```) `TRAEFIK_ENTRYPOINTS__HTTP_REDIRECTIONS_ENTRYPOINT_TO`: Targeted entry point of the redirection. diff --git a/docs/content/routing/services/index.md b/docs/content/routing/services/index.md index c5ab39e0b..380df3c75 100644 --- a/docs/content/routing/services/index.md +++ b/docs/content/routing/services/index.md @@ -334,6 +334,12 @@ Below are the available options for the health check mechanism: Traefik keeps monitoring the health of unhealthy servers. If a server has recovered (returning `2xx` -> `3xx` responses again), it will be added back to the load balacer rotation pool. +!!! warning "Health check in Kubernetes" + + The Traefik health check is not available for `kubernetesCRD` and `kubernetesIngress` providers because Kubernetes + has already an health check mecanism. + Unhealthy pods will be removed by kubernetes. (cf [liveness documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request)) + ??? example "Custom Interval & Timeout -- Using the [File Provider](../../providers/file.md)" ```toml tab="TOML" diff --git a/pkg/config/static/entrypoints.go b/pkg/config/static/entrypoints.go index ab68db0ac..46629b7c6 100644 --- a/pkg/config/static/entrypoints.go +++ b/pkg/config/static/entrypoints.go @@ -62,9 +62,9 @@ type Redirections struct { // RedirectEntryPoint is the definition of an entry point redirection. type RedirectEntryPoint struct { To string `description:"Targeted entry point of the redirection." json:"to,omitempty" toml:"to,omitempty" yaml:"to,omitempty"` - Scheme string `description:"Scheme used for the redirection. Defaults to https." json:"https,omitempty" toml:"https,omitempty" yaml:"https,omitempty"` - Permanent bool `description:"Applied a permanent redirection. Defaults to true." json:"permanent,omitempty" toml:"permanent,omitempty" yaml:"permanent,omitempty"` - Priority int `description:"Priority of the generated router. Defaults to 1." json:"priority,omitempty" toml:"priority,omitempty" yaml:"priority,omitempty"` + Scheme string `description:"Scheme used for the redirection." json:"https,omitempty" toml:"https,omitempty" yaml:"https,omitempty"` + Permanent bool `description:"Applied a permanent redirection." json:"permanent,omitempty" toml:"permanent,omitempty" yaml:"permanent,omitempty"` + Priority int `description:"Priority of the generated router." json:"priority,omitempty" toml:"priority,omitempty" yaml:"priority,omitempty"` } // SetDefaults sets the default values. diff --git a/pkg/provider/kubernetes/crd/traefik/v1alpha1/ingressroute.go b/pkg/provider/kubernetes/crd/traefik/v1alpha1/ingressroute.go index 9cc3face3..0f3ba4f8b 100644 --- a/pkg/provider/kubernetes/crd/traefik/v1alpha1/ingressroute.go +++ b/pkg/provider/kubernetes/crd/traefik/v1alpha1/ingressroute.go @@ -69,7 +69,6 @@ type LoadBalancerSpec struct { // and therefore should only be specified when Name references a Kubernetes Service. Port int32 `json:"port"` Scheme string `json:"scheme,omitempty"` - HealthCheck *HealthCheck `json:"healthCheck,omitempty"` Strategy string `json:"strategy,omitempty"` PassHostHeader *bool `json:"passHostHeader,omitempty"` ResponseForwarding *dynamic.ResponseForwarding `json:"responseForwarding,omitempty"` @@ -90,16 +89,6 @@ type MiddlewareRef struct { Namespace string `json:"namespace"` } -// HealthCheck is the HealthCheck definition. -type HealthCheck struct { - Path string `json:"path"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme"` - IntervalSeconds int64 `json:"intervalSeconds"` - TimeoutSeconds int64 `json:"timeoutSeconds"` - Headers map[string]string `json:"headers"` -} - // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/provider/kubernetes/crd/traefik/v1alpha1/zz_generated.deepcopy.go b/pkg/provider/kubernetes/crd/traefik/v1alpha1/zz_generated.deepcopy.go index 69473f773..d7ac29e4f 100644 --- a/pkg/provider/kubernetes/crd/traefik/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/provider/kubernetes/crd/traefik/v1alpha1/zz_generated.deepcopy.go @@ -188,29 +188,6 @@ func (in *ForwardAuth) DeepCopy() *ForwardAuth { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheck) DeepCopyInto(out *HealthCheck) { - *out = *in - if in.Headers != nil { - in, out := &in.Headers, &out.Headers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheck. -func (in *HealthCheck) DeepCopy() *HealthCheck { - if in == nil { - return nil - } - out := new(HealthCheck) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressRoute) DeepCopyInto(out *IngressRoute) { *out = *in @@ -493,11 +470,6 @@ func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { *out = new(dynamic.Sticky) (*in).DeepCopyInto(*out) } - if in.HealthCheck != nil { - in, out := &in.HealthCheck, &out.HealthCheck - *out = new(HealthCheck) - (*in).DeepCopyInto(*out) - } if in.PassHostHeader != nil { in, out := &in.PassHostHeader, &out.PassHostHeader *out = new(bool)