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

First stab at distinct health check ports #751

Open
wants to merge 8 commits into
base: staging
Choose a base branch
from

Conversation

beastawakens
Copy link
Collaborator

What is the feature/fix?

Allows to define a health check and liveness port separate from the main service port. This is useful in situations where the service is listening on one port which you want to expose via a load balancer, so you define that port under the ports list, but this would mean the health/liveness check would not run as it relies on the port being defined under port.
It would also allow for a service that exposes multiple ports but you would wish to keep the health/liveness port not exposed beyond the rack, so you define that separately.

Does it has a breaking change?

I don't believe so. The manifest is setup to default the port to the service port if it is not defined already.

How to use/test it?

Specify a port under the the health/liveness sections of your convox.yml

Checklist

  • New coverage tests
  • Unit tests passing
  • E2E tests passing
  • E2E downgrade/update test passing
  • Documentation updated
  • No warnings or errors on Deepsource/Codecov

@beastawakens beastawakens requested review from nightfury1204 and removed request for nightfury1204 February 23, 2024 15:37
@nightfury1204
Copy link
Collaborator

@beastawakens thanks for the pr. We will look into it

@nightfury1204 nightfury1204 changed the base branch from master to staging March 14, 2024 17:26
Comment on lines +154 to +162
if s.Health.Port.Port == 0 && s.Port.Port > 0 {
m.Services[i].Health.Port.Port = s.Port.Port
if s.Port.Scheme != "" {
m.Services[i].Health.Port.Scheme = s.Port.Scheme
} else {
m.Services[i].Health.Port.Scheme = "http"
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if health port is defined but health scheme is not defined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the code shows, if you don't define the scheme, it will default to http.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am asking when health port is defined case. i can see in the code if health port defined the it will not execute the scheme condition in here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, sorry I misunderstood 😆 Yeah, I may have missed that... let me update!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nightfury1204 added default now, thank you!

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

2 participants