'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?



Solution 1:[1]

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.

Solution 2:[2]

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`

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jyothi Kiranmayi
Solution 2 G. Rafael