Skip to content

Commit

Permalink
kubernetes: cherry-pick #97081
Browse files Browse the repository at this point in the history
  • Loading branch information
ymmt2005 committed Jan 28, 2021
1 parent b323710 commit c36b84a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
28 changes: 28 additions & 0 deletions kubernetes/97081.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From a655a2ab54d3e0bbfdb771d5ce7dfe3570724170 Mon Sep 17 00:00:00 2001
From: Lars Ekman <[email protected]>
Date: Sat, 5 Dec 2020 08:32:15 +0100
Subject: [PATCH] Ipvs: non-local access to externalTrafficPolicy:Local

Allow access to externalTrafficPolicy:Local services from PODs
not on a node where a server executes. Problem described in #93456
---
pkg/proxy/ipvs/proxier.go | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go
index 7d67008332c3c..3cc271a201e32 100644
--- a/pkg/proxy/ipvs/proxier.go
+++ b/pkg/proxy/ipvs/proxier.go
@@ -2046,6 +2046,12 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
newEndpoints.Insert(epInfo.String())
}

+ if len(newEndpoints) == 0 && onlyNodeLocalEndpoints {
+ for _, epInfo := range proxier.endpointsMap[svcPortName] {
+ newEndpoints.Insert(epInfo.String())
+ }
+ }
+
// Create new endpoints
for _, ep := range newEndpoints.List() {
ip, port, err := net.SplitHostPort(ep)
1 change: 1 addition & 0 deletions kubernetes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ WORKDIR /go/src/k8s.io/kubernetes
RUN patch -p1 --no-backup-if-mismatch < /tmp/92029.patch && \
patch -p1 --no-backup-if-mismatch < /tmp/93457.patch && \
patch -p1 --no-backup-if-mismatch < /tmp/89155.patch && \
patch -p1 --no-backup-if-mismatch < /tmp/97081.patch && \
make all WHAT="cmd/kube-apiserver cmd/kube-controller-manager cmd/kube-proxy cmd/kube-scheduler cmd/kubelet" GOLDFLAGS="-w -s"

# Stage2: setup runtime container
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.7.1
1.19.7.2

0 comments on commit c36b84a

Please sign in to comment.