diff --git a/docs/content/middlewares/http/overview.md b/docs/content/middlewares/http/overview.md index cd358371a..d270ea8c2 100644 --- a/docs/content/middlewares/http/overview.md +++ b/docs/content/middlewares/http/overview.md @@ -153,3 +153,7 @@ http: | [Retry](retry.md) | Automatically retries in case of error | Request lifecycle | | [StripPrefix](stripprefix.md) | Changes the path of the request | Path Modifier | | [StripPrefixRegex](stripprefixregex.md) | Changes the path of the request | Path Modifier | + +## Community Middlewares + +Please take a look at the community-contributed plugins in the [plugin catalog](https://pilot.traefik.io/plugins). diff --git a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml index 6dfff51b9..0db126be5 100644 --- a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml +++ b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml @@ -204,8 +204,11 @@ spec: description: Domain holds a domain name with SANs. properties: main: + description: Main defines the main domain name. type: string sans: + description: SANs defines the subject alternative domain + names. items: type: string type: array @@ -408,8 +411,11 @@ spec: description: Domain holds a domain name with SANs. properties: main: + description: Main defines the main domain name. type: string sans: + description: SANs defines the subject alternative domain + names. items: type: string type: array @@ -1282,6 +1288,8 @@ spec: plugin: additionalProperties: x-kubernetes-preserve-unknown-fields: true + description: 'Plugin defines the middleware plugin configuration. + More info: https://doc.traefik.io/traefik/plugins/' type: object rateLimit: description: 'RateLimit holds the rate limit configuration. This middleware diff --git a/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutes.yaml b/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutes.yaml index d79c4539d..b1dbbc4de 100644 --- a/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutes.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutes.yaml @@ -204,8 +204,11 @@ spec: description: Domain holds a domain name with SANs. properties: main: + description: Main defines the main domain name. type: string sans: + description: SANs defines the subject alternative domain + names. items: type: string type: array diff --git a/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutetcps.yaml b/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutetcps.yaml index 1be022474..5e83a9bc8 100644 --- a/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutetcps.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.containo.us_ingressroutetcps.yaml @@ -143,8 +143,11 @@ spec: description: Domain holds a domain name with SANs. properties: main: + description: Main defines the main domain name. type: string sans: + description: SANs defines the subject alternative domain + names. items: type: string type: array diff --git a/docs/content/reference/dynamic-configuration/traefik.containo.us_middlewares.yaml b/docs/content/reference/dynamic-configuration/traefik.containo.us_middlewares.yaml index 1520b663b..b6540433c 100644 --- a/docs/content/reference/dynamic-configuration/traefik.containo.us_middlewares.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.containo.us_middlewares.yaml @@ -711,6 +711,8 @@ spec: plugin: additionalProperties: x-kubernetes-preserve-unknown-fields: true + description: 'Plugin defines the middleware plugin configuration. + More info: https://doc.traefik.io/traefik/plugins/' type: object rateLimit: description: 'RateLimit holds the rate limit configuration. This middleware diff --git a/integration/fixtures/k8s/01-traefik-crd.yml b/integration/fixtures/k8s/01-traefik-crd.yml index 6dfff51b9..0db126be5 100644 --- a/integration/fixtures/k8s/01-traefik-crd.yml +++ b/integration/fixtures/k8s/01-traefik-crd.yml @@ -204,8 +204,11 @@ spec: description: Domain holds a domain name with SANs. properties: main: + description: Main defines the main domain name. type: string sans: + description: SANs defines the subject alternative domain + names. items: type: string type: array @@ -408,8 +411,11 @@ spec: description: Domain holds a domain name with SANs. properties: main: + description: Main defines the main domain name. type: string sans: + description: SANs defines the subject alternative domain + names. items: type: string type: array @@ -1282,6 +1288,8 @@ spec: plugin: additionalProperties: x-kubernetes-preserve-unknown-fields: true + description: 'Plugin defines the middleware plugin configuration. + More info: https://doc.traefik.io/traefik/plugins/' type: object rateLimit: description: 'RateLimit holds the rate limit configuration. This middleware diff --git a/pkg/provider/kubernetes/crd/traefik/v1alpha1/middleware.go b/pkg/provider/kubernetes/crd/traefik/v1alpha1/middleware.go index 1f755ae7f..e92c7695b 100644 --- a/pkg/provider/kubernetes/crd/traefik/v1alpha1/middleware.go +++ b/pkg/provider/kubernetes/crd/traefik/v1alpha1/middleware.go @@ -26,29 +26,31 @@ type Middleware struct { // MiddlewareSpec defines the desired state of a Middleware. type MiddlewareSpec struct { - AddPrefix *dynamic.AddPrefix `json:"addPrefix,omitempty"` - StripPrefix *dynamic.StripPrefix `json:"stripPrefix,omitempty"` - StripPrefixRegex *dynamic.StripPrefixRegex `json:"stripPrefixRegex,omitempty"` - ReplacePath *dynamic.ReplacePath `json:"replacePath,omitempty"` - ReplacePathRegex *dynamic.ReplacePathRegex `json:"replacePathRegex,omitempty"` - Chain *Chain `json:"chain,omitempty"` - IPWhiteList *dynamic.IPWhiteList `json:"ipWhiteList,omitempty"` - Headers *dynamic.Headers `json:"headers,omitempty"` - Errors *ErrorPage `json:"errors,omitempty"` - RateLimit *RateLimit `json:"rateLimit,omitempty"` - RedirectRegex *dynamic.RedirectRegex `json:"redirectRegex,omitempty"` - RedirectScheme *dynamic.RedirectScheme `json:"redirectScheme,omitempty"` - BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - DigestAuth *DigestAuth `json:"digestAuth,omitempty"` - ForwardAuth *ForwardAuth `json:"forwardAuth,omitempty"` - InFlightReq *dynamic.InFlightReq `json:"inFlightReq,omitempty"` - Buffering *dynamic.Buffering `json:"buffering,omitempty"` - CircuitBreaker *dynamic.CircuitBreaker `json:"circuitBreaker,omitempty"` - Compress *dynamic.Compress `json:"compress,omitempty"` - PassTLSClientCert *dynamic.PassTLSClientCert `json:"passTLSClientCert,omitempty"` - Retry *Retry `json:"retry,omitempty"` - ContentType *dynamic.ContentType `json:"contentType,omitempty"` - Plugin map[string]apiextensionv1.JSON `json:"plugin,omitempty"` + AddPrefix *dynamic.AddPrefix `json:"addPrefix,omitempty"` + StripPrefix *dynamic.StripPrefix `json:"stripPrefix,omitempty"` + StripPrefixRegex *dynamic.StripPrefixRegex `json:"stripPrefixRegex,omitempty"` + ReplacePath *dynamic.ReplacePath `json:"replacePath,omitempty"` + ReplacePathRegex *dynamic.ReplacePathRegex `json:"replacePathRegex,omitempty"` + Chain *Chain `json:"chain,omitempty"` + IPWhiteList *dynamic.IPWhiteList `json:"ipWhiteList,omitempty"` + Headers *dynamic.Headers `json:"headers,omitempty"` + Errors *ErrorPage `json:"errors,omitempty"` + RateLimit *RateLimit `json:"rateLimit,omitempty"` + RedirectRegex *dynamic.RedirectRegex `json:"redirectRegex,omitempty"` + RedirectScheme *dynamic.RedirectScheme `json:"redirectScheme,omitempty"` + BasicAuth *BasicAuth `json:"basicAuth,omitempty"` + DigestAuth *DigestAuth `json:"digestAuth,omitempty"` + ForwardAuth *ForwardAuth `json:"forwardAuth,omitempty"` + InFlightReq *dynamic.InFlightReq `json:"inFlightReq,omitempty"` + Buffering *dynamic.Buffering `json:"buffering,omitempty"` + CircuitBreaker *dynamic.CircuitBreaker `json:"circuitBreaker,omitempty"` + Compress *dynamic.Compress `json:"compress,omitempty"` + PassTLSClientCert *dynamic.PassTLSClientCert `json:"passTLSClientCert,omitempty"` + Retry *Retry `json:"retry,omitempty"` + ContentType *dynamic.ContentType `json:"contentType,omitempty"` + // Plugin defines the middleware plugin configuration. + // More info: https://doc.traefik.io/traefik/plugins/ + Plugin map[string]apiextensionv1.JSON `json:"plugin,omitempty"` } // +k8s:deepcopy-gen=true diff --git a/pkg/types/domains.go b/pkg/types/domains.go index b13fbbd2f..3d62adb50 100644 --- a/pkg/types/domains.go +++ b/pkg/types/domains.go @@ -8,7 +8,9 @@ import ( // Domain holds a domain name with SANs. type Domain struct { - Main string `description:"Default subject name." json:"main,omitempty" toml:"main,omitempty" yaml:"main,omitempty"` + // Main defines the main domain name. + Main string `description:"Default subject name." json:"main,omitempty" toml:"main,omitempty" yaml:"main,omitempty"` + // SANs defines the subject alternative domain names. SANs []string `description:"Subject alternative names." json:"sans,omitempty" toml:"sans,omitempty" yaml:"sans,omitempty"` }