Interacting with running Pods
- Viewing Logs of a Pod: The command shows the logs of the pod mentioned once the pod started.
$ kubectl logs [pod-name]
- Get an Interactive terminal for a pod: The command starts an interactive terminal of the Nginx pod so that we can control the pod directly through its terminal.
$ kubectl exec -it [pod-name] -- bin/bash
- Get info about a Resource: The command gives details about the nginx deployment
$ kubectl describe <resource_type> [resource-name]
Kubernetes – Kubectl Commands
Pre-requisites: Kubernetes
The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs. Some basic Kubectl commands in a Kubernetes cluster are as follows: