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

[Kubernetes] Track status of service based on pod events Inbox #148

Open
rgmz opened this issue Jun 2, 2021 · 1 comment
Open

[Kubernetes] Track status of service based on pod events Inbox #148

rgmz opened this issue Jun 2, 2021 · 1 comment

Comments

@rgmz
Copy link

rgmz commented Jun 2, 2021

Context

Presently, the KubernetesServiceImporter tracks services 'statically':

Dynamic events that happen during a service's lifetime — like not having any (healthy) pods — aren't tracked, meaning the reported statuses will always be "UP". Ideally, the importer could track the lifecycle of these events to differentiate between a service that is truly "UP", versus one that merely "exists".

Describe the feature

In the OpenShift Applications > Services UI, there is a "Pods" section that shows pods associated with a service, and if they're accepting traffic:

image

This is seemingly accomplished by:

  1. fetching a list of pods:

    
    GET /api/v1/namespaces/${NAMESPACE}/pods
    
    
  2. filtering pods that match the service's selector

  3. watching /api/v1/namespaces/${NAMESPACE}/pods or /api/v1/namespaces/${NAMESPACE}/events for changes (I'm not sure which; Firefox shows both, but Chrome only shows the latter)

  4. GOTO 2

There are undoubtedly better approaches (e.g. Fabric8's KubernetesHelper#podsForService, but that's the one that caught my eye and inspired this issue.

The KubernetesServiceImporter could do something similar to keep track of pod events, and update the status of a service accordingly.

Use cases

  • Reflects real-time status of the service

Contribution

I'd be happy to try, with some guidance. :)

@tsegismont
Copy link
Contributor

Thanks for reporting this @rgmz . Please go ahead, we'll help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants