Skip to main content

Crate env_inspector

Crate env_inspector 

Source
Expand description

Detect whether the current process runs in Kubernetes, a container, a VM, or on bare metal.

Enums§

EnvScope
Detected environment scope.

Functions§

detect_scope
Perform detection in this order: 0) Kubernetes
is_kubernetes
Returns true if we’re in a Kubernetes Pod (via env‐var or serviceaccount token).
parse_container
Try to identify container via files or cgroup.
parse_vm_cpuinfo
Detect “hypervisor” flag in /proc/cpuinfo.
parse_vm_dmi_field
Try to identify VM via DMI (/sys/class/dmi/id/{product_name,sys_vendor}).