Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes ReplicaFailure FailedCreate but no events

I have deployment and a replica set in Kubernetes that are failing to create a pod. I've tried

kubectl describe deployment deployment-name and

kubectl describe replicaset replicaset-name

And they both say

Conditions:
  Type             Status  Reason
  ----             ------  ------
  ReplicaFailure   True    FailedCreate
Events:            <none>

All of the troubleshooting guides I've seen rely on information from the Events section but it says <none> in my case. How can I get more information to debug the problem?

like image 929
gary69 Avatar asked Jul 31 '20 20:07

gary69


People also ask

How do you update deployments in Kubernetes?

Updating an application You can use kubectl apply to update a resource by applying a new or updated configuration. Note: To update a resource with kubectl apply , the resource must be created using kubectl apply or kubectl create --save-config . Replace MANIFEST with the name of the manifest file.

How do I rollback Kubernetes Deployment?

After the kubectl apply command you can check if the deployment rolled out successfully or not and then, if necessary, the kubectl rollout undo command can rollback to the previous revision. Also, you can use the sleep Linux command to wait some time before that.


2 Answers

Describe replicaset will give you the error that is causing failure with deployment object.

./kubectl describe replicaset <replica-set-name>

Example error:

  Type     Reason            Age                From                   Message
  ----     ------            ----               ----                   -------
  Normal   SuccessfulCreate  13m                replicaset-controller  Created pod: pod
  Warning  FailedCreate      13m                replicaset-controller  Error creating: pods "pod" is forbidden: exceeded quota: custom-resource-quota, requested: cpu=510m, used: cpu=1630m, limited: cpu=2
like image 52
Raunak Kapoor Avatar answered Oct 14 '22 05:10

Raunak Kapoor


I believe the docs are pretty clear 👓 on how to debug this. This is a 'failed' deployment and possible causes:

  • Insufficient quota
  • Readiness probe failures
  • Image pull errors
  • Insufficient permissions
  • Limit ranges
  • Application runtime misconfiguration

You can try to debug for example by patching the progressDeadlineSeconds deployment spec field to something long.

kubectl patch deployment.v1.apps/deployment-name -p '{"spec":{"progressDeadlineSeconds":600}}'

Maybe you have a ReplicaSet resource quota❓

✌️

like image 23
Rico Avatar answered Oct 14 '22 06:10

Rico