gajus / lightship

Abstracts readiness, liveness and startup checks and graceful shutdown of Node.js services running in Kubernetes.
Other
517 stars 33 forks source link

Change default path #9

Closed guglio closed 4 years ago

guglio commented 5 years ago

Is it possible to change the default path from '/' to '/something/'? For example: /live -> /something/live /health -> /something/health /ready -> /something/ready

gajus commented 5 years ago

Not currently.

What is the use case, though given that you are using a custom port anyway?

robinglen commented 4 years ago

@gajus I was also looking at requesting this feature, until I read about running the healthchecks on different ports. I was just wondering if you had experienced any issues running two express instances on the same node process?

The reason, I was going to request the feature is, we have some node "proxy" services that are internet facing so we include certain prefixes for our readiness routes.

This is just makes it easier for us to block certain patterns when your are outside of our office, for example we may have things like:

/_system-routes_/ping
/_system-routes_/assets
/_system-routes_/uptime

Then we back just create rules like /_system-routes/* blocked.

We are really interested in replacing some of our endpoints with lightship but it would be nice if we could do something like this:

import {
  createLightship
} from 'lightship';

const configuration: LightshipConfigurationType = {prefix: '_system-routes_'};

const lightship: LightshipType = createLightship(configuration);

However if you say there is no effect of running two instances, I will look to implement this.

gajus commented 4 years ago

However if you say there is no effect of running two instances, I will look to implement this.

There is no considerable effect, no.

The purpose of running lightship on a different port is so that you wouldn't need to expose that port to the public at all. There is no need for a prefix. If you want to expose state to the external world, then lightship is probably not the best solution. The API assumes that it is consumed within private network and future features may leverage that.

robinglen commented 4 years ago

Hey, this is what I assumed... we are just going see how this sits with istio and will look to implement. Thanks so much