Open
Description
What happened (please include outputs or screenshots):
I have a deployment in GCP in a k8s cluster.
I am trying to remove LivenessProbe
, ReadnessProbe
&& StartupProbe
, however the deployment does not get updated at all.
What you expected to happen:
The probes to be removed
How to reproduce it (as minimally and precisely as possible):
@property
def containers(self) -> List[V1Container]:
return self.spec.template.spec.containers
def __validate_prob(self):
for container in self.containers:
if (
container.readiness_probe
or container.startup_probe
or container.liveness_probe
):
container.readiness_probe = None
container.startup_probe = None
container.liveness_probe = None
def update():
with self.kubernetes_service as api_client:
api_instance = kubernetes.client.AppsV1Api(api_client)
api_instance.patch_namespaced_deployment(
name=self.name,
namespace=self.namespace,
body=self.deployment,
_request_timeout=self.kubernetes_service.timeout,
)
- Assume that self.deployment is the
V1Deployment
object. - This is code from a class that should remove the probes from the deployment (and does a lot of other stuff), however they are not removed from some reason.
- If I try to update an image or anything else, it works as expected, so it could be a problem specific with probes
Environment:
- Kubernetes version (
kubectl version
):
Client Version: v1.31.3
Kustomize Version: v5.4.2
Server Version: v1.30.8-gke.1051000
- OS (e.g., MacOS 10.13.6): mac os 12
- Python version (
python --version
) python 3.12 - Python client version (
pip list | grep kubernetes
) 29.0.0