[CDAP-21096] Write appfabric server port to tmp file for k8s readiness probe#15811
[CDAP-21096] Write appfabric server port to tmp file for k8s readiness probe#15811
Conversation
3405938 to
90bc0ab
Compare
tivv
left a comment
There was a problem hiding this comment.
Can you clarify why the current way of doing things (e.g. announceing the service in k8s) is not enough and we need an additional communication channel?
When appfabric k8s deployment is updated, a new Pod creation is Triggered. Due to rolling upgrade strategy ( Even when the new Pod is in |
What I mean is that as soon as Service is available, it registers itself with K8s using io.cdap.cdap.k8s.discovery.KubeDiscoveryService#register. If at all possible, we should use this information in the probe instead of creating a separate information channel |
CDAP-21096 Add support for startupProbe in CDAP master
Context
In addition to the rolling upgrade strategy, for high availability of APIs, startup probe need to be implemented to ensure that the CDAP service pods (eg. Appfabric) accepts requests only when the server has started.
CDAP services (eg. Appfabric) run on dynamic port and announces the port after the server has started. For this command probe can be configured to check the status of system service using the URL ‘/v3/system/services//status’.
CDAP services will write the port to a temp file in the container after startup. Here is a code snippet for startup probe using the port written to the temp file:
NOTE: Corresponding
cdapio/cdap-operatorPR: cdapio/cdap-operator#127Change Description
StartupProbeas an optional field in theCDAPServiceSpec.StartupProbeconfig of typecorev1.Probewill be set to the container spec.controller-runtime/tools/setup-envtesthad to be increased from default 1.5 MB to 2.5 MB. This is due to the increase in size of generated CRD.Verification