-
I have mergeGateways set on my EnvoyProxy using this config: ---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: GatewayClass
metadata:
name: eg
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parametersRef:
group: gateway.envoyproxy.io
kind: EnvoyProxy
name: enable-merge-gateways
namespace: envoy-gateway-system
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
name: enable-merge-gateways
namespace: envoy-gateway-system
spec:
mergeGateways: true My envoy gateway is behind a load balancer that does not do TLS termination for me, so I have set up PROXY protocol so that I know the upstream IP address of the TLS connections. For one of my gateways this is setup correctly with this config: ---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: eg
annotations:
cert-manager.io/cluster-issuer: letsencrypt
spec:
gatewayClassName: eg
listeners:
- name: http
protocol: HTTP
port: 80
- name: https
protocol: HTTPS
hostname: ...
port: 443
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: eg-https
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
shared-gateway-access: "true"
- name: symfexit-https
protocol: HTTPS
hostname: ...
port: 443
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: eg-https
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
shared-gateway-access: "true"
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: client-traffic-config
namespace: default
spec:
enableProxyProtocol: true
targetRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: eg Now, in a different namespace, I have setup another gateway with the same gateway class and so they should be merged into a single gateway configuration. I gave this new gateway a ClientTrafficPolicy like the original one: ---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: {{ include "wp-instance.fullname" . }}
namespace: ...
spec:
enableProxyProtocol: true
targetRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: {{ include "wp-instance.fullname" . }} However, this traffic policy gets the following condition applied and the listener does not work. This is the condition: status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: Gateway
name: ...
namespace: ...
conditions:
- lastTransitionTime: '2024-07-29T05:33:42Z'
message: >-
ClientTrafficPolicy is being applied to multiple http (non https)
listeners (default/eg/http) on the same port, which is not allowed.
observedGeneration: 1
reason: Invalid
status: 'False'
type: Accepted
controllerName: gateway.envoyproxy.io/gatewayclass-controller And this is the log of the gateway:
It seems like the log just confirms that PROXY protocol is not enabled, because it says it cannot parse the request ( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
its not possible to merge some clientTrafficPolicy features across Gateways where the listeners are non tls / |
Beta Was this translation helpful? Give feedback.
can you try to specify
*
in the listener hostname section and see if it resolves the issue, you can later limit the list