-
Notifications
You must be signed in to change notification settings - Fork 12
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
Docs for Kubernetes Setup #23
Comments
Why not just make a helm chart instead of setting up manifests? |
hey! I already made a helm chart for this. Should I do a PR so it stays upstream (your repo)? the only thing a bit "complicated" (not crazy) is the release process of the chart. I also have integration with GrafanaOperator so it automatically imports the charts into the cluster. cc: @platinummonkey |
Yeah feel free to make a PR! |
@platinummonkey here you have the PR: unpoller/unpoller#708 BTW, I was wrong I had a kustomize application, not a helm chart, so I did it from scratch. |
I already have a working installation of Kube Stack Prometheus (includes Prometheus, Grafana, Alertmanager, lots of exporters as one bundle). I recently migrated my UniFi Network Application (controller) to Kubernetes and wanted a nice dashboard and found this project. Within a few hours I was able to convert the Docker instructions to Kubernetes manifest files.
My use case, is just Unpoller running with Prometheus plugin enabled, everything else is disabled. The only thing I had to add was a
PodMonitor
which makes the Unpoller exporter discoverable to Prometheus. Hopefully the steps below help someone.First Item is a secret which holds the Unifi ID & Password credentials (values here should be base64 encoded). These will be exposed as environment variables to the Unpoller container.
Next a configMap which holds the contents of the
up.conf
file and will be mounted in the container in/etc/unifi-poller
directory. Theurl
is the internal Kubernetes DNS name to my Unfi Controller container. You would need to adjust to whatever you named your container.Next is a deployment file, which links everything together. Instructs where to mount the secret and ConfigMap, defines the image and version of the container, which port to expose, how many copies of unpoller to run, etc. Since I'm only using the Unpoller Prometheus plugin I only defined that port and named that port
metrics
.I also added a
podAffinity
section above instructing Kubernetes to run this container on the same node (hostname) where the Unifi Controller software is running, where ever that is, this will follow. If that is not started, then this won't start. It is looking for a labelapp
with valueunifi-controller
, if you name yours something else then adjust as needed. By using pod affinity to keep the two applications next to each other, it keeps all the polling chatter local to reduce network traffic.Lastly is a PodMonitor which is what Prometheus will look for. While the unpoller deployment I placed in the
unifi
namespace where the Unifi Controller is also placed, I put this podmonitor in themonitoring
namespace where Prometheus is located.The installation of Prometheus I have will automatically discover any pod or service monitor with a label
release: kube-stack-prometheus
thus no configuration is needed. This is not universal, if you used a different Prometheus package it likely is looking for a different label, adjust as needed if unpoller metrics are not seen within Prometheus after a few seconds. This podmonitor will scrape data off themetrics
port named in the deployment and will use URI path/metrics
.FYI - As to the number and content of labels, they were auto-generated by Kustomize. If you were to write labels manually, you probably would use more meaningful descriptions. But these work fine.
Ideally this would also have a service account defined and associated RBAC roles limiting what that service account could do. I haven't gotten around to that yet.
Unpoller and Unifi Contoller running side by side in same namespace:
And the pod monitoring running:
And if you want to test if metrics are being pulled by Unpoller and made available easy to test, just point to the IP address assigned to the Unpoller container:
(Hundreds of lines removed from output for brevity).
All of the dashboards documented work just fine in Grafana.
If someone has defined reasonable alerts for Alertmanager based on these metrics that would be handy.
The text was updated successfully, but these errors were encountered: