You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Quinlan-Z (via GitHub)" <gi...@apache.org> on 2023/04/11 06:48:59 UTC
[GitHub] [apisix-ingress-controller] Quinlan-Z opened a new issue, #1781: request help: How to configure adding headers based on separated traffic?
Quinlan-Z opened a new issue, #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781
### Issue description
How to configure adding headers based on separated traffic?
How to implement the following configuration in apisix ingress?
```
split_clients "$remote_addr" $helloworld_backend {
10% helloworld_grey_server
* helloworld_official_server
}
upstream helloworld_official_server{
server helloworld_official-svc.applet.svc.cluster.local:11001 max_fails=3 fail_timeout=10s weight=100;
server helloworld_official-svc.applet:11001 max_fails=3 fail_timeout=10s weight=100;
}
upstream helloworld_grey_server{
server helloworld-grey-svc.applet.svc.cluster.local:12001 max_fails=3 fail_timeout=10s weight=100;
server helloworld-grey-svc.applet:12001 max_fails=3 fail_timeout=10s weight=100;
}
location /helloworld/v1/ {
if ($helloworld_backend ~ "helloworld_grey_server") {
proxy_set_header grey "yes";
}
proxy_pass http://$helloworld_backend/;
}
```
### Environment
- your apisix-ingress-controller version (output of apisix-ingress-controller version --long): 1.6.0
- your Kubernetes cluster version (output of kubectl version): 1.22.0
- if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] AlinsRan commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1504494242
I think you can use the traffic-split plugin.
https://github.com/apache/apisix-ingress-controller/blob/master/docs/en/latest/plugins/traffic-split.md
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] github-actions[bot] closed issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #1781: request help: How to configure adding headers based on separated traffic?
URL: https://github.com/apache/apisix-ingress-controller/issues/1781
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] Quinlan-Z commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "Quinlan-Z (via GitHub)" <gi...@apache.org>.
Quinlan-Z commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1502802186
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: httpbin-route
spec:
http:
- name: rule4
match:
hosts:
- nginx.testapisix.com
paths:
- /*
backends:
- serviceName: nginx-srv
servicePort: 80
weight: 10
proxy_set_header: (need to add a header here, how to achieve it?)
- serviceName: nginx-srv1
servicePort: 80
weight: 90
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] AlinsRan commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1504755545
You mean this, right?
```
client --> /api --> header(version:v1) --> service1
--> header(version:v2) --> service2
```
If that's the case.
Currently, setting request headers for specific services on routing is not supported
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] Quinlan-Z commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "Quinlan-Z (via GitHub)" <gi...@apache.org>.
Quinlan-Z commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1502804607
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: httpbin-route
spec:
http:
- name: rule4
match:
hosts:
- nginx2.qikqiak.com
paths:
- /*
backends:
- serviceName: nginx-srv
servicePort: 80
weight: 10
proxy_set_header: (need to add a header here, how to achieve it?)
- serviceName: nginx-srv1
servicePort: 80
weight: 90
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] github-actions[bot] commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1631718410
This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] Quinlan-Z commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "Quinlan-Z (via GitHub)" <gi...@apache.org>.
Quinlan-Z commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1504721184
> I think you can use the traffic-split plugin. https://github.com/apache/apisix-ingress-controller/blob/master/docs/en/latest/plugins/traffic-split.md
Thank you for your reply
But I hope this header is added on the controller instead of being passed through the client
weight:50 proxy_set_header(grayheader: grayvalue)
-------------> UpstreamA --------------------------------------------
Client --- --------> Backend
weight:50
-------------> UpstreamB ---------------------------------------------
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] Quinlan-Z commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "Quinlan-Z (via GitHub)" <gi...@apache.org>.
Quinlan-Z commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1504773897
> 你是说这个,对吧?
>
> ```
> client ----> /api --- header(version:v1) ---> service1
> --- header(version:v2) ---> service2
> ```
>
> 如果是这样的话。 目前不支持在路由上为特定服务设置请求头
OK thanks for your reply
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] github-actions[bot] commented on issue #1781: request help: How to configure adding headers based on separated traffic?
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1781:
URL: https://github.com/apache/apisix-ingress-controller/issues/1781#issuecomment-1675593935
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org