A pod holds one container or more containers.
Each pod has an IP address.
The pod has a phase.
The phase shows the state of the pod.
The cluster gives the pod a node.
You can delete the pod.
Kubernetes holds your application in a cluster. A pod is the basic unit of the cluster. A deployment controls a group of pods. An ingress gives persons on the Internet access to a service in the cluster. Each part gives the steps for a problem.
A pod holds one container or more containers.
Each pod has an IP address.
The pod has a phase.
The phase shows the state of the pod.
The cluster gives the pod a node.
You can delete the pod.
A deployment controls a group of pods.
You set the number of pods in the manifest.
The deployment keeps the number at this value.
The deployment gives new pods to the cluster.
This change is a rollout.
A rollout replaces the pods one group at a time.
An ingress gives persons on the Internet access to a service in the cluster.
The ingress has one or more rules.
Each rule has a host and a path.
The ingress sends the traffic to the correct service.
An ingress controller does the work.
The controller reads the rules of the ingress.
First, do a check of the pod state.
kubectl get pods -n <namespace>
Then, look at the events and the state of the pod.
kubectl describe pod <pod-name> -n <namespace>
Then, look at the logs of the container.
kubectl logs <pod-name> -n <namespace>
Read the items that follow.
The cluster does not start the pod.
Do a check of the events.
The node does not have sufficient CPU or memory.
The image is not available.
The container stops again and again.
Look at the logs of the container.
Correct the error in the application.
Then start the pod again.
The cluster cannot get the image.
Do a check of the image name.
Do a check of the secret of the registry.
The container uses more memory than the limit.
Change the memory limit in the manifest.
Or make the application use less memory.
The pod is not ready.
The readiness probe does not work.
Do a check of the probe path and the probe port.
First, do a check of the deployment state.
kubectl get deployment <name> -n <namespace>
Then, look at the rollout state.
kubectl rollout status deployment/<name> -n <namespace>
Then, look at the events of the deployment.
kubectl describe deployment <name> -n <namespace>
Then, look at the replica sets.
kubectl get replicaset -n <namespace>
Read the items that follow.
The pods are not ready.
Look at the pod problems.
The rollout does not move.
Do a check of the events.
The image is not available.
Or the image name is not correct.
The deployment does not create pods.
Do a check of the events.
The service account does not have sufficient access.
The pods use too much memory.
Change the memory limit in the manifest.
First, do a check of the ingress state.
kubectl get ingress -n <namespace>
Then, look at the events of the ingress.
kubectl describe ingress <name> -n <namespace>
Then, do a check of the service and the endpoints.
kubectl get service,endpoints -n <namespace>
Then, do a check of the ingress controller.
kubectl get pods -n ingress-nginx
Read the items that follow.
The ingress gives a 400 code.
The request is not correct.
Do a check of the request of the client.
The ingress gives a 401 code.
The request has no token.
Do a check of the token in the request.
The ingress gives a 403 code.
The role does not give access.
Do a check of the role of the token.
The ingress gives a 404 code.
The host or the path is not correct.
Compare the host in the ingress with the host in your request.
Compare the path in the ingress with the path in the service.
The ingress gives a 500 code.
The container has an error.
Look at the logs of the container.
The ingress gives a 502 code.
The port of the service is not correct.
Do a check of the target port.
The ingress gives a 503 code.
The endpoint is not available.
Do a check of the endpoints of the service.
The ingress gives a 504 code.
The pod is too slow.
Look at the logs of the pod.
The ingress has no address.
The ingress controller is not available.
Or the controller does not have a load balancer.
Do a check of the controller pods.
The host is not correct.
Add the host to your DNS record.
Or use the IP address of the load balancer.
A request moves from left to right.
Each part checks the request.
If all parts work, the ingress gives a 200 code.
The request works.
The request is not correct.
The request has no token.
The role does not give access.
The host or the path is not correct.
The container has an error.
The port of the service is not correct.
The endpoint is not available.
The pod is too slow.
Find the code in the response. Then do the steps for the code.
CAUTION: Do not change the production manifest without a copy.
An incorrect change can stop the service.
Make a copy of the manifest before you change it.