# kube-proxy

kube-proxySynopsisThe Kubernetes network proxy runs on each node. This reflects services as defined in the Kubernetes API on each node and can do simple TCP, UDP, and SCTP stream forwarding or round robin TCP, UDP, and SCTP forwarding across a set of backends. Service cluster IPs and ports are currently found through Docker-links-compatible environment variables specifying ports opened by the service proxy. There is an optional addon that provides cluster DNS for these cluster IPs. The user must create a service with the apiserver API to configure the proxy.kube-proxy [flags] Options--add_dir_headerIf true, adds the file directory to the header of the log messages--alsologtostderrlog to standard error as well as files (no effect when -logtostderr=true)--bind-address string Default: 0.0.0.0Overrides kube-proxy's idea of what its node's primary IP is. Note that the name is a historical artifact, and kube-proxy does not actually bind any sockets to this IP. This parameter is ignored if a config file is specified by --config.--bind-address-hard-failIf true kube-proxy will treat failure to bind to a port as fatal and exit--cleanupIf true cleanup iptables and ipvs rules and exit.--cluster-cidr stringThe CIDR range of the pods in the cluster. (For dual-stack clusters, this can be a comma-separated dual-stack pair of CIDR ranges.). When --detect-local-mode is set to ClusterCIDR, kube-proxy will consider traffic to be local if its source IP is in this range. (Otherwise it is not used.) This parameter is ignored if a config file is specified by --config.--config stringThe path to the configuration file.--config-sync-period duration Default: 15m0sHow often configuration from the apiserver is refreshed. Must be greater than 0.--conntrack-max-per-core int32 Default: 32768Maximum number of NAT connections to track per CPU core (0 to leave the limit as-is and ignore conntrack-min).--conntrack-min int32 Default: 131072Minimum number of conntrack entries to allocate, regardless of conntrack-max-per-core (set conntrack-max-per-core=0 to leave the limit as-is).--conntrack-tcp-be-liberalEnable liberal mode for tracking TCP packets by setting nf_conntrack_tcp_be_liberal to 1--conntrack-tcp-timeout-close-wait duration Default: 1h0m0sNAT timeout for TCP connections in the CLOSE_WAIT state--conntrack-tcp-timeout-established duration Default: 24h0m0sIdle timeout for established TCP connections (0 to leave as-is)--conntrack-udp-timeout durationIdle timeout for UNREPLIED UDP connections (0 to leave as-is)--conntrack-udp-timeout-stream durationIdle timeout for ASSURED UDP connections (0 to leave as-is)--detect-local-mode LocalModeMode to use to detect local traffic. This parameter is ignored if a config file is specified by --config.--feature-gates <comma-separated 'key=True|False' pairs>A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:APIResponseCompression=true|false (BETA - default=true)APIServerIdentity=true|false (BETA - default=true)APIServerTracing=true|false (BETA - default=true)APIServingWithRoutine=true|false (ALPHA - default=false)AllAlpha=true|false (ALPHA - default=false)AllBeta=true|false (BETA - default=false)AllowParsingUserUIDFromCertAuth=true|false (BETA - default=true)AllowUnsafeMalformedObjectDeletion=true|false (ALPHA - default=false)AnonymousAuthConfigurableEndpoints=true|false (BETA - default=true)AuthorizeNodeWithSelectors=true|false (BETA - default=true)AuthorizeWithSelectors=true|false (BETA - default=true)CBORServingAndStorage=true|false (ALPHA - default=false)CPUManagerPolicyAlphaOptions=true|false (ALPHA - default=false)CPUManagerPolicyBetaOptions=true|false (BETA - default=true)CSIVolumeHealth=true|false (ALPHA - default=false)ClientsAllowCBOR=true|false (ALPHA - default=false)ClientsPreferCBOR=true|false (ALPHA - default=false)CloudControllerManagerWebhook=true|false (ALPHA - default=false)ClusterTrustBundle=true|false (BETA - default=false)ClusterTrustBundleProjection=true|false (BETA - default=false)ComponentFlagz=true|false (ALPHA - default=false)ComponentStatusz=true|false (ALPHA - default=false)ConcurrentWatchObjectDecode=true|false (BETA - default=false)ConsistentListFromCache=true|false (BETA - default=true)ContainerCheckpoint=true|false (BETA - default=true)ContainerStopSignals=true|false (ALPHA - default=false)ContextualLogging=true|false (BETA - default=true)CoordinatedLeaderElection=true|false (BETA - default=false)CrossNamespaceVolumeDataSource=true|false (ALPHA - default=false)CustomCPUCFSQuotaPeriod=true|false (ALPHA - default=false)DRAAdminAccess=true|false (ALPHA - default=false)DRADeviceTaints=true|false (ALPHA - default=false)DRAPartitionableDevices=true|false (ALPHA - default=false)DRAPrioritizedList=true|false (ALPHA - default=false)DRAResourceClaimDeviceStatus=true|false (BETA - default=true)DeclarativeValidation=true|false (BETA - default=true)DeclarativeValidationTakeover=true|false (BETA - default=false)DeploymentReplicaSetTerminatingReplicas=true|false (ALPHA - default=false)DisableAllocatorDualWrite=true|false (BETA - default=false)DisableCPUQuotaWithExclusiveCPUs=true|false (BETA - default=true)DynamicResourceAllocation=true|false (BETA - default=false)EventedPLEG=true|false (ALPHA - default=false)ExternalServiceAccountTokenSigner=true|false (ALPHA - default=false)GracefulNodeShutdown=true|false (BETA - default=true)GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - default=true)HPAConfigurableTolerance=true|false (ALPHA - default=false)HPAScaleToZero=true|false (ALPHA - default=false)ImageMaximumGCAge=true|false (BETA - default=true)ImageVolume=true|false (BETA - default=false)InOrderInformers=true|false (BETA - default=true)InPlacePodVerticalScaling=true|false (BETA - default=true)InPlacePodVerticalScalingExclusiveCPUs=true|false (ALPHA - default=false)InTreePluginPortworxUnregister=true|false (ALPHA - default=false)InformerResourceVersion=true|false (ALPHA - default=false)JobManagedBy=true|false (BETA - default=true)JobPodReplacementPolicy=true|false (BETA - default=true)KubeletCgroupDriverFromCRI=true|false (BETA - default=true)KubeletCrashLoopBackOffMax=true|false (ALPHA - default=false)KubeletEnsureSecretPulledImages=true|false (ALPHA - default=false)KubeletFineGrainedAuthz=true|false (BETA - default=true)KubeletInUserNamespace=true|false (ALPHA - default=false)KubeletPSI=true|false (ALPHA - default=false)KubeletPodResourcesDynamicResources=true|false (ALPHA - default=false)KubeletPodResourcesGet=true|false (ALPHA - default=false)KubeletSeparateDiskGC=true|false (BETA - default=true)KubeletServiceAccountTokenForCredentialProviders=true|false (ALPHA - default=false)KubeletTracing=true|false (BETA - default=true)ListFromCacheSnapshot=true|false (ALPHA - default=false)LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (BETA - default=false)LoggingAlphaOptions=true|false (ALPHA - default=false)LoggingBetaOptions=true|false (BETA - default=true)MatchLabelKeysInPodTopologySpread=true|false (BETA - default=true)MaxUnavailableStatefulSet=true|false (ALPHA - default=false)MemoryQoS=true|false (ALPHA - default=false)MutableCSINodeAllocatableCount=true|false (ALPHA - default=false)MutatingAdmissionPolicy=true|false (ALPHA - default=false)NodeLogQuery=true|false (BETA - default=false)NodeSwap=true|false (BETA - default=true)OpenAPIEnums=true|false (BETA - default=true)OrderedNamespaceDeletion=true|false (BETA - default=true)PodAndContainerStatsFromCRI=true|false (ALPHA - default=false)PodDeletionCost=true|false (BETA - default=true)PodLevelResources=true|false (ALPHA - default=false)PodLifecycleSleepAction=true|false (BETA - default=true)PodLifecycleSleepActionAllowZero=true|false (BETA - default=true)PodLogsQuerySplitStreams=true|false (ALPHA - default=false)PodObservedGenerationTracking=true|false (ALPHA - default=false)PodReadyToStartContainersCondition=true|false (BETA - default=true)PodTopologyLabelsAdmission=true|false (ALPHA - default=false)PortForwardWebsockets=true|false (BETA - default=true)PreferSameTrafficDistribution=true|false (ALPHA - default=false)ProcMountType=true|false (BETA - default=true)QOSReserved=true|false (ALPHA - default=false)RecoverVolumeExpansionFailure=true|false (BETA - default=true)ReduceDefaultCrashLoopBackOffDecay=true|false (ALPHA - default=false)RelaxedDNSSearchValidation=true|false (BETA - default=true)RelaxedEnvironmentVariableValidation=true|false (BETA - default=true)ReloadKubeletServerCertificateFile=true|false (BETA - default=true)RemoteRequestHeaderUID=true|false (BETA - default=true)ResilientWatchCacheInitialization=true|false (BETA - default=true)ResourceHealthStatus=true|false (ALPHA - default=false)RotateKubeletServerCertificate=true|false (BETA - default=true)RuntimeClassInImageCriApi=true|false (ALPHA - default=false)SELinuxChangePolicy=true|false (BETA - default=true)SELinuxMount=true|false (BETA - default=false)SELinuxMountReadWriteOncePod=true|false (BETA - default=true)SchedulerAsyncPreemption=true|false (BETA - default=true)SchedulerPopFromBackoffQ=true|false (BETA - default=true)SchedulerQueueingHints=true|false (BETA - default=true)SeparateTaintEvictionController=true|false (BETA - default=true)ServiceAccountNodeAudienceRestriction=true|false (BETA - default=true)StorageCapacityScoring=true|false (ALPHA - default=false)StorageVersionAPI=true|false (ALPHA - default=false)StorageVersionHash=true|false (BETA - default=true)StorageVersionMigrator=true|false (ALPHA - default=false)StreamingCollectionEncodingToJSON=true|false (BETA - default=true)StreamingCollectionEncodingToProtobuf=true|false (BETA - default=true)StrictIPCIDRValidation=true|false (ALPHA - default=false)StructuredAuthenticationConfiguration=true|false (BETA - default=true)SupplementalGroupsPolicy=true|false (BETA - default=true)SystemdWatchdog=true|false (BETA - default=true)TopologyManagerPolicyAlphaOptions=true|false (ALPHA - default=false)TopologyManagerPolicyBetaOptions=true|false (BETA - default=true)TranslateStreamCloseWebsocketRequests=true|false (BETA - default=true)UnauthenticatedHTTP2DOSMitigation=true|false (BETA - default=true)UnknownVersionInteroperabilityProxy=true|false (ALPHA - default=false)UserNamespacesPodSecurityStandards=true|false (ALPHA - default=false)UserNamespacesSupport=true|false (BETA - default=true)VolumeAttributesClass=true|false (BETA - default=false)WatchCacheInitializationPostStartHook=true|false (BETA - default=false)WatchList=true|false (BETA - default=false)WatchListClient=true|false (BETA - default=false)WinDSR=true|false (BETA - default=true)WinOverlay=true|false (BETA - default=true)WindowsCPUAndMemoryAffinity=true|false (ALPHA - default=false)WindowsGracefulNodeShutdown=true|false (ALPHA - default=false)This parameter is ignored if a config file is specified by --config.--healthz-bind-address ipport Default: 0.0.0.0:10256The IP address and port for the health check server to serve on, defaulting to "0.0.0.0:10256". This parameter is ignored if a config file is specified by --config.-h, --helphelp for kube-proxy--hostname-override stringIf non-empty, will be used as the name of the Node that kube-proxy is running on. If unset, the node name is assumed to be the same as the node's hostname.--init-onlyIf true, perform any initialization steps that must be done with full root privileges, and then exit. After doing this, you can run kube-proxy again with only the CAP_NET_ADMIN capability.--iptables-localhost-nodeports Default: trueIf false, kube-proxy will disable the legacy behavior of allowing NodePort services to be accessed via localhost. (Applies only to iptables mode and IPv4; localhost NodePorts are never allowed with other proxy modes or with IPv6.)--iptables-masquerade-bit int32 Default: 14If using the iptables or ipvs proxy mode, the bit of the fwmark space to mark packets requiring SNAT with. Must be within the range [0, 31].--iptables-min-sync-period duration Default: 1sThe minimum period between iptables rule resyncs (e.g. '5s', '1m', '2h22m'). A value of 0 means every Service or EndpointSlice change will result in an immediate iptables resync.--iptables-sync-period duration Default: 30sAn interval (e.g. '5s', '1m', '2h22m') indicating how frequently various re-synchronizing and cleanup operations are performed. Must be greater than 0.--ipvs-exclude-cidrs stringsA comma-separated list of CIDRs which the ipvs proxier should not touch when cleaning up IPVS rules.--ipvs-min-sync-period duration Default: 1sThe minimum period between IPVS rule resyncs (e.g. '5s', '1m', '2h22m'). A value of 0 means every Service or EndpointSlice change will result in an immediate IPVS resync.--ipvs-scheduler stringThe ipvs scheduler type when proxy mode is ipvs--ipvs-strict-arpEnable strict ARP by setting arp_ignore to 1 and arp_announce to 2--ipvs-sync-period duration Default: 30sAn interval (e.g. '5s', '1m', '2h22m') indicating how frequently various re-synchronizing and cleanup operations are performed. Must be greater than 0.--ipvs-tcp-timeout durationThe timeout for idle IPVS TCP connections, 0 to leave as-is. (e.g. '5s', '1m', '2h22m').--ipvs-tcpfin-timeout durationThe timeout for IPVS TCP connections after receiving a FIN packet, 0 to leave as-is. (e.g. '5s', '1m', '2h22m').--ipvs-udp-timeout durationThe timeout for IPVS UDP packets, 0 to leave as-is. (e.g. '5s', '1m', '2h22m').--kube-api-burst int32 Default: 10Burst to use while talking with kubernetes apiserver--kube-api-content-type string Default: "application/vnd.kubernetes.protobuf"Content type of requests sent to apiserver.--kube-api-qps float Default: 5QPS to use while talking with kubernetes apiserver--kubeconfig stringPath to kubeconfig file with authorization information (the master location can be overridden by the master flag).--log-flush-frequency duration Default: 5sMaximum number of seconds between log flushes--log-text-info-buffer-size quantity[Alpha] In text format with split output streams, the info messages can be buffered for a while to increase performance. The default value of zero bytes disables buffering. The size can be specified as number of bytes (512), multiples of 1000 (1K), multiples of 1024 (2Ki), or powers of those (3M, 4G, 5Mi, 6Gi). Enable the LoggingAlphaOptions feature gate to use this.--log-text-split-stream[Alpha] In text format, write error messages to stderr and info messages to stdout. The default is to write a single stream to stdout. Enable the LoggingAlphaOptions feature gate to use this.--log_backtrace_at <a string in the form 'file:N'> Default: :0when logging hits line file:N, emit a stack trace--log_dir stringIf non-empty, write log files in this directory (no effect when -logtostderr=true)--log_file stringIf non-empty, use this log file (no effect when -logtostderr=true)--log_file_max_size uint Default: 1800Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited.--logging-format string Default: "text"Sets the log format. Permitted formats: "text".--logtostderr Default: truelog to standard error instead of files--masquerade-allSNAT all traffic sent via Service cluster IPs. This may be required with some CNI plugins. Only supported on Linux.--master stringThe address of the Kubernetes API server (overrides any value in kubeconfig)--metrics-bind-address ipport Default: 127.0.0.1:10249The IP address and port for the metrics server to serve on, defaulting to "127.0.0.1:10249". (Set to "0.0.0.0:10249" / "[::]:10249" to bind on all interfaces.) Set empty to disable. This parameter is ignored if a config file is specified by --config.--nodeport-addresses stringsA list of CIDR ranges that contain valid node IPs, or alternatively, the single string 'primary'. If set to a list of CIDRs, connections to NodePort services will only be accepted on node IPs in one of the indicated ranges. If set to 'primary', NodePort services will only be accepted on the node's primary IP(s) according to the Node object. If unset, NodePort connections will be accepted on all local IPs. This parameter is ignored if a config file is specified by --config.--one_outputIf true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)--oom-score-adj int32 Default: -999The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]. This parameter is ignored if a config file is specified by --config.--pod-bridge-interface stringA bridge interface name. When --detect-local-mode is set to BridgeInterface, kube-proxy will consider traffic to be local if it originates from this bridge.--pod-interface-name-prefix stringAn interface name prefix. When --detect-local-mode is set to InterfaceNamePrefix, kube-proxy will consider traffic to be local if it originates from any interface whose name begins with this prefix.--profilingIf true enables profiling via web interface on /debug/pprof handler. This parameter is ignored if a config file is specified by --config.--proxy-mode ProxyModeWhich proxy mode to use: on Linux this can be 'iptables' (default), 'ipvs', or 'nftables'. On Windows the only supported value is 'kernelspace'.This parameter is ignored if a config file is specified by --config.--show-hidden-metrics-for-version stringThe previous version for which you want to show hidden metrics. Only the previous minor version is meaningful, other values will not be allowed. The format is <major>.<minor>, e.g.: '1.16'. The purpose of this format is make sure you have the opportunity to notice if the next release hides additional metrics, rather than being surprised when they are permanently removed in the release after that. This parameter is ignored if a config file is specified by --config.--skip_headersIf true, avoid header prefixes in the log messages--skip_log_headersIf true, avoid headers when opening log files (no effect when -logtostderr=true)--stderrthreshold int Default: 2logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true)-v, --v intnumber for the log level verbosity--version version[=true]--version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version--vmodule pattern=N,...comma-separated list of pattern=N settings for file-filtered logging (only works for text log format)--write-config-to stringIf set, write the default configuration values to this file and exit.This page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.