Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CDAP-21096] Add support for startupProbe in CDAP master #127

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

vsethi09
Copy link
Contributor

@vsethi09 vsethi09 commented Jan 16, 2025

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:

startupProbe:
          exec:
            command:
            - sh
            - -c
            - curl -s -f -k https://localhost:$(cat /tmp/appfabric.port)/v3/system/services/appfabric/status
          failureThreshold: 60
          periodSeconds: 3
          successThreshold: 1
          timeoutSeconds: 1

NOTE: Corresponding cdapio/cdap PR:

Change Description

  • Introduced StartupProbe as an optional field in the CDAPServiceSpec.
  • The StartupProbe config of type corev1.Probe will be set to the container spec.
  • Auto-generated:
    • api/v1alpha1/zz_generated.deepcopy.go
    • config/crd/bases/cdap.cdap.io_cdapmasters.yaml
  • Makefile: To fix unit tests, the max request size of etcd database used by controller-runtime/tools/setup-envtest had to be increased from default 1.5 MB to 2.5 MB. This is due to the increase in size of generated CRD.

Verification

  • Unit tests: make test
  • Docker image: deployed locally built docker image and edited the cdapmaster manifest to add startupProbe to appfabric spec.

Sorry, something went wrong.

@vsethi09 vsethi09 force-pushed the feature/CDAP-21096_appfabric_readiness_probe branch 7 times, most recently from fbc3e6c to 573da7e Compare January 17, 2025 10:58
@vsethi09 vsethi09 force-pushed the feature/CDAP-21096_appfabric_readiness_probe branch 7 times, most recently from f2cf735 to e840f08 Compare January 20, 2025 18:52
@vsethi09 vsethi09 force-pushed the feature/CDAP-21096_appfabric_readiness_probe branch from e840f08 to c537a90 Compare January 20, 2025 18:57
@vsethi09 vsethi09 marked this pull request as ready for review January 20, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant