From c36b84a8091e9f494f5ec860c16df7975fed2aca Mon Sep 17 00:00:00 2001 From: ymmt Date: Thu, 28 Jan 2021 01:41:51 +0000 Subject: [PATCH] kubernetes: cherry-pick #97081 https://github.com/kubernetes/kubernetes/pull/97081 --- kubernetes/97081.patch | 28 ++++++++++++++++++++++++++++ kubernetes/Dockerfile | 1 + kubernetes/TAG | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 kubernetes/97081.patch diff --git a/kubernetes/97081.patch b/kubernetes/97081.patch new file mode 100644 index 000000000..91f092a65 --- /dev/null +++ b/kubernetes/97081.patch @@ -0,0 +1,28 @@ +From a655a2ab54d3e0bbfdb771d5ce7dfe3570724170 Mon Sep 17 00:00:00 2001 +From: Lars Ekman +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) diff --git a/kubernetes/Dockerfile b/kubernetes/Dockerfile index 3f35bbe02..8b76201ab 100644 --- a/kubernetes/Dockerfile +++ b/kubernetes/Dockerfile @@ -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 diff --git a/kubernetes/TAG b/kubernetes/TAG index 382b01ca1..5d27128f9 100644 --- a/kubernetes/TAG +++ b/kubernetes/TAG @@ -1 +1 @@ -1.19.7.1 +1.19.7.2