I'm running kubernetes 1.8.5 and was wondering if there is a way to tell the Kubelet to monitor /var/lib/docker instead of / on the host.
According to the Kubelet documentation page:
Other than from a PodSpec from the apiserver, there are three ways that a container manifest can be provided to the Kubelet.
File: Path passed as a flag on the command line. Files under this path will be monitored periodically for updates. The monitoring period is 20s by default and is configurable via a flag.
HTTP endpoint: HTTP endpoint passed as a parameter on the command line. This endpoint is checked every 20 seconds (also configurable with a flag).
HTTP server: The kubelet can also listen for HTTP and respond to a simple API (underspec’d currently) to submit a new manifest.
It is not quite clear what do you mean by "monitoring", so here is a list of all path-related command line arguments to the Kubelet binary:
--boot-id-file stringComma-separated list of files to check for boot-id. Use the first one that exists. (default "/proc/sys/kernel/random/boot_id")
--bootstrap-checkpoint-path stringPath to the directory where the checkpoints are stored
--bootstrap-kubeconfig stringPath to akubeconfigfile that will be used to get client certificate for kubelet. If the file specified by--kubeconfigdoes not exist, the bootstrapkubeconfigis used to request a client certificate from the API server. On success, akubeconfigfile referencing the generated client certificate and key is written to the path specified by--kubeconfig. The client certificate and key file will be stored in the directory pointed by--cert-dir.
--cert-dir stringThe directory where the TLS certs are located. If--tls-cert-fileand--tls-private-key-fileare provided, this flag will be ignored. (default/var/lib/kubelet/pki)
--cloud-config stringThe path to the cloud provider configuration file.
--cni-bin-dir stringThe full path of the directory in which to search for CNI plugin binaries. Default:/opt/cni/bin
--cni-conf-dir stringThe full path of the directory in which to search for CNI config files. Default:/etc/cni/net.d
--container-hints stringlocation of the container hints file (default/etc/cadvisor/container_hints.json)
--docker-tls-ca stringpath to trusted CA (defaultca.pem)
--docker-tls-cert stringpath to client certificate (defaultcert.pem)
--docker-tls-key stringpath to private key (defaultkey.pem)
--dynamic-config-dir stringThe Kubelet will use this directory for checkpointing downloaded configurations and tracking configuration health. The Kubelet will create this directory if it does not already exist. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Providing this flag enables dynamic Kubelet configuration. Presently, you must also enable theDynamicKubeletConfigfeature gate to pass this flag.
--experimental-mounter-path string[Experimental] Path of mounter binary. Leave empty to use the default mount.
--init-config-dir stringThe Kubelet will look in this directory for the init configuration. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this argument to use the built-in default configuration values. Presently, you must also enable theKubeletConfigFilefeature gate to pass this flag.
--kubeconfig stringPath to a kubeconfig file, specifying how to connect to the API server. (default/var/lib/kubelet/kubeconfig)
--lock-file stringThe path to file for kubelet to use as a lock file.
--log-dir stringIf non-empty, write log files in this directory
--pod-manifest-path stringPath to the directory containing pod manifest files to run, or the path to a single pod manifest file. Files starting with dots will be ignored.
--resolv-conf stringResolver configuration file used as the basis for the container DNS resolution configuration. (default/etc/resolv.conf)
--rkt-path stringPath of rkt binary. Leave empty to use the first rkt in $PATH.
--root-dir stringDirectory path for managing kubelet files (volume mounts,etc). (default/var/lib/kubelet)
--seccomp-profile-root stringDirectory path for seccomp profiles. (default/var/lib/kubelet/seccomp)
--tls-cert-file stringFile containing x509 Certificate used for serving HTTPS (with intermediate certs, if any, concatenated after server cert). If--tls-cert-fileand--tls-private-key-fileare not provided, a self-signed certificate and key are generated for the public address and saved to the directory passed to--cert-dir.
--tls-private-key-file stringFile containing x509 private key matching--tls-cert-file.
You can set the Kubelet configuration by providing a config file with the --config parameter during the Kubelet start.
To modify existing Kubelet parameters(CentOS example):
Restart the Kubelet:
systemctl daemon-reload
systemctl restart kubelet