Kubectl command to figure out Linux distro and version

1/21/2020

Is there a Kubectl command to figure out the following info about a Pod?

  1. The installed Linux distribution

  2. The OS version

Let's say you don't really have a good deal of info about the image with which a Deployment or a Pod has been created...

-- mhyousefi
kubectl
kubernetes

1 Answer

1/21/2020

Something as simple as this using exec will result the os details

$ kubectl exec -it nginx1 -- /bin/bash -c "cat /etc/os-release;uname -r"

Should result this

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
4.4.0-169-generic
-- DT.
Source: StackOverflow