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 #132

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

vsethi09
Copy link
Contributor

@vsethi09 vsethi09 commented Feb 6, 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) by default run on dynamic port and announces the port after the server has started. The port can be fixed for startup probe. The Command probe can be configured to check the status of system service using the URL ‘/v3/system/services//status’.

For supporting startuProbe, the CDAP services will use a fixed port defined by <service-name>.bind.port. 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:<port>/v3/system/services/appfabric/status
          failureThreshold: 60
          periodSeconds: 2
          timeoutSeconds: 1

NOTE: Corresponding cdapio/cdap PR: cdapio/cdap#15859

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

Verification

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

@vsethi09 vsethi09 merged commit 6f4b3fa into develop Feb 7, 2025
4 checks passed
@vsethi09 vsethi09 deleted the feature/CDAP-21096_appfabric_startup_probe branch February 7, 2025 09:30
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.

2 participants