Kubelet – Unofficial Kubernetes – Read the Docs

kubelet

Synopsis

The kubelet is the main “node agent” that runs on each node. The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms (mainly through the apiserver) and ensures that the containers described in those PodSpecs are working and healthy. The kubelet does not manage containers that were not created by Kubernetes.

Aside from a PodSpec, there are three ways you can provide a container manifest to the Kubelet from the apiserver.

File: Path passed as a command line prompt. This file is checked again every 20 seconds (configurable with an indicator).

HTTP

endpoint: HTTP endpoint passed as a parameter on the command line. This endpoint is checked every 20 seconds (also configurable with an indicator).

HTTP

server: The kubelet can also listen for HTTP requests and respond to a simple API call to send a new manifest.

kubelet

Options

-address ip The IP address for the Kubelet to serve (set to 0.0.0.0 for all interfaces) (default 0.0.0.0) -allow-privileged If true, allow containers to request privileged mode. [default=false] -anonymous-auth Enables anonymous requests to the Kubelet server. Requests that are not rejected by another authentication method are treated as anonymous requests. Anonymous requests have a user name of system:anonymous and a group name of system:unauthenticated. (default true) -authentication-token-webhook Use the TokenReview API to determine authentication for bearer tokens. -authentication-token-webhook-cache-ttl duration The duration for caching responses from the webhook token authenticator. (default 2m0s) -authorization-mode string Authorization mode for Kubelet server. Valid options are AlwaysAllow or Webhook. Webhook mode uses the SubjectAccessReview API to determine authorization. (default “AlwaysAllow”) -authorization-webhook-cache-authorized-ttl duration The duration for caching ‘authorized’ responses from the webhook authorizer. (default 5m0s) -authorization-webhook-cache-unauthorized-ttl duration The duration for caching ‘unauthorized’ responses from the webhook authorizer. (default 30s) -azure-container-registry-config string Path to file container Azure container registry configuration information. -cadvisor-port int32 The endpoint port cAdvisor localhost (default 4194) -cert-dir string The directory where the TLS certificates are located (by default /var/run/kubernetes). If -tls-cert-file and -tls-private-key-file are provided, this flag will be ignored. (default “/var/run/kubernetes”) -cgroup-driver string Driver that the kubelet uses to manipulate cgroups on the host. Possible values: ‘cgroupfs’, ‘systemd’ (default “cgroupfs”) -cgroup-root string Cgroup root optional to use for pods. This is handled by the container runtime on a best effort basis. Default: ”, which means using the container runtime default. -cgroups-per-qos Enable the creation of the QoS cgroup hierarchy, if true pod cgroups and top-level QoS are created. [Default: True] (default true) -chaos-chance float If > 0.0, enter random client errors and latency. Intended for testing. [default=0.0] -client-ca-file string If set, any request that presents a client certificate signed by one of the authorities in the client-ca-file file is authenticated with an identity corresponding to the CommonName of the client certificate. -cloud-config string The path to the cloud provider configuration file. Empty string for no configuration file. -cloud-provider string The cloud service provider. By default, kubelet will try to automatically detect the cloud provider. Specify the empty string to run without a cloud provider. [default=auto-detect] (default “auto-detect”) -cluster-dns stringSlice Comma-separated list of the IP address of the DNS server. This value is used for the container DNS server for Pods with “dnsPolicy=ClusterFirst”. Note: All DNS servers listed MUST serve the same set of records, otherwise name resolution within the cluster may not work correctly. There is no guarantee as to which DNS server can be contacted for name resolution. -cluster-domain string Domain for this cluster. If set, kubelet will configure all containers to search this domain in addition to the string -cni-bin-dir of the host’s search domains <Warning: alpha function> The full path of the directory in which to search for CNI plugin binaries. Default: string /opt/cni/bin -cni-conf-dir <Warning: alpha function> The full path of the directory in which the CNI configuration files are searched. Default: /etc/cni/net.d -container-runtime string The runtime of the container to use. Possible values: ‘docker’, ‘rkt’. Default: ‘docker’. (default “docker”) -container-runtime-endpoint string [Experimental] The unix socket endpoint of the remote runtime service. The endpoint is only used when CRI integration is enabled (-enable-cri) -containerized Experimental support for running kubelet in a container. Intended for testing. [default=false] -contention-profiling Enable lock containment profiling, if profiling is enabled -cpu-cfs-quota Enable enforcement of CPU CFS quotas for containers that specify CPU limits (default true) -docker-endpoint string Use this option to have the Docker endpoint communicate with (default “unix:///var/run/docker.sock”) -enable-controller-attach-detach Allows the Attach/Detach controller to manage The connection/separation of scheduled volumes for this node, and disables Kubelet to execute any attachment/detach operations (true default) -enable-custom-metrics Support for collecting custom metrics. -enable-debugging-handlers Enables server endpoints for log collection and local execution of containers and commands (true default) -enable-server Enable Kubelet server’s (true default) -enforce-node-allocatable stringSlice A comma-separated list of node assignable application tiers that Kubelet should apply. Acceptable options are ‘pods’, ‘system-reserved’ and ‘kube-reserved’. If the last two options are specified, ‘-system-reserved-cgroup’ and ‘-kube-reserved-cgroup’ must also be set respectively. See https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node-allocatable.md for details. [default=’pods’] (default [pods]) -event-burst int32 Maximum size of burst event logs, temporarily allows event logs to shoot to this number, without exceeding qps-events. Used only if -event-qps > 0 (default value 10) -event-qps int32 If > 0, limit event creations per second to this value. If 0, unlimited. (default 5) -eviction-hard string A set of eviction thresholds (for example, memory.available<1Gi) that, if met, would trigger a pod eviction. (default “memory.available<100Mi”) -eviction-max-pod-grace-period int32 Maximum allowable grace period (in seconds) to use when terminating pods in response to a soft eviction threshold that is met. If negative, defer to the specified pod value. -eviction-minimum-reclaim string A set of minimum claims (for example, imagefs.available=2Gi) that describes the minimum amount of resources the kubelet will claim when performing a pod eviction if that resource is under pressure. -eviction-pressure-transition-period duration Duration for which the kubelet has to wait before exiting an eviction pressure condition. (default 5m0s) -eviction-soft string A set of eviction thresholds (for example, memory.available<1.5Gi) that, if met during a corresponding grace period, would trigger a pod eviction. -eviction-soft-grace-period string A set of eviction grace periods (for example, memory.available=1m30s) that correspond to how long a soft eviction threshold must be maintained before triggering a pod eviction. -exit-on-lock-contention If kubelet should exit after lock file contention. -experimental-allocatable-ignore-eviction When set to ‘true’, hard eviction thresholds will be ignored when calculating Alcatable Node. See https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node-allocatable.md for details. [default=false] -experimental-allowed-unsafe-sysctls stringSlice Comma-separated whitelist of unsafe sysctls or unsafe sysctl patterns (ending in *). Use them at your own risk. -experimental-bootstrap-kubeconfig string <Warning: Experimental feature> Path to a kubeconfig file that will be used to obtain the client certificate for kubelet. If the file specified by -kubeconfig does not exist, the kubeconfig boot is used to request a client certificate from the API server. If successful, a kubeconfig file that references the generated key and the obtained certificate is written to the path specified by -kubeconfig. The certificate and key file will be stored in the directory designated by -cert-dir. -experimental-check-node-capabilities-before-mount [Experimental] if true is set, the kubelet will check the underlying node for required components (binaries, etc.) before mounting -experimental-fail-swap-on Causes the Kubelet not to start if swapping is enabled on the node. This is a temporary option to maintain the legacy behavior, failing because the exchange enabled will occur by default in v1.6. -experimental-kernel-memcg-notification If enabled, the kubelet will integrate with the kernel’s memcg notification to determine whether memory eviction thresholds are crossed instead of polling. -experimental-mounter-path string [Experimental] Path of the assembler binary. Leave empty to use the default mount. -experimental-qos-reserved mapStringString A set of ResourceName=Percentage pairs (for example, memory=50%) that describe how pod resource requests are reserved at the QoS level. Only memory is currently supported. [default=none] -feature-gates string A set of key=value pairs that describe feature gates for alpha/experimental entities. The options are: Accelerators=true|false (ALPHA – default=false) AffinityInAnnotations=true|false (ALPHA – default=false) AllAlpha=true|false (ALPHA – default=false) AllowExtTrafficLocalEndpoints=true|false (BETA – default=true) AppArmor=true|false (BETA – default=true) DynamicKubeletConfig=true|false (ALPHA – default=false) DynamicVolumeProvisioning=true|false (ALPHA – default=true) ExperimentalCriticalPodAnnotation=true|false (ALPHA – default=false) ExperimentalHostUserNamespaceDefaulting=true|false (BETA – default=false) StreamingProxyRedirects=true|false (BETA – default=true) TaintBasedEvictions=true|false (ALPHA – default=false) -file-check-frequency duration Duration between checking configuration files for new data (default 20s) -google-json-key string The JSON key of the Google Cloud Platform service account to use for authentication. -hairpin-mode string How should the kubelet configure the NAT fork? This allows the endpoints of a Service to rebalance the load if they attempt to access their own Service. Valid values are “promiscuous-bridge”, “hairpin-veth”, and “none”. (default “promiscuous-bridge”) -healthz-bind-address ip The IP address for the healthz server to serve, by default to 127.0.0.1 (set to 0.0.0.0 for all interfaces) (default 127.0.0.1) -healthz-port int32 The endpoint port localhost healthz (default 10248) -host-ipc-sources stringSlice List of comma-separated sources from which Kubelet allows pods to use the host ipc namespace. [default=”*”] (default [*]) -host-network-sources stringSlice List of comma-separated sources from which Kubelet allows pods to use the host network. [default=”*”] (default [*]) -host-pid-sources stringSlice List of comma-separated fonts from which Kubelet allows pods to use the pid host namespace. [default=”*”] (default [*]) -hostname-override string If it is not empty, it will use this string as identification instead of the actual host name. -http-check-frequency duration Duration between http check for new data (default 20s) -image-gc-high-threshold int32 The percentage of disk usage after which garbage collection of images is always run. Default: 90% (default 90) -image-gc-low-threshold int32 The percentage of disk usage before which garbage collection of images never runs. Reduced disk usage to collect garbage. Default: 80% (default 80) -image-pull-progress-deadline duration If no extraction progress is made before this deadline, the image extraction will be canceled. Default: 1m0s. (default 1m0s) -image-service-endpoint string [Experimental] The unix socket endpoint of the remote image service. If not specified, it will be the same with container-runtime-endpoint by default. The endpoint is only used when CRI integration is enabled (-enable-cri) -iptables-drop-bit int32 The fwmark space bit to mark packets for discarding. It must be within the range [0, 31]. (default 15) -iptables-masquerade-bit int32 The fwmark space bit for marking packets for SNAT. It must be within the range [0, 31]. Match this parameter to the corresponding parameter in kube-proxy. (default 14) -keep-terminated-pod-volumes Keep the finished pod volumes mounted on the node after the pod terminates. It can be useful for debugging volume-related issues. -kube-api-burst int32 Burst to use while talking to kubernetes apiserver (default 10) -kube-api-content-type string Content type of requests sent to apiserver. (default “application/vnd.kubernetes.protobuf”) -kube-api-qps int32 QPS for use while talking with kubernetes apiserver (default 5) -kube-reserved mapStringString A set of ResourceName=ResourceQuantity pairs (for example, cpu=200m,memory=150G) that describe the resources reserved for kubernetes system components. Only CPUs and memory are currently supported. See http://kubernetes.io/docs/user-guide/compute-resources for details. [default=none] -kube-reserved-cgroup string The absolute name of the top-level cgroup used to manage kubernetes components for which compute resources were reserved using the ‘-kube-reserved’ flag. Ex. ‘/kube-reserved’. [default=”] -kubeconfig string Path to a kubeconfig file, specifying how to connect to the API server. -api-servers will be used for the location unless -require-kubeconfig is set. (default “/var/lib/kubelet/kubeconfig”) -kubelet-cgroups string Optional absolute name of cgroups to create and run Kubelet on. -lock-file string <Warning: Alpha feature> The path to the file for kubelet to use as a lock file. -make-iptables-util-chains If true, kubelet will ensure that iptables utility rules are present on the host. (default true) -manifest-url string URL to access the manifest container -manifest-url-header string HTTP header to use when accessing the manifest URL, with the key separated from the value with a ‘:’, as in ‘key:value’ -master-service-namespace string The namespace from which to inject kubernetes master services into pods (default “default”) -max-open-files int Number of files that can be opened using the Kubelet process. [default=1000000] (default 1000000) -max-pods int32 Number of Pods that can be run on this Kubelet. (default 110) -minimum-image-ttl-duration duration The minimum age of an unused image before it is collected as junk. Examples: ‘300ms’, ’10s’ or ‘2h45m’. Default: ‘2m’ (default 2m0s) -network-plugin string <Warning: Alpha feature> The name of the network plugin to be invoked for various events in kubelet/pod lifecycle -network-plugin-dir string <Warning: Alpha feature> The full path of the directory in which to search for network plug-ins or CNI config -network-plugin-mtu int32 <Warning: Alpha feature> The MTU to be passed to the network plugin, to override the default. Set to 0 to use the default MTU of 1460. -node-ip string IP address of the node. If set, kubelet will use this IP address for the -node-labels mapStringString node <Warning: alpha function> Tags to add when registering the node with the cluster. Tags must be key=value pairs separated by ‘,’. -node-status-update-frequency duration Specifies how often kubelet publishes the state of the node to master. Note: be careful when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller. Default: 10s (default 10s) -non-masquerade-cidr string Traffic to IP outside this range will use IP maskade. (default “10.0.0.0/8”) -oom-score-adj int32 The oom-score-adj value for the kubelet process. Values must be within the range [-1000, 1000] (default -999) -pod-cidr string The CIDR to be used for pod IP addresses is only used in standalone mode. In cluster mode, this is obtained from the master. -pod-infra-container-image string The image whose network/ipc namespaces will be used by the containers in each pod. (default “gcr.io/google_containers/pause-amd64:3.0”) -pod-manifest-path string The path to the directory that contains the pod manifest files to run or the path to a single pod manifest file. Files that begin with periods will be ignored. -pods-per-core int32 Number of Pods per core that can be run on this Kubelet. The total number of Pods in this Kubelet cannot exceed the max-pods, so max-pods will be used if this calculation results in a higher number of Pods allowed in the Kubelet. A value of 0 disables this limit. -port int32 The port for the Kubelet to serve. (default 10250) -protect-kernel-defaults Default kubelet behavior for kernel tuning. If set, kubelet fails if any of the kernel tunable is different from the kubelet defaults. -read-only-port int32 The read-only port for the Kubelet to be served without authentication/authorization (set to 0 to disable) (default 10255) -really-crash-for-testing If true, when panics occur they are blocked. Intended for testing. -register-node Register the node with the apiserver (default is true if -api-servers is set) -register-with-taints []api. Taint Register the node with the given blob list (by commas “<key>=<value>:<effect>”). No-op si register-node is false. -registry-burst int32 Maximum size of a bursty pulls, temporarily allows pulls to stall to this number, without exceeding registry-qps. Used only if -registry-qps > 0 (default value 10) -registry-qps int32 If > 0, limit the extraction of QPS from the registry to this value. If 0, unlimited. [default=5.0] (default value 5) -require-kubeconfig If true, Kubelet will close if there are configuration errors and ignore the value of -api-servers in favor of the server defined in the kubeconfig file. -resolv-conf string Resolution configuration file used as the basis for container DNS resolution configuration. (default “/etc/resolv.conf”) -rkt-api-endpoint string The endpoint of the rkt API service to communicate with. Used only if -container-runtime=’rkt’. (default “localhost:15441”) -rkt-path string Path of the rkt binary. Leave empty to use the first rkt in $PATH. Used only if -container-runtime=’rkt’. -root-dir string Directory path for managing kubelet files (volume mounts, etc.). (default “/var/lib/kubelet”) -runonce If true, exit after generating pods from local manifests or remote URLs. Exclusive with -api-servers and -enable-server -runtime-cgroups string Optional absolute name of cgroups to create and run the runtime. -runtime-request-timeout duration Timeout of all runtime requests except the long execution request: pull, logs, exec, and attach. When the timeout is exceeded, kubelet will cancel the request, delete an error, and try again later. Default: 2m0s (default 2m0s) -seccomp-profile-root string Directory path for seccomp profiles. (default “/var/lib/kubelet/seccomp”) -serialize-image-pulls Extract images one at a time. We recommend *not* changing the default value on nodes running the docker daemon with version < 1.9 or an Aufs storage backend. Issue #10959 has more details. [default=true] (default true) -streaming-connection-idle-timeout duration duration The maximum time that a streaming connection can be idle before the connection is automatically closed. 0 indicates that the timeout has not expired. Example: ‘5m’ (default 4h0m0s) -sync-frequency duration Maximum period between running container synchronization and config (default 1m0s) -system-cgroups / Optional absolute name of cgroups in which to place all non-kernel processes that are not already inside a cgroup under /. Empty so there is no container. Reverting the flag requires a reset. (Default: “”). -system-reserved mapStringString A set of ResourceName=ResourceQuantity pairs (for example, cpu=200m, memory=150G) that describe resources reserved for non-kubernetes components. Only CPUs and memory are currently supported. See http://kubernetes.io/docs/user-guide/compute-resources for details. [default=none] -system-reserved-cgroup string The absolute name of the top-level cgroup used to manage non-Kubernetes components for which compute resources were reserved using the ‘-system-reserved’ flag. Ex. ‘/system-reserved’. [default=”] -tls-cert-file string File that contains the x509 certificate for HTTPS. (CA certificate, if any, concatenated after the server certificate.) If -tls-cert-file and -tls-private-key-file are not provided, a self-signed certificate and key for the public address are generated and saved in the directory passed to -cert-dir. -tls-private-key-file string File containing x509 private key matching -tls-cert-file. -volume-plugin-dir string <Warning: Alpha feature> The full path of the directory in which to search for additional third-party volume plugins (default “/usr/libexec/kubernetes/kubelet-plugins/volume/exec/”) -volume-stats-agg-period duration Specifies the interval for kubelet to calculate and cache volume disk usage for all pods and volumes. To disable volume calculations, set to 0. Default: ‘1m’ (default 1m0s)

Auto-generated by spf13/cobra on 21-Mar-2017