Add support for "in" multiple values header match in virtualservice

Đang mở
#3,731 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go
Lĩnh vực
api, networking

Hướng nghiên cứu

Bắt đầu bằng cách xác định đặc tả VirtualService và schema so khớp dựa trên header của nó trong API repository này. Xem lại cách biểu diễn các so khớp header chính xác và bằng regex, sau đó xác định cách một danh sách in cần được xác thực và chuyển đổi. Hoàn tất có nghĩa là schema hỗ trợ các giá trị được đề xuất và hành vi định tuyến được bao phủ bởi các kiểm thử phù hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/networking area/user experience kind/docs kind/enhancement

Describe the feature request

Right now, the virtualService spec supports header based routing which is one of the fundamental features core to istio. A typical scenario would be to say, allow an ingress request if a particular header is in a list of allowed values.

One way to do this today is to have multiple header entries in the match list

match:
- headers:
    x-env:
      exact: prod
- headers:
    x-env:
      exact: stage
- headers:
    x-env:
      exact: dev

This could work for cases like env filtering, but if it's something like user, team or company filtering the list can get quite huge... increasing the CR size and degraded devX

or have a regex match with a list... This has clear limitations of performance, faulty regexes and the 1024 character limit preventing bigger lists

This issue proposes having a "in" semantic here which would simplify the CR, improve devX and potentially help with perf

headers:
  x-tenant:
    in:
    - foo
    - bar
    - baz

Describe alternatives you've considered
On the user end, there are two ways folks currently work around this, apart from the obvious regex hack...

  • yaml anchors reusing blocks, not ideal since these only work on repeated maps
  • having custom helm templates over the vs spec to iterate that way, solves dx with downstream maintainability setback

Affected product area (please put an X in all that apply)

[ ] Configuration Infrastructure
[x] Docs
[ ] Installation
[x] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[x] User Experience

Additional context

Ngôn ngữ chính
Go
Star
523
Fork
623
Merge trung bình
5 ngày 20 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của istio/api

Tất cả issue của istio/api

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.