Creating Kubernetes Pods and Performing Basic Operations
This article provides step‑by‑step commands for creating Kubernetes pods, pulling images, running simple applications, exposing deployments, checking logs, and managing resources such as scaling, updating images, and viewing pod details, offering a practical guide for verifying network access and basic cluster operations.
This guide demonstrates how to verify network access for a newly created Kubernetes pod and includes a collection of essential kubectl commands for managing pods, services, nodes, and deployments.
kubectl get pod,svc
kubectl get pod,svc -o wide
kubectl get nodes
kubectl get pod -n kube-system
docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
3aab638df1a9: Pull complete
Digest: sha256:52817dece4cfe26f581c834d27a8e1bcc82194f914afe6d50afad5a101234ef1
kubectl run busybox --image busybox --restart=Never --rm -it busybox -- sh
If you don't see a command prompt, try pressing enter.
Additional useful commands:
kubectl run nginx-deploy --image=nginx:1.14-alpine --port=80 --replicas=1
kubectl expose deploy nginx-deploy --name=nginx --port=80 --target-port=80
kubectl run client --image=busybox --replicas=1 -it --restart=Never
kubectl get pod -w
kubectl set image deployment myapp myapp=ikubernetes/myapp:v2
kubectl scale --replicas=5 deployment myapp
kubectl rollout status deployment myapp
kubectl get pod pod_name -o yaml
kubectl edit deployment nginx-deploy
kubectl get pods --show-labels
Log inspection commands:
kubectl logs nginx-pod
kubectl logs nginx-pod -c my-container
kubectl logs -f nginx-pod
kubectl logs -f nginx-pod -c my-container
kubectl run -i --tty busybox --image=busybox -- sh
--- End of tutorial ---
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.