In this guide, we will walk through the process of deploying a pod within your Minikube cluster and inspecting its details using the kubectl command-line utility. This tutorial is ideal for developers and Kubernetes practitioners looking to get started with pod management in a local environment.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Ensure you have Minikube installed and a cluster running. Your kubectl should be configured to communicate with your Minikube cluster.
Creating a Pod with Nginx
A pod is the smallest deployable unit in Kubernetes. To create a pod named “nginx” using the official Nginx image from Docker Hub, execute the following command:- “nginx” is both the pod name and the Docker image name.
- The Docker image must be available on Docker Hub or any other container registry. You can also specify an image tag or a custom registry if needed.
- READY: Indicates the container is ready.
- RESTARTS: Shows the number of times the container has restarted.
- AGE: Displays how long the pod has been running.
Inspecting Pod Details
To view detailed information about the pod, including labels, node assignment, and network configurations, use:- The pod is labeled with
run=nginxby default. - It is scheduled on the Minikube node with IP address
192.168.99.100, and the pod itself has the internal IP172.17.0.3. - Container-specific information such as Container ID, image details, and current state are also provided.
Each event provides a timestamp and message detailing stages such as scheduling, image pulling, container creation, and container start. This is crucial for troubleshooting.
Viewing Pods with Extended Information
To get additional details such as the node and internal IP address where the pod is running, use the--wide flag:
172.17.0.3.
Summary
This demonstration showed you how to deploy a pod using a simple command in Minikube, inspect its configuration and lifecycle events withkubectl describe, and view extended information with the --wide flag. You can also create pods using YAML definition files for more advanced configurations.
For further reading, consider exploring: