Support externalTrafficPolicy on the client Service
Adds BindCluster.spec.service.externalTrafficPolicy so DNS LoadBalancers can preserve client source IPs (Local), which the source-IP ACLs on the authoritative/resolver need to actually restrict external clients (Cluster SNATs everything to node IPs). - api: ClusterServiceSpec.externalTrafficPolicy (enum Cluster;Local) - set it on the client Service for LoadBalancer/NodePort types - regenerate CRDs + install.yaml
This commit is contained in:
@@ -273,6 +273,10 @@ func (r *BindClusterReconciler) reconcileServices(ctx context.Context, c *bindv1
|
||||
LoadBalancerIP: c.Spec.Service.LoadBalancerIP,
|
||||
},
|
||||
}
|
||||
// externalTrafficPolicy is only valid for LoadBalancer/NodePort Services.
|
||||
if svcType == corev1.ServiceTypeLoadBalancer || svcType == corev1.ServiceTypeNodePort {
|
||||
client.Spec.ExternalTrafficPolicy = c.Spec.Service.ExternalTrafficPolicy
|
||||
}
|
||||
return r.upsertService(ctx, c, client)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user