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

匹配规则新增:ImplementationSpecific #323

Open
gzwxh opened this issue Aug 15, 2024 · 5 comments
Open

匹配规则新增:ImplementationSpecific #323

gzwxh opened this issue Aug 15, 2024 · 5 comments
Assignees

Comments

@gzwxh
Copy link

gzwxh commented Aug 15, 2024

参考:https://higress.io/docs/latest/user/annotation-use-case/#rewrite%E9%87%8D%E5%86%99path
进行配置 ,将请求example.com/v1/app在转发至后端服务之前,去掉Path前缀/v1
但是配置页面不支持选择类型是:ImplementationSpecific
通过yaml 文件配置是可以实现的该功能,但是再页面上不显示对应的路由信息。
通过页面配置选择正则,转发都后端无法实现上述功能

@CH3CHO
Copy link
Collaborator

CH3CHO commented Aug 21, 2024

能贴一下具体的 YAML 配置吗,我们看看有没有办法支持

@gzwxh
Copy link
Author

gzwxh commented Aug 29, 2024

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
higress.io/destination: gateway-hwtest.traval-delicacies.svc.cluster.local:21601
higress.io/rewrite-target: /$1
creationTimestamp: "2024-08-22T09:06:11Z"
generation: 1
labels:
higress.io/domain_nacos-base.onetravelgz.press: "true"
higress.io/resource-definer: higress
name: writeoff.onetravelgz.press-food-api
namespace: higress-system
resourceVersion: "70862044"
uid: 5a0dc47a-2c72-406a-8066-d129402a0d68
spec:
ingressClassName: higress
rules:

  • host: writeoff.xxxxxx.press
    http:
    paths:
    • backend:
      resource:
      apiGroup: networking.higress.io
      kind: McpBridge
      name: default
      path: /food/api/(.*)
      pathType: ImplementationSpecific
      status:
      loadBalancer: {}

@gzwxh
Copy link
Author

gzwxh commented Aug 29, 2024

后面我同事咨询了higress的相关人员反馈这样改的

@gzwxh
Copy link
Author

gzwxh commented Aug 29, 2024

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
higress.io/destination: gateway-hwtest.traval-delicacies.svc.cluster.local:21601
higress.io/ignore-path-case: "false"
higress.io/rewrite-target: /$1
higress.io/use-regex: "true"
creationTimestamp: "2024-04-30T02:38:17Z"
generation: 1
labels:
higress.io/domain_man.onetravelgz.prod: "true"
higress.io/resource-definer: higress
name: man.onetravelgz.com.cn-food-api
namespace: higress-system
resourceVersion: "8884375"
uid: a998b014-f417-4814-933b-6b2622fb3e62
spec:
ingressClassName: higress
rules:

  • host: man.xxxxx.com.cn
    http:
    paths:
    • backend:
      resource:
      apiGroup: networking.higress.io
      kind: McpBridge
      name: default
      path: /food/api/(.*)
      pathType: Prefix
      status:
      loadBalancer: {}

@CH3CHO CH3CHO self-assigned this Aug 30, 2024
@CH3CHO
Copy link
Collaborator

CH3CHO commented Aug 30, 2024

可以实现的,请看下图:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants