tomMoulard / htransformation

A Traefik plugin to change on the fly header's value of a request
MIT License
77 stars 13 forks source link

kubernetes example #56

Closed isshwar closed 7 months ago

isshwar commented 8 months ago

Hi,

If someone had already worked on it, how to enable the plugin and then write the rule when deploying traefik on kubernetes.

Thanks in advance

tomMoulard commented 7 months ago

Hi @isshwar,

Thanks for your interest in this Traefik Plugin!

As per this>install this Plugin:

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
    name: my-htransformation
    namespace: my-namespace
spec:
    plugin:
        htransformation:
            Rules:
                - Header: X-Traefik-*
                  Name: Header transformation
                  Type: Rename
                  Value: X-custom
                - Header: NewHeader
                  Name: Header addition
                  Type: Set
                  Value: "True"
                - Header: Cache-Control
                  Name: Header deletion
                  Type: Del
                - Header: Accept-Language
                  Name: Header join
                  Sep: ', '
                  Type: Join
                  Values:
                    - Foo
                    - Bar