diff --git a/controllers/configmap.go b/controllers/configmap.go index 9725d64..9e975b6 100644 --- a/controllers/configmap.go +++ b/controllers/configmap.go @@ -110,6 +110,10 @@ func envoyConfig(es *egressv1.ExternalService) (string, error) { } for _, port := range es.Spec.Ports { + var dnsRefreshRate *duration.Duration + if es.Spec.EnvoyDnsRefreshRateS != 0 { + dnsRefreshRate = &durationpb.Duration{Seconds: spec.EnvoyDnsRefreshRateS} + } var clusters []*envoyv3.Cluster protocol := protocolToEnvoy(port.Protocol) name := fmt.Sprintf("%s_%s_%s", es.Name, envoycorev3.SocketAddress_Protocol_name[int32(protocol)], strconv.Itoa(int(port.Port))) @@ -131,6 +135,9 @@ func envoyConfig(es *egressv1.ExternalService) (string, error) { KeepaliveInterval: &wrapperspb.UInt32Value{Value: 5}, }, }, + + DnsRefreshRate: dnsRefreshRate, + RespectDnsTtl: es.Spec.EnvoyRespectDnsTTL, LoadAssignment: &envoyendpoint.ClusterLoadAssignment{ ClusterName: name, Endpoints: []*envoyendpoint.LocalityLbEndpoints{