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 cannot scrape the operator pod (tries port 80, but the operator uses port 8080)? #738

Closed
rbtr opened this issue Sep 12, 2024 Discussed in #734 · 1 comment · Fixed by #848
Closed

Kubernetes cannot scrape the operator pod (tries port 80, but the operator uses port 8080)? #738

rbtr opened this issue Sep 12, 2024 Discussed in #734 · 1 comment · Fixed by #848
Assignees
Labels
area/metrics good first issue Good for newcomers help wanted Extra attention is needed scope/S Change is Small type/bug Something isn't working

Comments

@rbtr
Copy link
Collaborator

rbtr commented Sep 12, 2024

Discussed in #734

Originally posted by kastl-ars September 12, 2024
Hi all,

I just installed Retina and kube-prometheus-stack according to the documentation.

But one of the retina-pods targets is unhealthy according to Prometheus. It tries to get the metrics for the operator pod on port 80:

Get "http://10.42.0.16:80/metrics": dial tcp 10.42.0.16:80: connect: connection refused

However, the operator pods seems to listen on port 8080?

[...]
ts=2024-09-12T11:23:41.024Z level=info caller=legacy/deployment.go:251 msg="Starting manager"
2024-09-12T11:23:41.024Z        info    controller-runtime.metrics      Starting metrics server
2024-09-12T11:23:41.024Z        info    controller-runtime.metrics      Serving metrics server  {"bindAddress": ":8080", "secure": false}
2024-09-12T11:23:41.024Z        info    starting server {"name": "health probe", "addr": "[::]:8081"}
[...]

This is the values.yaml I uses for the installation:

image:
  tag: 'v0.0.16' 
operator:
  enabled: true
  tag: 'v0.0.16' 
  enableRetinaEndpoint: true
loglevel: 'info'
enabledPlugin_linux: "[dropreason,packetforward,linuxutil,dns,packetparser]"
enablePodLevel: true
remoteContext: true

Any ideas?

Kind Regards,
Johannes

@rbtr rbtr added type/bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed area/metrics scope/S Change is Small labels Sep 12, 2024
@rbtr rbtr moved this to Accepted in Retina Triage Board Sep 12, 2024
@whatnick
Copy link
Contributor

The legacy helm chart added a ServiceMonitor via #695 which should be the recommended means for adding scraper jobs for Prometheus for all the retina-agent pods in the daemonset. If the service is created properly and all agent pods run on port 8080. For clarification is this hubble helm chart ?

@SRodi SRodi linked a pull request Oct 11, 2024 that will close this issue
7 tasks
github-merge-queue bot pushed a commit that referenced this issue Oct 15, 2024
# Description

Adding a ServiceMonitor for retina-operator
* parameterized & applied retina-operator name
* adding service & serviceMonitor CRD's for retina-operator
* applied appropriate relabeling & metric relabeling config to align
with retina-jobs additional scrape config

## Related Issue

retina-operator wasn't being scraped for metrics by prometheus.
Initially it was appearing in the 'retina-pods' job and failing as
reported in this issue:
#738 


Partial fix was merged to remove the operator pod from the list here:
#770

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed


![image](https://github.com/user-attachments/assets/b1722546-d013-4ab3-8565-1c0357eea0da)

Operator specific metrics with job='retina-operator' selector:


![image](https://github.com/user-attachments/assets/821bc2ae-3d16-40a5-a527-4b36ecbb82e4)


## Additional Notes

Proposed next steps is to align the way we add scrap configs:
#847

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics good first issue Good for newcomers help wanted Extra attention is needed scope/S Change is Small type/bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants