-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
Make kube-proxy iptables SNAT masquerade mark configurable #20496
Merged
k8s-github-robot
merged 4 commits into
kubernetes:master
from
matthewdupre:masquerade-config
Feb 8, 2016
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
41ba8ce
Dont log errors on proxy leftover cleanup
thockin 107c5f7
Put all masquerade mark logic into new chains
thockin 1e7db4a
Implement proper cleanup in iptables proxy
thockin 9925cdd
Change iptables fwmark to use single configurable bit instead of whol…
matthewdupre File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,18 +190,23 @@ func NewProxyServerDefault(config *options.ProxyServerConfig) (*ProxyServer, err | |
|
||
proxyMode := getProxyMode(string(config.Mode), client.Nodes(), hostname, iptInterface) | ||
if proxyMode == proxyModeIptables { | ||
glog.V(2).Info("Using iptables Proxier.") | ||
proxierIptables, err := iptables.NewProxier(iptInterface, execer, config.IPTablesSyncPeriod.Duration, config.MasqueradeAll) | ||
glog.V(0).Info("Using iptables Proxier.") | ||
if config.IPTablesMasqueradeBit == nil { | ||
// IPTablesMasqueradeBit must be specified or defaulted. | ||
return nil, fmt.Errorf("Unable to read IPTablesMasqueradeBit from config") | ||
} | ||
|
||
proxierIptables, err := iptables.NewProxier(iptInterface, execer, config.IPTablesSyncPeriod.Duration, config.MasqueradeAll, *config.IPTablesMasqueradeBit) | ||
if err != nil { | ||
glog.Fatalf("Unable to create proxier: %v", err) | ||
} | ||
proxier = proxierIptables | ||
endpointsHandler = proxierIptables | ||
// No turning back. Remove artifacts that might still exist from the userspace Proxier. | ||
glog.V(2).Info("Tearing down userspace rules. Errors here are acceptable.") | ||
glog.V(0).Info("Tearing down userspace rules.") | ||
userspace.CleanupLeftovers(iptInterface) | ||
} else { | ||
glog.V(2).Info("Using userspace Proxier.") | ||
glog.V(0).Info("Using userspace Proxier.") | ||
// This is a proxy.LoadBalancer which NewProxier needs but has methods we don't need for | ||
// our config.EndpointsConfigHandler. | ||
loadBalancer := userspace.NewLoadBalancerRR() | ||
|
@@ -221,7 +226,7 @@ func NewProxyServerDefault(config *options.ProxyServerConfig) (*ProxyServer, err | |
} | ||
proxier = proxierUserspace | ||
// Remove artifacts from the pure-iptables Proxier. | ||
glog.V(2).Info("Tearing down pure-iptables proxy rules. Errors here are acceptable.") | ||
glog.V(0).Info("Tearing down pure-iptables proxy rules.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should stay V(2) I think |
||
iptables.CleanupLeftovers(iptInterface) | ||
} | ||
iptInterface.AddReloadFunc(proxier.Sync) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay V(2)