envoyproxy / envoyproxy/gateway

EnvoyProxy patch type JSONMerge undocumented / not very useful

Open
#3,840 13 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

*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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.