JorgeBPrado
JorgeBPrado

Reputation: 235

Remove Kubernetes Readiness Probe

My deployment had a readinessProbe configured like:

 readinessProbe:
    port: 8080
    path: /ready
    initialDelaySeconds: 30
    failureThreshold: 60
    periodSeconds: 10
    timeoutSeconds: 15

I want to remove the probe for some reason. However, after removing it from my YML file my deployment is not successful because look like the pod is never considered ready. Checking in GCP I discover that the result YML file has a readiness probe that points to some "default values" that I haven't set nowhere:

    readinessProbe:
      failureThreshold: 3
      httpGet:
        path: /ready
        port: 80
        scheme: HTTP
      initialDelaySeconds: 5
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 5

Is there a way to actually remove a ReadinessProbe for good?

Upvotes: 5

Views: 24797

Answers (3)

matthieu Bouamama
matthieu Bouamama

Reputation: 199

You need to set readinessProbe to null value like that:

readinessProbe: null

Upvotes: 11

Jyothi Kiranmayi
Jyothi Kiranmayi

Reputation: 2533

One possible way to remove the probe would be to modify changes to the configuration file(yaml file) and disable the Readiness Probe.

You can do this, by adding enabled: false to the configuration file. For example,

readinessProbe:
   enabled: false
   path: /ready 
   initialDelaySeconds: 30 
   failureThreshold: 60 
   periodSeconds: 10 
   timeoutSeconds: 15

If you are unable to modify the configuration file then, as mentioned by @G. Rafael try re-creating the deployment and apply the deployment configuration file to the cluster.

Upvotes: -3

G. Rafael
G. Rafael

Reputation: 399

I've experienced the same problem when trying to remove a readinessProbe. The only way I have found to successfully do this is by first deleting the deployment then applying the deployment yaml to the cluster. This does cause some downtime but removes the probe for good.

`kubectl delete deployment <deployment-name>`
`kubectl apply -f deployment.yaml`

Upvotes: 0

Related Questions