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

Aperta
#3,731 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
api, networking

Direzione di ricerca

Inizia individuando la specifica di VirtualService e il relativo schema di corrispondenza basato sugli header in questo repository API. Esamina come vengono rappresentate le corrispondenze esatte e tramite regex degli header, quindi determina come deve essere validato e tradotto un elenco in. Il lavoro è completo quando lo schema supporta i valori proposti e il comportamento del routing è coperto da test appropriati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Go
Stelle
523
Fork
623
Merge medio
5g 20h
PR unite (30g)
4

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di istio/api

Tutte le issue di istio/api

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.