// hostnameOverride, if set from the command line flag, takes precedence over the `HostnameOverride` value from the config file
hostnameOverridestring
}
// AddFlags adds flags to fs and binds them to options.
func(o*Options)AddFlags(fs*pflag.FlagSet){
o.addOSFlags(fs)
fs.StringVar(&o.ConfigFile,"config",o.ConfigFile,"The path to the configuration file.")
fs.StringVar(&o.WriteConfigTo,"write-config-to",o.WriteConfigTo,"If set, write the default configuration values to this file and exit.")
fs.BoolVar(&o.CleanupAndExit,"cleanup-iptables",o.CleanupAndExit,"If true cleanup iptables and ipvs rules and exit.")
fs.MarkDeprecated("cleanup-iptables","This flag is replaced by --cleanup.")
fs.BoolVar(&o.CleanupAndExit,"cleanup",o.CleanupAndExit,"If true cleanup iptables and ipvs rules and exit.")
fs.BoolVar(&o.CleanupIPVS,"cleanup-ipvs",o.CleanupIPVS,"If true make kube-proxy cleanup ipvs rules before running. Default is true")
// All flags below here are deprecated and will eventually be removed.
fs.Var(utilflag.IPVar{Val:&o.config.BindAddress},"bind-address","The IP address for the proxy server to serve on (set to `0.0.0.0` for all IPv4 interfaces and `::` for all IPv6 interfaces)")
fs.StringVar(&o.master,"master",o.master,"The address of the Kubernetes API server (overrides any value in kubeconfig)")
fs.Int32Var(&o.healthzPort,"healthz-port",o.healthzPort,"The port to bind the health check server. Use 0 to disable.")
fs.Var(utilflag.IPVar{Val:&o.config.HealthzBindAddress},"healthz-bind-address","The IP address for the health check server to serve on (set to `0.0.0.0` for all IPv4 interfaces and `::` for all IPv6 interfaces)")
fs.Int32Var(&o.metricsPort,"metrics-port",o.metricsPort,"The port to bind the metrics server. Use 0 to disable.")
fs.Var(utilflag.IPVar{Val:&o.config.MetricsBindAddress},"metrics-bind-address","The IP address for the metrics server to serve on (set to `0.0.0.0` for all IPv4 interfaces and `::` for all IPv6 interfaces)")
fs.Int32Var(o.config.OOMScoreAdj,"oom-score-adj",utilpointer.Int32PtrDerefOr(o.config.OOMScoreAdj,int32(qos.KubeProxyOOMScoreAdj)),"The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]")
fs.StringVar(&o.config.ResourceContainer,"resource-container",o.config.ResourceContainer,"Absolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy).")
fs.MarkDeprecated("resource-container","This feature will be removed in a later release.")
fs.StringVar(&o.config.ClientConnection.Kubeconfig,"kubeconfig",o.config.ClientConnection.Kubeconfig,"Path to kubeconfig file with authorization information (the master location is set by the master flag).")
fs.Var(utilflag.PortRangeVar{Val:&o.config.PortRange},"proxy-port-range","Range of host ports (beginPort-endPort, single port or beginPort+offset, inclusive) that may be consumed in order to proxy service traffic. If (unspecified, 0, or 0-0) then ports will be randomly chosen.")
fs.StringVar(&o.hostnameOverride,"hostname-override",o.hostnameOverride,"If non-empty, will use this string as identification instead of the actual hostname.")
fs.Var(&o.config.Mode,"proxy-mode","Which proxy mode to use: 'userspace' (older) or 'iptables' (faster) or 'ipvs' (experimental). If blank, use the best-available proxy (currently iptables). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.")
fs.Int32Var(o.config.IPTables.MasqueradeBit,"iptables-masquerade-bit",utilpointer.Int32PtrDerefOr(o.config.IPTables.MasqueradeBit,14),"If using the pure iptables proxy, the bit of the fwmark space to mark packets requiring SNAT with. Must be within the range [0, 31].")
fs.DurationVar(&o.config.IPTables.SyncPeriod.Duration,"iptables-sync-period",o.config.IPTables.SyncPeriod.Duration,"The maximum interval of how often iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.")
fs.DurationVar(&o.config.IPTables.MinSyncPeriod.Duration,"iptables-min-sync-period",o.config.IPTables.MinSyncPeriod.Duration,"The minimum interval of how often the iptables rules can be refreshed as endpoints and services change (e.g. '5s', '1m', '2h22m').")
fs.DurationVar(&o.config.IPVS.SyncPeriod.Duration,"ipvs-sync-period",o.config.IPVS.SyncPeriod.Duration,"The maximum interval of how often ipvs rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.")
fs.DurationVar(&o.config.IPVS.MinSyncPeriod.Duration,"ipvs-min-sync-period",o.config.IPVS.MinSyncPeriod.Duration,"The minimum interval of how often the ipvs rules can be refreshed as endpoints and services change (e.g. '5s', '1m', '2h22m').")
fs.StringSliceVar(&o.config.IPVS.ExcludeCIDRs,"ipvs-exclude-cidrs",o.config.IPVS.ExcludeCIDRs,"A comma-separated list of CIDR's which the ipvs proxier should not touch when cleaning up IPVS rules.")
fs.DurationVar(&o.config.ConfigSyncPeriod.Duration,"config-sync-period",o.config.ConfigSyncPeriod.Duration,"How often configuration from the apiserver is refreshed. Must be greater than 0.")
fs.BoolVar(&o.config.IPTables.MasqueradeAll,"masquerade-all",o.config.IPTables.MasqueradeAll,"If using the pure iptables proxy, SNAT all traffic sent via Service cluster IPs (this not commonly needed)")
fs.StringVar(&o.config.ClusterCIDR,"cluster-cidr",o.config.ClusterCIDR,"The CIDR range of pods in the cluster. When configured, traffic sent to a Service cluster IP from outside this range will be masqueraded and traffic sent from pods to an external LoadBalancer IP will be directed to the respective cluster IP instead")
fs.StringVar(&o.config.ClientConnection.ContentType,"kube-api-content-type",o.config.ClientConnection.ContentType,"Content type of requests sent to apiserver.")
fs.Float32Var(&o.config.ClientConnection.QPS,"kube-api-qps",o.config.ClientConnection.QPS,"QPS to use while talking with kubernetes apiserver")
fs.Int32Var(&o.config.ClientConnection.Burst,"kube-api-burst",o.config.ClientConnection.Burst,"Burst to use while talking with kubernetes apiserver")
fs.DurationVar(&o.config.UDPIdleTimeout.Duration,"udp-timeout",o.config.UDPIdleTimeout.Duration,"How long an idle UDP connection will be kept open (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxy-mode=userspace")
"Minimum number of conntrack entries to allocate, regardless of conntrack-max-per-core (set conntrack-max-per-core=0 to leave the limit as-is).")
fs.DurationVar(&o.config.Conntrack.TCPEstablishedTimeout.Duration,"conntrack-tcp-timeout-established",o.config.Conntrack.TCPEstablishedTimeout.Duration,"Idle timeout for established TCP connections (0 to leave as-is)")
"A string slice of values which specify the addresses to use for NodePorts. Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32). The default empty string slice ([]) means to use all local addresses.")
fs.Var(flag.NewMapStringBool(&o.config.FeatureGates),"feature-gates","A set of key=value pairs that describe feature gates for alpha/experimental features. "+