Documentation
¶
Overview ¶
Package cadvisorflags is the single source of truth for the names of the cAdvisor global flags that the Kubernetes kubelet re-registers on its own command line (see cmd/kubelet/app/options/globalflags_linux.go).
Background: cAdvisor registers a number of flags on the process-global flag.CommandLine via package init(). The kubelet does not want all of them, so it looks a chosen subset up BY NAME and re-registers them on its own pflag set. Historically those names were string literals in the kubelet, so removing or renaming a flag in this library turned into a kubelet STARTUP PANIC ("failed to find flag in global flagset") rather than a build error.
Centralizing the names here gives one place to keep in sync, and the contract test in this package (flags_contract_test.go) asserts that every name below still resolves to a registered flag — so drift becomes a failing test in this repo instead of a panic in the consumer. The flag DEFINITIONS elsewhere in the tree intentionally keep their string literals; the contract test is what binds them to these constants.
Index ¶
Constants ¶
const ( // HousekeepingInterval is kept as a normal kubelet flag (node e2e relies on it). HousekeepingInterval = "housekeeping_interval" // The remainder are vestigial cAdvisor flags the kubelet exposes only as // deprecated, for backwards compatibility with existing command lines. ApplicationMetricsCountLimit = "application_metrics_count_limit" BootIDFile = "boot_id_file" ContainerHints = "container_hints" Containerd = "containerd" EnableLoadReader = "enable_load_reader" EventStorageAgeLimit = "event_storage_age_limit" EventStorageEventLimit = "event_storage_event_limit" GlobalHousekeepingInterval = "global_housekeeping_interval" LogCadvisorUsage = "log_cadvisor_usage" MachineIDFile = "machine_id_file" StorageDriverUser = "storage_driver_user" StorageDriverPassword = "storage_driver_password" StorageDriverHost = "storage_driver_host" StorageDriverDB = "storage_driver_db" StorageDriverTable = "storage_driver_table" StorageDriverSecure = "storage_driver_secure" StorageDriverBufferDuration = "storage_driver_buffer_duration" ContainerdNamespace = "containerd-namespace" )
Names of the cAdvisor global flags the kubelet pins. Keep this list in sync with the flag definitions across the manager, machine, container/common, container/containerd, and storage packages; the contract test enforces it.
Variables ¶
This section is empty.
Functions ¶
func Deprecated ¶
func Deprecated() []string
Deprecated returns the cAdvisor flag names the kubelet should expose but mark deprecated. These were historically registered with the kubelet by accident and are retained only to avoid breaking existing command lines.
Types ¶
This section is empty.