IBM Support

Netstat and ifconfig command not found in a specific pod

Question & Answer


Question

The netstat and ifconfig commands give the error "command not found" when executed in a specific pod.
example:
[root@teari1 ~]# kubectl get pods -o wide
NAME                                 READY     STATUS    RESTARTS   AGE       IP            NODE
rk-db2ese-d86877c5c-pq5hd        1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-impactgui-8458db86ff-nkk47    1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-jdbcgw-8698784ff4-kwfgd       1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-ncibackup-7d6688fd8b-5q5zm    1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-nciprimary-7f9f879646-twkcv   1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-ncobackup-6fdc5c47ff-9gwqg    2/2       Running   1          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-ncoprimary-c5f68b4f-hdfvk     1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-openldap-65f4db65c7-pztt5     1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-scala-55f784c6fc-xbncq        2/2       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx
rk-webgui-648f4bcc74-7b8bp       1/1       Running   0          41m       xx.xx.xx.xx    xx.xx.xx.xx.xx

[root@teari1 ~]# kubectl exec -it rk-webgui-648f4bcc74-7b8bp /bin/bash

netcool@rk-webgui:~$ netstat -an | more
bash: netstat: command not found
netcool@rk-webgui:~$ ifconfig
bash: ifconfig: command not found

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSBS6K","label":"IBM Cloud Private"},"Component":"pod","Platform":[{"code":"PF031","label":"Ubuntu"}],"Version":"3.1.0","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
10 August 2022

UID

ibm10869566