Distributed Deployment - ALB Healthchecks #1464
-
We looking at deploying clair in a distributed manner where we will have three different containers (ECS Services) running for the indexer, matcher and notifier services as outlined in the howto. An AWS ALB makes for very easy path based routing, but each ALB TargetGroup then also need a healthcheck endpoint. For the indexer, this can be somewhat faked by using There is however no endpoint I can see that can be used for the notifier and matcher, or is there some hidden My understanding is that v2 provided for a health check path on port 6061, but its not clear if it is the case on v4 here? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
So when looking at
This means that I won't ever see the health checks working using the default code. This I would say is less than ideal. Without me changing any code, how would we get this working? Ideally I don't want to change code as we don't want to compile and maintain this ourselves. We only want to use it 'off the shelf', so ideally only want to pull docker images to use Clair. |
Beta Was this translation helpful? Give feedback.
-
There's a health endpoint on the introspection port, which runs by default. The configuration should be in the documentation and the address used is printed in the logs. |
Beta Was this translation helpful? Give feedback.
-
looking at the logs for the notifier (the matcher and indexer print much the same logs), I see this:
My config:
Not sure where the healthcheck then would be? Also not sure which documentation you refer to as the documentation on clair is pretty sparse. This here has no reference to any healthchecks. |
Beta Was this translation helpful? Give feedback.
-
Just to reply in a separate message to be able to mark this question as answered. To enable health checks on the container, you need to check the Keep in mind that this port might not be exposed by the container, so in addition to the service port, default being When you then run you container in something like AWS ECS, the ALB configuration would look something like this... The above configuration will then only expose the service on port 443 and port 8089 only available to the ALB. The ALB will handle TLS offloading and allow for unencrypted traffic into the container. I hope this will help someone else. |
Beta Was this translation helpful? Give feedback.
Just to reply in a separate message to be able to mark this question as answered.
To enable health checks on the container, you need to check the
/healthz
endpoint on the introspection port. The default configuration has introspection running on port:8089
, so the health check would then behttp://localhost:8089/healthz
Keep in mind that this port might not be exposed by the container, so in addition to the service port, default being
:6060
port:8089
might also need to be exposed.When you then run you container in something like AWS ECS, the ALB configuration would look something like this...
ALB:
Listener:
Port: 443:6060
TargetGroup:
Port: 6060
HealtCheck Port: 8089
HealthCheck Path: /…