Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports adding HTTP headers of the user request to upstream based on canary routing of header, cookie or query #41

Closed
lianglli opened this issue Aug 4, 2023 · 2 comments · Fixed by #70 or #71
Labels
enhancement New feature or request
Milestone

Comments

@lianglli
Copy link
Member

lianglli commented Aug 4, 2023

No description provided.

@lianglli lianglli added the enhancement New feature or request label Aug 4, 2023
@lianglli lianglli added this to the 1.0.1 milestone Aug 4, 2023
@lianglli
Copy link
Member Author

lianglli commented Aug 4, 2023

nginx.ingress.kubernetes.io/canary-request-add-header

@lianglli
Copy link
Member Author

lianglli commented Nov 1, 2023

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/canary: "true"
    nginx.ingress.kubernetes.io/canary-by-header: header-test2
    nginx.ingress.kubernetes.io/canary-mod-divisor: "100"
    nginx.ingress.kubernetes.io/canary-mod-relational-operator: ==
    nginx.ingress.kubernetes.io/canary-mod-remainder: "1"
    nginx.ingress.kubernetes.io/canary-request-add-header: test-result:B0-236-564-29117||test-ssl-cipher:$ssl_cipher
    nginx.ingress.kubernetes.io/canary-request-append-header: Test-UserData:test=B0-236-564-29117||test-ssl:$ssl_protocol
    nginx.ingress.kubernetes.io/canary-response-add-header: test-result:B0-236-564-29122||test-host:$host||test-method:$request_method
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  creationTimestamp: "2023-10-31T07:02:17Z"
  generation: 1
  name: tengine-ingress-hello-header-mod-with-actions-ing
  namespace: default
  resourceVersion: "28173436"
  uid: bfe4bc3b-d384-4718-8a0a-5f6c3e89ab68
spec:
  ingressClassName: opensource-ingress
  rules:
  - host: echo.w1.com
    http:
      paths:
      - backend:
          service:
            name: tengine-ingress-echo2-service
            port:
              number: 80
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - echo.w1.com
    secretName: https-server-1
status:
  loadBalancer:
    ingress:
    - {}
$ curl -i -k -H "header-test2: 101" -H "test-ssl: default" https://echo.w1.com
HTTP/2 200 
server: Tengine/3.1.0
date: Wed, 01 Nov 2023 11:08:38 GMT
content-type: text/plain; charset=utf-8
content-length: 7
test-result: B0-236-564-29122
test-host: echo.w1.com
strict-transport-security: max-age=0
ups-target-key: default-tengine-ingress-echo2-service-80
x-protocol: HTTP/2.0
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

echo ok

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment