Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes: cherry-pick #97081 #505

Merged
merged 1 commit into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
3 changes: 2 additions & 1 deletion kubernetes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ RUN mkdir -p /go/src/k8s.io/ && \
tar zxf - -C /go/src/k8s.io/ && \
mv /go/src/k8s.io/kubernetes-${K8S_VERSION} /go/src/k8s.io/kubernetes

COPY 92029.patch 93457.patch 89155.patch /tmp/
COPY 92029.patch 93457.patch 89155.patch 97081.patch /tmp/

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