cloudfoundry / cf-java-client

Java Client Library for Cloud Foundry
Apache License 2.0
327 stars 317 forks source link

Unable to set PCF health-check invocation-timeout through stream spring boot app. #1114

Open suresh-chidham opened 3 years ago

suresh-chidham commented 3 years ago

I need to set PCF health-check invocation-timeout through manifest file.

In manifest.yaml file

cloudfoundry.health-check: "HTTP" cloudfoundry.health-check-http-endpoint: "/actuator/health" cloudfoundry.health-check-timeout: "130"

cloudfoundry.health-check-invocation-timeout: "10"

In this, first 3 properties are able to set in PCF health-check section through spring boot app . But invocation-timeout is not able to set. Please can you help on this?

dmikusa commented 3 years ago

I don't believe it's possible to set that through a manifest at the moment.

If you are using the cf cli v7 and the cf API v3, you can set this through the process group.

Ex:

processes:
- type: web
  command: start-web.sh
  disk_quota: 512M
  health-check-http-endpoint: /healthcheck
  health-check-type: http
  health-check-invocation-timeout: 10
  instances: 3
  memory: 500M
  timeout: 10

I don't believe this functionality has been added to the cf-java-client operations library (which is where manifest is implemented) yet. We're still adding a lot of support for the v3 CF API into operations.

The client does have support for processes though & it does have the required fields to populate the health check information. It's under https://github.com/cloudfoundry/cf-java-client/tree/main/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/processes and Process has a HealthCheck member, which in turn has a Data member which in turn has the endpoint, type, and invocation timeout properties. You could use the client directly to update the process and set that information, it's just not as convenient as using the operations library & a manifest.

Hope that helps!

dmikusa commented 3 years ago

I tagged the issue as an enhancement and it's in the backlog. I can't commit to a time. As always, if you're willing to submit a PR I can prioritize getting that merged, and that is usually the fastest way to get this functionality.

suresh-chidham commented 3 years ago

Thanks for your information. But it will be great to fix this issue as soon as possible..