...

/

Challenge: Troubleshooting Kubernetes

Challenge: Troubleshooting Kubernetes

Challenge yourself by troubleshooting some issues in Kubernetes.

Problem 1: Resolving resource error issues

We deployed the application below and it’s not running yet. When we check its status, it shows that the pod is in a pending state. Troubleshoot the issue and figure out a way to resolve it.

Press + to interact
apiVersion: v1
kind: Pod
metadata:
name: app
spec:
containers:
- name: container
image: busybox
command: ["/bin/sh", "-c", "while true; do echo 'Running...'; sleep 10; done"]
resources:
requests:
cpu: "6"
memory: "10Gi"

Use the following run commands while you practice:

Press + to interact
# To get pod status
kubectl get pods
# To get logs of pod
kubectl logs <pod_name>
# To get more details on pod
kubectl describe pod <pod_name>
# To edit pod
nano pod.yaml
# To delete a pod
kubectl delete pod <pod_name>
# To create a pod after solving the issue
kubectl apply -f pod.yaml
...