Skip to content

Commit

Permalink
Support ProxyTerminatingEndpoints in AntreaProxy
Browse files Browse the repository at this point in the history
Signed-off-by: Hongliang Liu <[email protected]>
  • Loading branch information
hongliangl committed Feb 27, 2023
1 parent 361b805 commit 8c2d9a3
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions pkg/agent/proxy/proxier.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,7 @@ func (p *proxier) installServices() {
} else {
// If the type of the Service is ClusterIP, install a group according to internalTrafficPolicy.
groupID := p.groupCounter.AllocateIfNotExist(svcPortName, internalPolicyLocal)
var endpoints []k8sproxy.Endpoint
if internalPolicyLocal {
endpoints = localEndpoints
} else {
endpoints = clusterEndpoints
}
if err = p.ofClient.InstallServiceGroup(groupID, affinityTimeout != 0, endpoints); err != nil {
if err = p.ofClient.InstallServiceGroup(groupID, affinityTimeout != 0, allReachableEndpoints); err != nil {
klog.ErrorS(err, "Error when installing Group of Endpoints for Service", "Service", svcPortName)
continue
}
Expand All @@ -486,15 +480,11 @@ func (p *proxier) installServices() {
// uninstall the group which has all Endpoints; if both internalTrafficPolicy and externalTrafficPolicy are
// Cluster, install the group which has all Endpoints and unconditionally uninstall the group which has
// only local Endpoints. Note that, if a group doesn't exist on OVS, then the return value will be nil.
bothPolicyLocal := internalPolicyLocal && externalPolicyLocal
var endpoints []k8sproxy.Endpoint
if bothPolicyLocal {
endpoints = localEndpoints
} else {
endpoints = clusterEndpoints
}
// Note that, since internalTrafficPolicy and externalTrafficPolicy are the same, bothPolicyLocal just equals
// internalPolicyLocal.
bothPolicyLocal := internalPolicyLocal
groupID := p.groupCounter.AllocateIfNotExist(svcPortName, bothPolicyLocal)
if err = p.ofClient.InstallServiceGroup(groupID, affinityTimeout != 0, endpoints); err != nil {
if err = p.ofClient.InstallServiceGroup(groupID, affinityTimeout != 0, allReachableEndpoints); err != nil {
klog.ErrorS(err, "Error when installing Group of local Endpoints for Service", "Service", svcPortName)
continue
}
Expand Down Expand Up @@ -839,6 +829,9 @@ func (p *proxier) Run(stopCh <-chan struct{}) {
go p.serviceConfig.Run(stopCh)
if p.endpointSliceEnabled {
go p.endpointSliceConfig.Run(stopCh)
if p.topologyAwareHintsEnabled {
go p.nodeConfig.Run(stopCh)
}
} else {
go p.endpointsConfig.Run(stopCh)
}
Expand Down

0 comments on commit 8c2d9a3

Please sign in to comment.