⎈ k8s knowledge compiler

Viewing Pods and Nodes [page]deterministic

tutorials

##

* Learn about Kubernetes Pods. * Learn about Kubernetes Nodes. * Troubleshoot deployed applications.

##

The shell commands in this tutorial use POSIX shell syntax, which is supported by the default shells on most Linux and macOS systems (for example, bash, zsh, or sh). Windows users must use a POSIX-compatible shell such as [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install) or [Git Bash](https://gitforwindows.org/) to run the commands as written. Commands that use `export`, `$()`, and similar constructs are not compatible with PowerShell or the Windows Command Prompt.

## Kubernetes Pods

_A Pod is a group of one or more application containers (such as Docker) and includes shared storage (volumes), IP address and information about how to run them._

When you created a Deployment in [Module 2](/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro/), Kubernetes created a Pod to host your application instance. A Pod is a Kubernetes abstraction that represents a group of one or more application containers (such as Docker), and some shared resources for those containers. Those resources include:

* Shared storage, as Volumes * Networking, as a unique cluster IP address * Information about how to run each container, such as the container image version or specific ports to use

A Pod models an application-specific "logical host" and can contain different application containers which are relatively tightly coupled. For example, a Pod might include both the container with your Node.js app as well as a different container that feeds the data to be published by the Node.js webserver. The containers in a Pod share an IP Address and port space, are always co-located and co-scheduled, and run in a shared context on the same Node.

Pods are the atomic unit on the Kubernetes platform. When we create a Deployment on Kubernetes, that Deployment creates Pods with containers inside them (as opposed to creating containers directly). Each Pod is tied to the Node where it is scheduled, and remains there until termination (according to restart policy) or deletion. In case of a Node failure, identical Pods are scheduled on other available Nodes in the cluster.

### Pods overview

![](/docs/tutorials/kubernetes-basics/public/images/module_03_pods.svg)

_Containers should only be scheduled together in a single Pod if they are tightly coupled and need to share resources such as disk._

## Nodes

A Pod always runs on a Node. A Node is a worker machine in Kubernetes and may be either a virtual or a physical machine, depending on the cluster. Each Node is managed by the control plane. A Node can have multiple pods, and the Kubernetes control plane automatically handles scheduling the pods across the Nodes in the cluster. The control plane's automatic scheduling takes into account the available resources on each Node.

Every Kubernetes Node runs at least:

* Kubelet, a process responsible for communication between the Kubernetes control plane and the Node; it manages the Pods and the containers running on a machine.

* A container runtime (like Docker) responsible for pulling the container image from a registry, unpacking the container, and running the application.

### Nodes overview

![](/docs/tutorials/kubernetes-basics/public/images/module_03_nodes.svg)

## Troubleshooting with kubectl

In [Module 2](/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro/), you used the kubectl command-line interface. You'll continue to use it in Module 3 to get information about deployed applications and their environments. The most common operations can be done with the following kubectl subcommands:

* `kubectl get` - list resources * `kubectl describe` - show detailed information about a resource * `kubectl logs` - print the logs from a container in a pod * `kubectl exec` - execute a command on a container in a pod

You can use these commands to see when applications were deployed, what thei …(trimmed)

Sources

tutorials/kubernetes-basics/explore/explore-intro.md · docViewing Pods and Nodes

Related (12)

part_of {{% heading "objectives" %}}describes conf=1
part_of {{% heading "prerequisites" %}}describes conf=1
part_of Kubernetes Podsdescribes conf=1
part_of Nodesdescribes conf=1
part_of Troubleshooting with kubectldescribes conf=1
part_of {{% heading "whatsnext" %}}describes conf=1
part_of Pods overviewdescribes conf=1
part_of Nodes overviewdescribes conf=1
part_of Check application configurationdescribes conf=1
part_of Show the app in the terminaldescribes conf=1
part_of Executing commands on the containerdescribes conf=1
api_for Nodedocuments API object conf=1

← all Docs