Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubectl command to figure out Linux distro and version

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...

like image 903
mhyousefi Avatar asked Oct 23 '25 11:10

mhyousefi


1 Answers

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
like image 88
DT. Avatar answered Oct 26 '25 17:10

DT.