Closed imroc closed 7 months ago
cc @Xunzhuo
You should set dnsPolicy: ClusterFirstWithHostNet
too, the xds_clusters of envoyproxy used service name for looking up control plane:
"cluster": {
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
"connectTimeout": "10s",
"loadAssignment": {
"clusterName": "xds_cluster",
"endpoints": [
{
"lbEndpoints": [
{
"endpoint": {
"address": {
"socketAddress": {
"address": "envoy-gateway",
"portValue": 18000
}
}
},
"loadBalancingWeight": 1
}
],
"loadBalancingWeight": 1
}
]
When you are using hostNetwork
, we need to set dnsPolicy to ClusterFirstWithHostNet
too.
Refer to: https://github.com/envoyproxy/gateway/pull/2374#issue-2059138573
Since we have supported deployment/svc mergepatch, I think we need to remove hostnetwork support on Envoyproxy API or have a more complete implementation for it.
Any thoughts on it @arkodg ?
Yes let's remove it
Let me handle it before GA.
Thanks, change to mergepatch solves this problem:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
name: eg2
namespace: envoy-gateway-system
spec:
shutdown:
drainTimeout: "1s"
minDrainDuration: "1s"
provider:
type: Kubernetes
kubernetes:
envoyService:
type: ClusterIP
envoyDeployment:
patch:
type: StrategicMerge
value:
spec:
template:
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Description:
Envoy's port is not listening if gw pod is set to use HostNetwork, and also there are some error log in envoy pod.
Repro steps:
Use
EnvoyProxy
CR to declare gw pod using HostNetwork, like this:And the gw pod yaml:
The envoy should listen 8899 as it is declared in Gateway CR (envoy listens the same port if Gateway's port > 1024), but envoy did not.
Environment: envoygateway version: v1.0.0-rc.1 Tested both on single node k3s and the cloud hosted Tencent Kubenretes Engine, got the same result.
Logs: Logs in envoy container: