Skip to content

Commit 09d7852

Browse files
authored
Merge pull request kubernetes#87792 from ksubrmnn/nodeip
Allow access to default Kubernetes Service from inside Windows Pod (Overlay)
2 parents 937008e + 378fcc8 commit 09d7852

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/proxy/winkernel/proxier.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ func (proxier *Proxier) syncProxyRules() {
10911091
klog.V(4).Infof("====Applying Policy for %s====", svcName)
10921092
// Create Remote endpoints for every endpoint, corresponding to the service
10931093
containsPublicIP := false
1094+
containsNodeIP := false
10941095

10951096
for _, ep := range proxier.endpointsMap[svcName] {
10961097
var newHnsEndpoint *endpointsInfo
@@ -1141,13 +1142,15 @@ func (proxier *Proxier) syncProxyRules() {
11411142
}
11421143
if ep.ip == rs.providerAddress {
11431144
providerAddress = rs.providerAddress
1145+
containsNodeIP = true
11441146
}
11451147
}
11461148
if len(providerAddress) == 0 {
1147-
klog.Errorf("Could not find provider address for %s", ep.ip)
1149+
klog.Infof("Could not find provider address for %s. Assuming it is a public IP", ep.ip)
11481150
providerAddress = proxier.nodeIP.String()
11491151
containsPublicIP = true
11501152
}
1153+
11511154
hnsEndpoint := &endpointsInfo{
11521155
ip: ep.ip,
11531156
isLocal: false,
@@ -1201,7 +1204,7 @@ func (proxier *Proxier) syncProxyRules() {
12011204
klog.V(4).Infof("Trying to Apply Policies for service %s", spew.Sdump(svcInfo))
12021205
var hnsLoadBalancer *loadBalancerInfo
12031206
var sourceVip = proxier.sourceVip
1204-
if containsPublicIP {
1207+
if containsPublicIP || containsNodeIP {
12051208
sourceVip = proxier.nodeIP.String()
12061209
}
12071210
hnsLoadBalancer, err := hns.getLoadBalancer(

0 commit comments

Comments
 (0)