wso2 / k8s-api-operator

API Operator for Kubernetes
Apache License 2.0
115 stars 48 forks source link

Add rediness and liveliness props to the deployment spec #574

Open sajithaliyanage opened 5 years ago

sajithaliyanage commented 5 years ago

Description: Readiness probes are designed to let Kubernetes know when your app is ready to serve traffic. When new configuration applies, Pod will pull the base image according to the image pull policy and restart the pod.

Here the issue is if a user sends a request while restarting k8s will response as connection refuse error. Need to avoid this from adding readiness and liveliness props into the deployment spec.

Suggested Labels: Type/Improvement

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

GDLMadushanka commented 4 years ago

We introduced an internal API to check the readiness of the pod. The following is the configuration used in deployment.yaml file

 readinessProbe:
     httpGet:
         path: /healthz
         port: 9201
     initialDelaySeconds: 5
     periodSeconds: 2 

This is available from 1.2.0-m1

sajithaliyanage commented 3 years ago

We can add this specs under the deploySpec

abeykoon commented 3 years ago

For liveness probe by default we will check the passthro HTTP port. For readiness probe by default we will check above /healthz API.