nodeRef*api.ObjectReference// Reference to this node.
nodeRef*api.ObjectReference// Reference to this node.
MasqueradeAllbool
MasqueradeAllbool
CleanupAndExitbool
}
}
// NewProxyServer creates a new ProxyServer object with default parameters
// NewProxyServer creates a new ProxyServer object with default parameters
...
@@ -90,10 +92,28 @@ func (s *ProxyServer) AddFlags(fs *pflag.FlagSet) {
...
@@ -90,10 +92,28 @@ func (s *ProxyServer) AddFlags(fs *pflag.FlagSet) {
fs.BoolVar(&s.ForceUserspaceProxy,"legacy-userspace-proxy",true,"Use the legacy userspace proxy (instead of the pure iptables proxy).")
fs.BoolVar(&s.ForceUserspaceProxy,"legacy-userspace-proxy",true,"Use the legacy userspace proxy (instead of the pure iptables proxy).")
fs.DurationVar(&s.SyncPeriod,"iptables-sync-period",5*time.Second,"How often iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.")
fs.DurationVar(&s.SyncPeriod,"iptables-sync-period",5*time.Second,"How often iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.")
fs.BoolVar(&s.MasqueradeAll,"masquerade-all",false,"If using the pure iptables proxy, SNAT everything")
fs.BoolVar(&s.MasqueradeAll,"masquerade-all",false,"If using the pure iptables proxy, SNAT everything")
fs.BoolVar(&s.CleanupAndExit,"cleanup-iptables",false,"If true cleanup iptables rules and exit.")
}
}
// Run runs the specified ProxyServer. This should never exit.
// Run runs the specified ProxyServer. This should never exit (unless CleanupAndExit is set).