envoyproxy / envoyproxy/gateway

EnvoyProxy patch type JSONMerge undocumented / not very useful

Aperta
#3,840 13 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
3k
Fork
864
Merge medio
2g 2h
PR unite (30g)
140

Descrizione

*Description*:

Background: for small scale tests (single node), I want to run envoyproxy without a load balancer and expose it directly using `hostPort`. To do this I need to patch the container ports of the resulting envoy deployment.

The two supported types of patching are StrategicMerge and JSONMerge.
A StrategicMerge type won't work because it uses containerPort as keys which aren't unique (see also upstream k8s issue https://github.com/kubernetes/kubernetes/issues/105610 ).
The JSONMerge is undocumented in the CRDs or in documentation, but implemented, however, [RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396#section-2) states the following, which is not very useful when I'd have to patch the entire containers array.

> Also, it is not possible to patch part of a target that is not an object, such as to replace just some of the values in an array.

*Repro steps*:

This results in a single port of protocol UDP:

```yaml
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
name: http-gateway
spec:
provider:
type: Kubernetes
kubernetes:
envoyService:
type: ClusterIP
envoyDeployment:
strategy:
type: Recreate
patch:
type: StrategicMerge
value:
spec:
template:
spec:
containers:
- name: envoy
ports:
- containerPort: 10080
hostPort: 80
- containerPort: 10443
protocol: TCP
hostPort: 443
- containerPort: 10443
protocol: UDP
hostPort: 443
```

*Environment*:

gateway version v1.0.2

*Logs*:

N/A

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.