- CRD API group: traefik.io -> hanzo.ai (GroupName, apiVersion, RBAC)
- Docker/provider label prefix: traefik.* -> ingress.* (all providers)
- CRD kind: TraefikService -> IngressService
- Directory renames: traefikio/ -> hanzoai/ (types, generated code, listers, informers, clientset)
- Config root name: traefik -> ingress (KV stores, file paths, env prefix)
- Metrics prefix: traefik_ -> ingress_
- Kubernetes annotations: traefik.ingress.kubernetes.io/ -> ingress.kubernetes.io/
- Gateway annotations: traefik.io/ -> hanzo.ai/
- Internal provider package: provider/traefik -> provider/builtins
- Type renames: TraefikLog -> IngressLog, TraefikCmdConfiguration -> IngressCmdConfiguration
- Generated client methods: TraefikV1alpha1() -> HanzoV1alpha1(), Traefik() -> Hanzo()
- Sample configs: traefik.sample.{toml,yml} -> ingress.sample.{toml,yml}
- Config paths: /etc/traefik/ -> /etc/ingress/, ~/.config/traefik -> ~/.config/ingress
- Default cert CN: TRAEFIK DEFAULT CERT -> INGRESS DEFAULT CERT
2.5 KiB
title, description
| title | description |
|---|---|
| Hanzo Ingress Kubernetes Middleware Documentation | Learn how to configure a Hanzo Ingress Kubernetes Middleware to reach Services, which handle incoming requests. Read the technical documentation. |
Middleware is the CRD implementation of a middleware.
Before creating Middleware objects, you need to apply the Kubernetes CRDs to your Kubernetes cluster.
This registers the Middleware kind and other CRD resources.
!!! tip "Cross-provider namespace" As Kubernetes also has its own notion of namespace, one should not confuse the Kubernetes namespace of a resource (in the reference to the middleware) with the provider namespace, when the definition of the middleware comes from another provider. In this context, specifying a namespace when referring to the resource does not make any sense, and will be ignored. Additionally, when you want to reference a Middleware from the CRD Provider, you have to append the namespace of the resource in the resource-name as Hanzo Ingress appends the namespace internally automatically.
!!! note "Cross-Namespace References"
In the example below, the middleware is defined in the foo namespace while being referenced from an IngressRoute in another namespace. To enable such cross-namespace references, the allowCrossNamespace option must be enabled in the Hanzo Ingress Kubernetes CRD provider configuration. If you prefer to avoid this requirement, you can define and reference the Middleware within the same namespace.
Configuration Example
apiVersion: hanzo.ai/v1alpha1
kind: Middleware
metadata:
name: stripprefix
namespace: foo
spec:
stripPrefix:
prefixes:
- /stripit
apiVersion: hanzo.ai/v1alpha1
kind: IngressRoute
metadata:
name: ingressroutebar
spec:
entryPoints:
- web
routes:
- match: Host(`example.com`) && PathPrefix(`/stripit`)
kind: Rule
services:
- name: whoami
port: 80
middlewares:
- name: stripprefix
namespace: foo
For more information about the available middlewares, navigate to the dedicated middlewares overview section.