You are looking for IP address details of your Kubernetes nodes, but you are not sure what is a structure of node manifests. How can you find this details and learn more about the structure?
Experience Level: Medior
Tags: Kubernetes
Answer
Run the following command:
How it works?
- Using kubectl, details of nodes are displayed in yaml format
- Using grep command, rows are searched for string ip (case insensitive search), besides the row, block of 10 rows before and 10 rows after is displayed
- This allows you to quickly find key blocks in manifests when you don't know exactly what you are looking for. Based on the output you can further refine the query.
Related Kubernetes job interview questions
How do you find all pods that run on a master node?
Kubernetes MediorUsing kubectl, how do you convert yaml manifest of a specific pod pod1 to JSON format?
Kubernetes MediorHow can you display yaml details of all deployments, pods and services that are present in the current Kubernetes namespace?
Kubernetes JuniorHow can you display all objects that are present in the current Kubernetes namespace?
Kubernetes JuniorWithout kubectl, how do you display list of names of available Kubernetes contexts that you can use from the machine?
Kubernetes Junior