Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
29566d0a
Unverified
Commit
29566d0a
authored
Mar 26, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74341 from paulsubrata55/kube_proxy_sctp_fix
Issue in kube-proxy when IPVS is enabled and SCTP traffic is sent.
parents
11d472ea
bf099d55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
proxier.go
pkg/proxy/ipvs/proxier.go
+22
-10
No files found.
pkg/proxy/ipvs/proxier.go
View file @
29566d0a
...
@@ -127,8 +127,8 @@ var ipsetInfo = []struct {
...
@@ -127,8 +127,8 @@ var ipsetInfo = []struct {
{
kubeNodePortLocalSetTCP
,
utilipset
.
BitmapPort
,
kubeNodePortLocalSetTCPComment
},
{
kubeNodePortLocalSetTCP
,
utilipset
.
BitmapPort
,
kubeNodePortLocalSetTCPComment
},
{
kubeNodePortSetUDP
,
utilipset
.
BitmapPort
,
kubeNodePortSetUDPComment
},
{
kubeNodePortSetUDP
,
utilipset
.
BitmapPort
,
kubeNodePortSetUDPComment
},
{
kubeNodePortLocalSetUDP
,
utilipset
.
BitmapPort
,
kubeNodePortLocalSetUDPComment
},
{
kubeNodePortLocalSetUDP
,
utilipset
.
BitmapPort
,
kubeNodePortLocalSetUDPComment
},
{
kubeNodePortSetSCTP
,
utilipset
.
Bitmap
Port
,
kubeNodePortSetSCTPComment
},
{
kubeNodePortSetSCTP
,
utilipset
.
HashIP
Port
,
kubeNodePortSetSCTPComment
},
{
kubeNodePortLocalSetSCTP
,
utilipset
.
Bitmap
Port
,
kubeNodePortLocalSetSCTPComment
},
{
kubeNodePortLocalSetSCTP
,
utilipset
.
HashIP
Port
,
kubeNodePortLocalSetSCTPComment
},
}
}
// ipsetWithIptablesChain is the ipsets list with iptables source chain and the chain jump to
// ipsetWithIptablesChain is the ipsets list with iptables source chain and the chain jump to
...
@@ -153,8 +153,8 @@ var ipsetWithIptablesChain = []struct {
...
@@ -153,8 +153,8 @@ var ipsetWithIptablesChain = []struct {
{
kubeNodePortSetTCP
,
string
(
KubeNodePortChain
),
string
(
KubeMarkMasqChain
),
"dst"
,
"tcp"
},
{
kubeNodePortSetTCP
,
string
(
KubeNodePortChain
),
string
(
KubeMarkMasqChain
),
"dst"
,
"tcp"
},
{
kubeNodePortLocalSetUDP
,
string
(
KubeNodePortChain
),
"RETURN"
,
"dst"
,
"udp"
},
{
kubeNodePortLocalSetUDP
,
string
(
KubeNodePortChain
),
"RETURN"
,
"dst"
,
"udp"
},
{
kubeNodePortSetUDP
,
string
(
KubeNodePortChain
),
string
(
KubeMarkMasqChain
),
"dst"
,
"udp"
},
{
kubeNodePortSetUDP
,
string
(
KubeNodePortChain
),
string
(
KubeMarkMasqChain
),
"dst"
,
"udp"
},
{
kubeNodePortSetSCTP
,
string
(
kubeServicesChain
),
string
(
KubeNodePortChain
),
"
dst"
,
"sctp"
},
{
kubeNodePortSetSCTP
,
string
(
KubeNodePortChain
),
string
(
KubeMarkMasqChain
),
"dst,
dst"
,
"sctp"
},
{
kubeNodePortLocalSetSCTP
,
string
(
KubeNodePortChain
),
"RETURN"
,
"dst"
,
"sctp"
},
{
kubeNodePortLocalSetSCTP
,
string
(
KubeNodePortChain
),
"RETURN"
,
"dst
,dst
"
,
"sctp"
},
}
}
// In IPVS proxy mode, the following flags need to be set
// In IPVS proxy mode, the following flags need to be set
...
@@ -1096,20 +1096,32 @@ func (proxier *Proxier) syncProxyRules() {
...
@@ -1096,20 +1096,32 @@ func (proxier *Proxier) syncProxyRules() {
// Nodeports need SNAT, unless they're local.
// Nodeports need SNAT, unless they're local.
// ipset call
// ipset call
entry
=
&
utilipset
.
Entry
{
// No need to provide ip info
Port
:
svcInfo
.
NodePort
,
Protocol
:
protocol
,
SetType
:
utilipset
.
BitmapPort
,
}
var
nodePortSet
*
IPSet
var
nodePortSet
*
IPSet
switch
protocol
{
switch
protocol
{
case
"tcp"
:
case
"tcp"
:
nodePortSet
=
proxier
.
ipsetList
[
kubeNodePortSetTCP
]
nodePortSet
=
proxier
.
ipsetList
[
kubeNodePortSetTCP
]
entry
=
&
utilipset
.
Entry
{
// No need to provide ip info
Port
:
svcInfo
.
NodePort
,
Protocol
:
protocol
,
SetType
:
utilipset
.
BitmapPort
,
}
case
"udp"
:
case
"udp"
:
nodePortSet
=
proxier
.
ipsetList
[
kubeNodePortSetUDP
]
nodePortSet
=
proxier
.
ipsetList
[
kubeNodePortSetUDP
]
entry
=
&
utilipset
.
Entry
{
// No need to provide ip info
Port
:
svcInfo
.
NodePort
,
Protocol
:
protocol
,
SetType
:
utilipset
.
BitmapPort
,
}
case
"sctp"
:
case
"sctp"
:
nodePortSet
=
proxier
.
ipsetList
[
kubeNodePortSetSCTP
]
nodePortSet
=
proxier
.
ipsetList
[
kubeNodePortSetSCTP
]
entry
=
&
utilipset
.
Entry
{
IP
:
proxier
.
nodeIP
.
String
(),
Port
:
svcInfo
.
NodePort
,
Protocol
:
protocol
,
SetType
:
utilipset
.
HashIPPort
,
}
default
:
default
:
// It should never hit
// It should never hit
klog
.
Errorf
(
"Unsupported protocol type: %s"
,
protocol
)
klog
.
Errorf
(
"Unsupported protocol type: %s"
,
protocol
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment