Commit 535634f5 authored by Erik Stidham's avatar Erik Stidham

Review updates

parent 7c108f59
...@@ -1604,14 +1604,22 @@ func (proxier *Proxier) syncProxyRules() { ...@@ -1604,14 +1604,22 @@ func (proxier *Proxier) syncProxyRules() {
"-m", "addrtype", "--dst-type", "LOCAL", "-m", "addrtype", "--dst-type", "LOCAL",
"-j", string(kubeNodePortsChain)) "-j", string(kubeNodePortsChain))
// If the masqueradeMark has been added then we want to forward that same
// traffic, this allows NodePort traffic to be forwarded even if the default
// FORWARD policy is not accept.
writeLine(proxier.filterRules,
"-A", string(kubeForwardChain),
"-m", "comment", "--comment", `"kubernetes forwarding rules"`,
"-m", "mark", "--mark", proxier.masqueradeMark,
"-j", "ACCEPT",
)
// The following rules can only be set if clusterCIDR has been defined.
if len(proxier.clusterCIDR) != 0 { if len(proxier.clusterCIDR) != 0 {
glog.Error("Should be adding the rules now") // The following two rules ensure the traffic after the initial packet
writeLine(proxier.filterRules, // accepted by the "kubernetes forwarding rules" rule above will be
"-A", string(kubeForwardChain), // accepted, to be as specific as possible the traffic must be sourced
"-m", "comment", "--comment", `"kubernetes forwarding rules"`, // or destined to the clusterCIDR (to/from a pod).
"-m", "mark", "--mark", proxier.masqueradeMark,
"-j", "ACCEPT",
)
writeLine(proxier.filterRules, writeLine(proxier.filterRules,
"-A", string(kubeForwardChain), "-A", string(kubeForwardChain),
"-s", proxier.clusterCIDR, "-s", proxier.clusterCIDR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment