Question-76:  How are resources referred in Kubernetes?

Answer: Everything in Kubernetes is referred by a RESTful resource and you can say these are Kubernetes objects. And each Kubernetes object exists on unique http path.

Question-77: How kubectl command line utility interacts with Kubernetes objects?

Answer: Each kubectl command interact with RESTful resource and makes an http request to the RESTful URLs and interact with Kubernetes objects.

Question-78: Can you please explain the “kubectl” get command?

Answer: get is one the most commonly used command in kubectl. If you re a command like

“kubectl get resource-name”

It will return you the listing of all resources in the current namespace. And if we need to access any specific object then we have to use command as

“kubectl get resource-name object-name”

Question-79: Which query kubectl uses?

Answer: If you want to extract specific path from object than you can use JSONPath query language. And this will help you to select specific fields from an object. See example below

 “kubectl get pods he-pod -o jsonpath ==template={.status.podIP}”

In above example it would extract the IP address for “he=pod” and print it.

Question-80: How are the objects represent by Kubernetes API?

Answer: Kubernetes API represent all objects in either JSON or YAML files. These files are either returned by the server in response to query or posted to the server as part of an API request. And using YAML or JSOM you can either create, update, or delete the Kubernetes objects on the cluster.