Kubernetes 网络代理在每个节点上运行。网络代理反映了每个节点上 Kubernetes API 中定义的服务,并且可以执行简单的 TCP、UDP 和 SCTP 流转发,或者在一组后端进行 循环 TCP、UDP 和 SCTP 转发。 当前可通过 Docker-links-compatible 环境变量找到服务集群 IP 和端口, 这些环境变量指定了服务代理打开的端口。 有一个可选的插件,可以为这些集群 IP 提供集群 DNS。 用户必须使用 apiserver API 创建服务才能配置代理。
kube-proxy [flags]
<table style="width: 100%; table-layout: fixed;"> <colgroup> <col span="1" style="width: 10px;" /> <col span="1" /> </colgroup> <tbody>
<tr> <td colspan="2">--add_dir_header</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果为 true,将文件目录添加到日志消息的头部 </p> </td> </tr>
<tr> <td colspan="2">--alsologtostderr</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
设置为 true 表示将日志输出到文件的同时输出到 stderr(当 <code>--logtostderr=true</code> 时不生效) </p> </td> </tr>
<tr> <td colspan="2">--alsologtostderrthreshold int</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
当 <code>--alsologtostderr=true</code> 时, 高于或等于此阈值的日志将输出到标准错误输出(当 <code>--logtostderr=true</code> 时无效)。 </p></td> </tr>
<tr> <td colspan="2">--bind-address string 默认值:0.0.0.0</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
重写 kube-proxy 对其节点主要 IP 的理解。请注意,此名称是一个历史遗留字段, 并且 kube-proxy 实际上并没有将任何套接字绑定到此 IP。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p></td> </tr>
<tr> <td colspan="2">--cleanup</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果为 true,清理 iptables 和 ipvs 规则并退出。 </p> </td> </tr>
<tr> <td colspan="2">--cluster-cidr string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
集群中 Pod 的 CIDR 范围。对于双协议栈集群,这可以是逗号分隔的双协议栈 CIDR 范围对。 当 <code>--detect-local-mode</code> 设置为 ClusterCIDR 时, kube-proxy 会将源 IP 在此范围内的流量视为本地流量。否则不使用此字段。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--config string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
配置文件的路径。 </p> </td> </tr>
<tr> <td colspan="2">--config-sync-period duration 默认值:15m0s</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
来自 apiserver 的配置的刷新频率。必须大于 0。 </p> </td> </tr>
<tr> <td colspan="2">--conntrack-max-per-core int32 默认值:32768</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
每个 CPU 核跟踪的最大 NAT 连接数(0 表示保留当前限制并忽略 conntrack-min 设置)。 </p> </td> </tr>
<tr> <td colspan="2">--conntrack-min int32 默认值:131072</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
无论 <code>conntrack-max-per-core</code> 多少,要分配的 conntrack 条目的最小数量(将 <code>conntrack-max-per-core</code> 设置为 0 即可 保持当前的限制)。 </p> </td> </tr>
<tr> <td colspan="2">--conntrack-tcp-be-liberal</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
通过将 <code>nf_conntrack_tcp_be_liberal</code> 设置为 1,启用宽松模式以跟踪 TCP 数据包。 </p></td> </tr>
<tr> <td colspan="2">--conntrack-tcp-timeout-close-wait duration 默认值:1h0m0s </td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
处于 <code>CLOSE_WAIT</code> 状态的 TCP 连接的 NAT 超时。 </p> </td> </tr>
<tr> <td colspan="2">--conntrack-tcp-timeout-established duration 默认值:24h0m0s</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
已建立的 TCP 连接的空闲超时(0 保持当前设置)。 </p> </td> </tr>
<tr> <td colspan="2">--conntrack-udp-timeout duration</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
UNREPLIED UDP 连接的空闲超时(0 保持当前设置)。 </p></td> </tr>
<tr> <td colspan="2">--conntrack-udp-timeout-stream duration</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
ASSURED UDP 连接的空闲超时(0 保持当前设置)。 </p></td> </tr>
<tr> <td colspan="2">--detect-local-mode LocalMode</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
用于检测本地流量的模式。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--feature-gates <逗号分隔的 'key=True|False' 对></td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
一组 key=value 对,用来描述测试性/试验性功能的特性门控。可选项有:<br/> CRDObservedGenerationTracking=true|false (BETA - 默认值=true)<br/> CRIListStreaming=true|false (ALPHA - 默认值=false)<br/> CSIVolumeHealth=true|false (ALPHA - 默认值=false)<br/> ClearingNominatedNodeNameAfterBinding=true|false (BETA - 默认值=true)<br/> ClientsAllowCARotation=true|false (BETA - 默认值=true)<br/> ClientsAllowCBOR=true|false (ALPHA - 默认值=false)<br/> ClientsAllowTLSCacheGC=true|false (BETA - 默认值=true)<br/> ClientsPreferCBOR=true|false (ALPHA - 默认值=false)<br/> CloudControllerManagerWatchBasedRoutesReconciliation=true|false (ALPHA - 默认值=false)<br/> CloudControllerManagerWebhook=true|false (ALPHA - 默认值=false)<br/> ComponentFlagz=true|false (BETA - 默认值=true)<br/> ComponentStatusz=true|false (BETA - 默认值=true)<br/> CompositePodGroup=true|false (ALPHA - 默认值=false)<br/> ConcurrentWatchObjectDecode=true|false (BETA - 默认值=true)<br/> ConsistentListFromCacheSkipTimeoutFallback=true|false (ALPHA - 默认值=false)<br/> ConstrainedImpersonation=true|false (BETA - 默认值=true)<br/> ContainerCheckpoint=true|false (BETA - 默认值=true)<br/> ContainerRestartRules=true|false (BETA - 默认值=true)<br/> ContainerStopSignals=true|false (ALPHA - 默认值=false)<br/> ContextualLogging=true|false (BETA - 默认值=true)<br/> ControllerManagerReleaseLeaderElectionLockOnExit=true|false (ALPHA - 默认值=false)<br/> CoordinatedLeaderElection=true|false (BETA - 默认值=false)<br/> CrossNamespaceVolumeDataSource=true|false (ALPHA - 默认值=false)<br/> DRAConsumableCapacity=true|false (BETA - 默认值=true)<br/> DRADerivedAttributes=true|false (ALPHA - 默认值=false)<br/> DRADeviceBindingConditions=true|false (BETA - 默认值=true)<br/> DRADeviceCompatibilityGroups=true|false (ALPHA - 默认值=false)<br/> DRAFractionalCapacityRange=true|false (BETA - 默认值=false) 或 DRAFractionalCapacityRange=true|false (BETA - 默认值=true) if --min-compatibility-version>=1.37<br/> DRAListTypeAttributes=true|false (ALPHA - 默认值=false)<br/> DRANodeAllocatableResources=true|false (ALPHA - 默认值=false)<br/> DRAOptionalNodeOperations=true|false (ALPHA - 默认值=false)<br/> DRAPartitionableDevices=true|false (BETA - 默认值=true)<br/> DRAPartitionableDevicesType=true|false (ALPHA - 默认值=false)<br/> DRAResourceClaimGranularStatusAuthorization=true|false (BETA - 默认值=true)<br/> DRAResourcePoolStatus=true|false (ALPHA - 默认值=false)<br/> DRASchedulerFilterTimeout=true|false (BETA - 默认值=true)<br/> DRAWorkloadResourceClaims=true|false (BETA - 默认值=false)<br/> DeclarativeValidationBeta=true|false (BETA - 默认值=true)<br/> DefaultPodSysctls=true|false (ALPHA - 默认值=false)<br/> DeploymentReplicaSetTerminatingReplicas=true|false (BETA - 默认值=true)<br/> DetectCacheInconsistency=true|false (BETA - 默认值=true)<br/> EmptyDirVolumeMode=true|false (ALPHA - 默认值=false)<br/> EnvFiles=true|false (BETA - 默认值=true)<br/> EtcdRangeStream=true|false (BETA - 默认值=true)<br/> EventedPLEG=true|false (ALPHA - 默认值=false)<br/> EvictionRequestAPI=true|false (ALPHA - 默认值=false)<br/> ExcludeAdmissionWebhookVirtualResources=true|false (BETA - 默认值=true)<br/> ExtendWebSocketsToKubelet=true|false (BETA - 默认值=true)<br/> GRPCContainerProbeTLS=true|false (ALPHA - 默认值=false)<br/> GenericWorkload=true|false (BETA - 默认值=false)<br/> GracefulNodeShutdown=true|false (BETA - 默认值=true)<br/> GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - 默认值=true)<br/> H2CContainerProbe=true|false (ALPHA - 默认值=false)<br/> HPAGeneration=true|false (BETA - 默认值=true)<br/> HPAOptimizedSelectorStore=true|false (BETA - 默认值=true)<br/> HPAScaleToZero=true|false (BETA - 默认值=true)<br/> HugepageAwareEviction=true|false (BETA - 默认值=true)<br/> ImageVolumeWithDigest=true|false (ALPHA - 默认值=false)<br/> InOrderInformersBatchProcess=true|false (BETA - 默认值=true)<br/> InPlacePodLevelResourcesVerticalScaling=true|false (BETA - 默认值=true)<br/> InPlacePodVerticalScalingExclusiveCPUs=true|false (ALPHA - 默认值=false)<br/> InPlacePodVerticalScalingExclusiveMemory=true|false (ALPHA - 默认值=false)<br/> InPlacePodVerticalScalingMemoryBackedVolumes=true|false (ALPHA - 默认值=false)<br/> InPlacePodVerticalScalingSchedulerPreemption=true|false (ALPHA - 默认值=false)<br/> InterPodAffinityHostnameFastPath=true|false (ALPHA - 默认值=false)<br/> KubeProxyNFTablesLocalhostNodePorts=true|false (ALPHA - 默认值=false)<br/> KubeletAllocatedPodsEndpoint=true|false (ALPHA - 默认值=false)<br/> KubeletCrashLoopBackOffMax=true|false (BETA - 默认值=true)<br/> KubeletEnsureSecretPulledImages=true|false (BETA - 默认值=true)<br/> KubeletInUserNamespace=true|false (BETA - 默认值=true)<br/> KubeletSeparateDiskGC=true|false (BETA - 默认值=true)<br/> KubeletServiceAccountTokenForCredentialProviders=true|false (BETA - 默认值=true)<br/> ListFromCacheSnapshot=true|false (BETA - 默认值=true)<br/> LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (BETA - 默认值=false)<br/> LoggingAlphaOptions=true|false (ALPHA - 默认值=false)<br/> LoggingBetaOptions=true|false (BETA - 默认值=true)<br/> ManifestBasedAdmissionControlConfig=true|false (BETA - 默认值=true)<br/> MatchLabelKeysInPodTopologySpread=true|false (BETA - 默认值=true)<br/> MatchLabelKeysInPodTopologySpreadSelectorMerge=true|false (BETA - 默认值=true)<br/> MaxUnavailableStatefulSet=true|false (BETA - 默认值=true)<br/> MemoryQoS=true|false (BETA - 默认值=true)<br/> MutablePVNodeAffinity=true|false (ALPHA - 默认值=false)<br/> MutablePodResourcesForSuspendedJobs=true|false (BETA - 默认值=true)<br/> MutableSchedulingDirectivesForSuspendedJobs=true|false (BETA - 默认值=true)<br/> NFTablesNetlink=true|false (BETA - 默认值=true)<br/> NativeHistograms=true|false (BETA - 默认值=true)<br/> NodeControllerLeaseCircuitBreaker=true|false (BETA - 默认值=true)<br/> NodeLifecycleConditions=true|false (ALPHA - 默认值=false)<br/> NominatedNodeNameForExpectation=true|false (BETA - 默认值=true)<br/> OpenAPIEnums=true|false (BETA - 默认值=true)<br/> OpportunisticBatching=true|false (BETA - 默认值=true)<br/> PersistentVolumeClaimUnusedSinceTime=true|false (BETA - 默认值=true)<br/> PodAndContainerStatsFromCRI=true|false (BETA - 默认值=false)<br/> PodDeletionCost=true|false (BETA - 默认值=true)<br/> PodGroupPreemptionPolicy=true|false (ALPHA - 默认值=false)<br/> PodLevelResourceManagers=true|false (BETA - 默认值=false)<br/> PodLevelResources=true|false (BETA - 默认值=true)<br/> PodLevelResourcesFixDefaulting=true|false (BETA - 默认值=true)<br/> PodLevelResourcesFixKubeletQOSClass=true|false (BETA - 默认值=true)<br/> PodLogsQuerySplitStreams=true|false (ALPHA - 默认值=false)<br/> PodTopologyLabelsAdmission=true|false (BETA - 默认值=true)<br/> PodsAPI=true|false (BETA - 默认值=true)<br/> PortForwardWebsockets=true|false (BETA - 默认值=true)<br/> QOSReserved=true|false (ALPHA - 默认值=false)<br/> ReduceDefaultCrashLoopBackOffDecay=true|false (ALPHA - 默认值=false)<br/> ReloadKubeletClientCAFile=true|false (BETA - 默认值=true)<br/> ReloadKubeletServerCertificateFile=true|false (BETA - 默认值=true)<br/> RemoteRequestHeaderUID=true|false (BETA - 默认值=true)<br/> ResourceHealthStatus=true|false (BETA - 默认值=true)<br/> ResourceHealthStatusMessage=true|false (BETA - 默认值=true)<br/> RestartAllContainersOnContainerExits=true|false (BETA - 默认值=true)<br/> RotateKubeletServerCertificate=true|false (BETA - 默认值=true)<br/> RuntimeClassInImageCriApi=true|false (ALPHA - 默认值=false)<br/> SchedulerAsyncAPICalls=true|false (BETA - 默认值=false)<br/> SchedulerAsyncPreemption=true|false (BETA - 默认值=true)<br/> SchedulerPopFromBackoffQ=true|false (BETA - 默认值=true)<br/> SchedulerPreQueueingHints=true|false (ALPHA - 默认值=false)<br/> ServiceAccountNodeAudienceRestriction=true|false (BETA - 默认值=true)<br/> ShardedListAndWatch=true|false (ALPHA - 默认值=false)<br/> SizeBasedListCostEstimate=true|false (BETA - 默认值=true)<br/> StaleControllerConsistencyDaemonSet=true|false (BETA - 默认值=true)<br/> StaleControllerConsistencyHPA=true|false (BETA - 默认值=true)<br/> StaleControllerConsistencyJob=true|false (BETA - 默认值=true)<br/> StaleControllerConsistencyReplicaSet=true|false (BETA - 默认值=true)<br/> StaleControllerConsistencyStatefulSet=true|false (BETA - 默认值=true)<br/> StatefulSetRecreateStrategy=true|false (ALPHA - 默认值=false)<br/> StatefulSetSemanticRevisionComparison=true|false (BETA - 默认值=true)<br/> StorageCapacityScoring=true|false (BETA - 默认值=true)<br/> StorageVersionAPI=true|false (ALPHA - 默认值=false)<br/> StorageVersionHash=true|false (BETA - 默认值=true)<br/> StrictIPCIDRValidation=true|false (BETA - 默认值=true)<br/> StructuredAuthenticationConfigurationEgressSelector=true|false (BETA - 默认值=true)<br/> StructuredAuthenticationConfigurationJWKSMetrics=true|false (BETA - 默认值=true)<br/> TaintTolerationComparisonOperators=true|false (ALPHA - 默认值=false)<br/> TokenRequestServiceAccountUIDValidation=true|false (BETA - 默认值=true)<br/> TopologyAwareWorkloadScheduling=true|false (ALPHA - 默认值=false)<br/> TopologyManagerPolicyAlphaOptions=true|false (ALPHA - 默认值=false)<br/> TopologyManagerPolicyBetaOptions=true|false (BETA - 默认值=true)<br/> TranslateStreamCloseWebsocketRequests=true|false (BETA - 默认值=true)<br/> UnauthenticatedHTTP2DOSMitigation=true|false (BETA - 默认值=true)<br/> UnknownVersionInteroperabilityProxy=true|false (BETA - 默认值=true)<br/> UnlockWhileProcessingFIFO=true|false (BETA - 默认值=true)<br/> UserNamespacesHostNetworkSupport=true|false (ALPHA - 默认值=false)<br/> VolumeBindMountOptions=true|false (ALPHA - 默认值=false)<br/> VolumeLimitScaling=true|false (BETA - 默认值=true)<br/> WatchList=true|false (BETA - 默认值=true)<br/> WatchListClient=true|false (BETA - 默认值=true)<br/> WatchListCompression=true|false (BETA - 默认值=true)<br/> WebhookRoundTripLoadBalancing=true|false (BETA - 默认值=true)<br/> WindowsCPUAndMemoryAffinity=true|false (ALPHA - 默认值=false)<br/> WindowsGracefulNodeShutdown=true|false (BETA - 默认值=true)<br/> WorkloadWithJob=true|false (ALPHA - 默认值=false)<br/> 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--healthz-bind-address ipport 默认值:<code>0.0.0.0:10256</code></td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
服务健康状态检查的 IP 地址和端口,默认为 “0.0.0.0:10256”。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">-h, --help</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
kube-proxy 操作的帮助命令。 </p> </td> </tr>
<tr> <td colspan="2">--hostname-override string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果非空,将使用此字符串而不是实际的主机名作为标识。 如果不设置,节点名称假定为与节点的主机名相同。 </p> </td> </tr>
<tr> <td colspan="2">--init-only</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果设置为 true,则执行需要完整 root 权限才能执行的所有初始化步骤,然后退出。 完成此操作后,你可以仅使用 CAP_NET_ADMIN 权能再次运行 kube-proxy。 </p></td> </tr>
<tr> <td colspan="2">--iptables-localhost-nodeports 默认值:true</td> </tr> <tr> <td> </td> <td style="line-height: 130%; word-wrap: break-word;">
<p> 如果设为 false,Kube-proxy 将禁用允许通过本地主机访问 NodePort 服务的传统行为, 这仅适用于 iptables 模式和 ipv4。本地主机的 NodePort 在其他代理模式或 IPv6 下是不允许的。 </p> </td> </tr>
<tr> <td colspan="2">--iptables-masquerade-bit int32 默认值:14</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
在使用 iptables 或 ipvs 代理模式时,用来设置 fwmark 空间的 bit,标记需要 SNAT 的数据包。必须在 [0,31] 范围内。 </p> </td> </tr>
<tr> <td colspan="2">--iptables-min-sync-period duration 默认值:1s</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
iptables 规则重新同步之间的最小间隔(例如 '5s'、'1m'、'2h22m')。 值为 0 表示每次 Service 或 EndpointSlice 更改都会立即进行 iptables 重新同步。 </p> </td> </tr>
<tr> <td colspan="2">--iptables-sync-period duration 默认值:30s</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
表示各种重新同步和清理操作执行频率的时间间隔(例如 '5s'、'1m'、'2h22m')。必须大于 0。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-exclude-cidrs strings</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
逗号分隔的 CIDR 列表,ipvs 代理在清理 IPVS 规则时不会此列表中的地址范围。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-min-sync-period duration 默认值:1s</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
ipvs 规则重新同步之间的最小间隔(例如 '5s'、'1m'、'2h22m')。 值为 0 表示每次 Service 或 EndpointSlice 更改都会立即进行 ipvs 重新同步。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-scheduler string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
代理模式为 ipvs 时所选的 ipvs 调度器类型。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-strict-arp</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
通过将 <code>arp_ignore</code> 设置为 1 并将 <code>arp_announce</code> 设置为 2 启用严格的 ARP。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-sync-period duration 默认值:30s</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
表示各种重新同步和清理操作执行频率的时间间隔(例如 '5s'、'1m'、'2h22m')。必须大于 0。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-tcp-timeout duration</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
空闲 IPVS TCP 连接的超时时间,0 保持连接(例如 '5s'、'1m'、'2h22m')。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-tcpfin-timeout duration</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
收到 FIN 数据包后,IPVS TCP 连接的超时,0 保持当前设置不变。(例如 '5s'、'1m'、'2h22m')。 </p> </td> </tr>
<tr> <td colspan="2">--ipvs-udp-timeout duration</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
IPVS UDP 数据包的超时,0 保持当前设置不变。(例如 '5s'、'1m'、'2h22m')。 </p> </td> </tr>
<tr> <td colspan="2">--kube-api-burst int32 默认值:10</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
与 kubernetes apiserver 通信的突发数量。 </p> </td> </tr>
<tr> <td colspan="2">--kube-api-content-type string 默认值:"application/vnd.kubernetes.protobuf"</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
发送到 apiserver 的请求的内容类型。 </p> </td> </tr>
<tr> <td colspan="2">--kube-api-qps float32 默认值:5</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
与 kubernetes apiserver 交互时使用的 QPS。 </p> </td> </tr>
<tr> <td colspan="2">--kubeconfig string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
包含鉴权信息的 kubeconfig 文件的路径(主控节点位置由 master 标志设置)。 </p> </td> </tr>
<tr> <td colspan="2">--legacy_stderr_threshold_behavior Default: true</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果为 true,则当 <code>--logtostderr=true</code> 时,<code>stderrthreshold</code> 将被忽略(旧版行为)。如果为假,即使 <code>--logtostderr=true</code>, stderrthreshold 也将被遵守。 </p></td> </tr>
<tr> <td colspan="2">--log-flush-frequency duration 默认值:5s</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"> <p>
日志清洗之间的最大秒数 </p> </td> </tr>
<tr> <td colspan="2">--log-text-info-buffer-size quantity</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"> <p>
[Alpha] 在具有分割输出流的文本格式中,信息消息可以被缓冲一段时间以提高性能。 默认值零字节表示禁用缓冲机制。 大小可以指定为字节数(512)、1000 的倍数(1K)、1024 的倍数(2Ki)或它们的幂(3M、4G、5Mi、6Gi)。 启用 LoggingAlphaOptions 特性门控以使用此功能。 </p> </td>
<tr> <td colspan="2">--log-text-split-stream</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"> <p>
[Alpha] 以文本格式,将错误消息写入 stderr,将信息消息写入 stdout。 默认是将单个流写入标准输出。 启用 LoggingAlphaOptions 特性门控以使用它。 </p> </td> </tr>
<tr> <td colspan="2">--log_backtrace_at <“file:N” 格式的字符串> 默认值:0</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
当日志命中 file:N,触发一次堆栈追踪 </p></td> </tr>
<tr> <td colspan="2">--log_dir string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果非空,则在此目录中写入日志文件(当 <code>--logtostderr=true</code> 时不生效) </p></td> </tr>
<tr> <td colspan="2">--log_file string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果非空,使用此日志文件(当 <code>--logtostderr=true</code> 时不生效) </p></td> </tr>
<tr> <td colspan="2">--log_file_max_size uint 默认值:1800</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
定义日志文件可以增长到的最大大小(当 <code>--logtostderr=true</code> 时不生效)。 单位是兆字节。如果值为 0,则最大文件大小不受限制。 </p></td> </tr>
<tr> <td colspan="2">--logging-format string 默认值:"text"</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"> <p>
设置日志格式。允许的格式为:"text"。 </p> </td> </tr>
<tr> <td colspan="2">--logtostderr 默认值:true</td> </tr>
<tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
日志输出到 stderr 而不是文件。 </p></td> </tr>
<tr> <td colspan="2">--masquerade-all</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
对通过 Service 集群 IP 发送的所有流量进行 SNAT。 这对某些 CNI 插件可能是必需的。仅支持 Linux。 </p> </td> </tr>
<tr> <td colspan="2">--master string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
Kubernetes API 服务器的地址(覆盖 kubeconfig 中的相关值)。 </p> </td> </tr>
<tr> <td colspan="2">--metrics-bind-address ipport 默认值:<code>127.0.0.1:10249</code></td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
metrics 服务器要使用的 IP 地址和端口。 如果 <code>--bind-address</code> 未设置或设置为 IPv4,则默认为 "127.0.0.1:10249"。 设置为 "0.0.0.0:10249" / "[::]:10249" 可以在所有接口上进行绑定。 设置为空则禁用。如果通过 --config 指定了配置文件,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--nodeport-addresses strings</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
由 CIDR 范围和/或可展开为 CIDR 范围的关键字构成的列表。NodePort 服务只能在该列表所覆盖的节点 IP 上访问。 支持的关键字包括:'primary'(Node 对象的主 IPv4 和/或 IPv6 地址)、'localhost'(127.0.0.0/8 和 ::1/128)以及 'all'(0.0.0.0/0 和 ::/0)。 列表中可包含有效关键字和 CIDR 的任意组合。 在本地回路 IP 上提供 NodePort 仅在 iptables 模式下受支持(仅限 IPv4,参见 --iptables-localhost-nodeports);在 nftables 模式下则仅在启用 KubeProxyNFTablesLocalhostNodePorts 特性门控、且列表中显式包含本地回路(如 'localhost')时,针对 TCP 提供支持。 如果未设置,则在 iptables 和 ipvs 模式下默认为 'all',在 nftables 模式下默认为 'primary'。 如果通过 --config 指定了配置文件,则此参数将被忽略。 </p> </td> </tr>
<tr> <td colspan="2">--one_output</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果为 true,则仅将日志写入其本身的严重性级别 (而不是写入每个较低的严重性级别;当 <code>--logtostderr=true</code> 时不生效)。 </p></td> </tr>
<tr> <td colspan="2">--oom-score-adj int32 默认值:-999</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
kube-proxy 进程中的 oom-score-adj 值,必须在 [-1000,1000] 范围内。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--pod-bridge-interface string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;">
一个桥接接口名称。当 <code>--detect-local-mode</code> 设置为 BridgeInterface 时, kube-proxy 会将源自此桥接的流量视为本地流量。 </td> </tr>
<tr> <td colspan="2">--pod-interface-name-prefix string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;">
一个接口名称前缀。当 <code>--detect-local-mode</code> 设置为 InterfaceNamePrefix 时, kube-proxy 会将源自名称以该前缀开头的所有接口的流量视为本地流量。 </td> </tr>
<tr> <td colspan="2">--profiling</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果为 true,则通过 Web 接口 <code>/debug/pprof</code> 启用性能分析。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--proxy-mode ProxyMode</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"> <p>
使用哪种代理模式:在 Linux 上可以是 'iptables'(默认)、'ipvs' 或 'nftables'。 在 Windows 上唯一支持的值是 'kernelspace'。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--show-hidden-metrics-for-version string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
要显示隐藏指标的先前版本。 仅先前的次要版本有意义,不允许其他值。 格式为 <major>.<minor>,例如 '1.16'。 这种格式的目的是确保你有机会注意到下一个发行版是否隐藏了其他指标, 而不是在之后将其永久删除时感到惊讶。 如果配置文件由 <code>--config</code> 指定,则忽略此参数。 </p> </td> </tr>
<tr> <td colspan="2">--skip_headers</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果为 true,则避免在日志消息中使用头部前缀。 </p></td> </tr>
<tr> <td colspan="2">--skip_log_headers</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果为 true,则在打开日志文件时避免使用头部(当 <code>--logtostderr=true</code> 时不生效) </p></td> </tr>
<tr> <td colspan="2">--stderrthreshold int 默认值:2</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
当写入到文件或 stderr 时设置严重程度达到或超过此阈值的日志输出到 stderr (当 <code>--legacy_stderr_threshold_behavior=false</code> 时, <code>--logtostderr=true</code> 或 <code>--alsologtostderr=true</code> 不生效)。 </p></td> </tr>
<tr> <td colspan="2">-v, --v int</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
设置日志级别详细程度的数值。 </p></td> </tr>
<tr> <td colspan="2">--version version[=true]</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"> <p>
--version, --version=raw 打印版本信息并退出; --version=vX.Y.Z... 设置报告的版本。 </p> </td> </tr>
<tr> <td colspan="2">--vmodule pattern=N,...</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"> <p>
以逗号分割的 pattern=N 设置的列表,用于文件过滤日志(仅适用于文本日志格式) </p> </td> </tr>
<tr> <td colspan="2">--write-config-to string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
如果设置,将默认配置信息写入此文件并退出。 </p> </td> </tr>
</tbody> </table>
来源:Kubernetes 文档贡献者 · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
