kubelet

command
v0.0.0-...-0ea9430 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 9 Imported by: 0

README

kubelet flag scraping

This is a quick way to generate a list of valid flags for a given kubelet version.

When started with -v=1 --container-runtime-endpoint=unix:///var/run/containerd/containerd.sock kubelet will print out a list of valid flags and will run in "standalone mode" without an apiserver (i.e., it will not crash).

We abuse this to start it for 1 second, scrape the output, and then kill it.

We use a regex on the output to extract all flags, converting them to key/value pairs.

The list of keys in that map is the valid set of flags for that kubelet version.

Since the test only takes 1-2 seconds, we can run it for every kubelet version we want to support.

The current code only runs one version.

Current output:

map[string]string{
  "--add-dir-header": "\"false\"",
  "--address": "\"0.0.0.0\"",
  "--allowed-unsafe-sysctls": "\"[]\"",
  "--alsologtostderr": "\"false\"",
  "--anonymous-auth": "\"true\"",
  "--application-metrics-count-limit": "\"100\"",
  "--authentication-token-webhook": "\"false\"",
  "--authentication-token-webhook-cache-ttl": "\"2m0s\"",
  "--authorization-mode": "\"AlwaysAllow\"",
  "--authorization-webhook-cache-authorized-ttl": "\"5m0s\"",
  "--authorization-webhook-cache-unauthorized-ttl": "\"30s\"",
  "--azure-container-registry-config": "\"\"",
  "--boot-id-file": "\"/proc/sys/kernel/random/boot_id\"",
  "--bootstrap-kubeconfig": "\"\"",
  "--cert-dir": "\"/var/lib/kubelet/pki\"",
  "--cgroup-driver": "\"cgroupfs\"",
  "--cgroup-root": "\"\"",
  "--cgroups-per-qos": "\"true\"",
  "--client-ca-file": "\"\"",
  "--cloud-config": "\"\"",
  "--cloud-provider": "\"\"",
  "--cluster-dns": "\"[]\"",
  "--cluster-domain": "\"\"",
  "--config": "\"\"",
  "--container-hints": "\"/etc/cadvisor/container_hints.json\"",
  "--container-log-max-files": "\"5\"",
  "--container-log-max-size": "\"10Mi\"",
  "--container-runtime": "\"remote\"",
  "--container-runtime-endpoint": "\"unix:///var/run/containerd/containerd.sock\"",
  "--containerd": "\"/run/containerd/containerd.sock\"",
  "--containerd-namespace": "\"k8s.io\"",
  "--contention-profiling": "\"false\"",
  "--cpu-cfs-quota": "\"true\"",
  "--cpu-cfs-quota-period": "\"100ms\"",
  "--cpu-manager-policy": "\"none\"",
  "--cpu-manager-policy-options": "\"\"",
  "--cpu-manager-reconcile-period": "\"10s\"",
  "--enable-controller-attach-detach": "\"true\"",
  "--enable-debugging-handlers": "\"true\"",
  "--enable-load-reader": "\"false\"",
  "--enable-server": "\"true\"",
  "--enforce-node-allocatable": "\"[pods]\"",
  "--event-burst": "\"10\"",
  "--event-qps": "\"5\"",
  "--event-storage-age-limit": "\"default=0\"",
  "--event-storage-event-limit": "\"default=0\"",
  "--eviction-hard": "\"imagefs.available<15%,memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%\"",
  "--eviction-max-pod-grace-period": "\"0\"",
  "--eviction-minimum-reclaim": "\"\"",
  "--eviction-pressure-transition-period": "\"5m0s\"",
  "--eviction-soft": "\"\"",
  "--eviction-soft-grace-period": "\"\"",
  "--exit-on-lock-contention": "\"false\"",
  "--experimental-allocatable-ignore-eviction": "\"false\"",
  "--experimental-mounter-path": "\"\"",
  "--fail-swap-on": "\"true\"",
  "--feature-gates": "\"\"",
  "--file-check-frequency": "\"20s\"",
  "--global-housekeeping-interval": "\"1m0s\"",
  "--hairpin-mode": "\"promiscuous-bridge\"",
  "--healthz-bind-address": "\"127.0.0.1\"",
  "--healthz-port": "\"10248\"",
  "--help": "\"false\"",
  "--hostname-override": "\"\"",
  "--housekeeping-interval": "\"10s\"",
  "--http-check-frequency": "\"20s\"",
  "--image-credential-provider-bin-dir": "\"\"",
  "--image-credential-provider-config": "\"\"",
  "--image-gc-high-threshold": "\"85\"",
  "--image-gc-low-threshold": "\"80\"",
  "--image-service-endpoint": "\"\"",
  "--iptables-drop-bit": "\"15\"",
  "--iptables-masquerade-bit": "\"14\"",
  "--kernel-memcg-notification": "\"false\"",
  "--kube-api-burst": "\"10\"",
  "--kube-api-content-type": "\"application/vnd.kubernetes.protobuf\"",
  "--kube-api-qps": "\"5\"",
  "--kube-reserved": "\"\"",
  "--kube-reserved-cgroup": "\"\"",
  "--kubeconfig": "\"\"",
  "--kubelet-cgroups": "\"\"",
  "--local-storage-capacity-isolation": "\"true\"",
  "--lock-file": "\"\"",
  "--log-backtrace-at": "\":0\"",
  "--log-cadvisor-usage": "\"false\"",
  "--log-dir": "\"\"",
  "--log-file": "\"\"",
  "--log-file-max-size": "\"1800\"",
  "--log-flush-frequency": "\"5s\"",
  "--log-json-info-buffer-size": "\"0\"",
  "--log-json-split-stream": "\"false\"",
  "--logging-format": "\"text\"",
  "--logtostderr": "\"true\"",
  "--machine-id-file": "\"/etc/machine-id,/var/lib/dbus/machine-id\"",
  "--make-iptables-util-chains": "\"true\"",
  "--manifest-url": "\"\"",
  "--manifest-url-header": "\"\"",
  "--master-service-namespace": "\"default\"",
  "--max-open-files": "\"1000000\"",
  "--max-pods": "\"110\"",
  "--maximum-dead-containers": "\"-1\"",
  "--maximum-dead-containers-per-container": "\"1\"",
  "--memory-manager-policy": "\"None\"",
  "--minimum-container-ttl-duration": "\"0s\"",
  "--minimum-image-ttl-duration": "\"2m0s\"",
  "--node-ip": "\"\"",
  "--node-labels": "\"\"",
  "--node-status-max-images": "\"50\"",
  "--node-status-update-frequency": "\"10s\"",
  "--one-output": "\"false\"",
  "--oom-score-adj": "\"-999\"",
  "--pod-cidr": "\"\"",
  "--pod-infra-container-image": "\"registry.k8s.io/pause:3.8\"",
  "--pod-manifest-path": "\"\"",
  "--pod-max-pids": "\"-1\"",
  "--pods-per-core": "\"0\"",
  "--port": "\"10250\"",
  "--protect-kernel-defaults": "\"false\"",
  "--provider-id": "\"\"",
  "--qos-reserved": "\"\"",
  "--read-only-port": "\"10255\"",
  "--register-node": "\"true\"",
  "--register-schedulable": "\"true\"",
  "--register-with-taints": "\"\"",
  "--registry-burst": "\"10\"",
  "--registry-qps": "\"5\"",
  "--reserved-cpus": "\"\"",
  "--reserved-memory": "\"\"",
  "--resolv-conf": "\"/etc/resolv.conf\"",
  "--root-dir": "\"/var/lib/kubelet\"",
  "--rotate-certificates": "\"false\"",
  "--rotate-server-certificates": "\"false\"",
  "--runonce": "\"false\"",
  "--runtime-cgroups": "\"\"",
  "--runtime-request-timeout": "\"2m0s\"",
  "--seccomp-default": "\"false\"",
  "--serialize-image-pulls": "\"true\"",
  "--skip-headers": "\"false\"",
  "--skip-log-headers": "\"false\"",
  "--stderrthreshold": "\"2\"",
  "--storage-driver-buffer-duration": "\"1m0s\"",
  "--storage-driver-db": "\"cadvisor\"",
  "--storage-driver-host": "\"localhost:8086\"",
  "--storage-driver-password": "\"root\"",
  "--storage-driver-secure": "\"false\"",
  "--storage-driver-table": "\"stats\"",
  "--storage-driver-user": "\"root\"",
  "--streaming-connection-idle-timeout": "\"4h0m0s\"",
  "--sync-frequency": "\"1m0s\"",
  "--system-cgroups": "\"\"",
  "--system-reserved": "\"\"",
  "--system-reserved-cgroup": "\"\"",
  "--tls-cert-file": "\"\"",
  "--tls-cipher-suites": "\"[]\"",
  "--tls-min-version": "\"\"",
  "--tls-private-key-file": "\"\"",
  "--topology-manager-policy": "\"none\"",
  "--topology-manager-scope": "\"container\"",
  "--v": "\"1\"",
  "--version": "\"false\"",
  "--vmodule": "\"\"",
  "--volume-plugin-dir": "\"/usr/libexec/kubernetes/kubelet-plugins/volume/exec/\"",
  "--volume-stats-agg-period": "\"1m0s\"",
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL