Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add labels to kube artifacts (#427)
## Description This PR is a draft and discussion around adding labels to kube artifacts to distinguish what is what. For instance, I may want to get logs from only the watcher or admission pods without looking up the pod/deployment or uuid names. It also creates a method for scraping services using a `ServiceMonitor`'s `MatchLabel`. This PR was created while writing documentation around scraping the Pepr services with Prometheus. It also provides documentation how to scrape the Pepr services. Use this [gist](https://gist.github.com/cmwylie19/f9503ddebe848616a4e8891bfaeafb3e) as a guide if needed End Result: ```bash ┌─[cmwylie19@Cases-MacBook-Pro] - [~/pepr] - [2023-12-07 04:21:28] └─[0] <git:(426 324b16f) > k get svc,po,deploy -n pepr-system --show-labels NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE LABELS service/pepr-static-test ClusterIP 10.43.9.3 <none> 443/TCP 5m24s pepr.dev/controller=admission service/pepr-static-test-watcher ClusterIP 10.43.75.252 <none> 443/TCP 5m24s pepr.dev/controller=watcher NAME READY STATUS RESTARTS AGE LABELS pod/pepr-static-test-b7f858d7-fsx5z 1/1 Running 0 5m24s app=pepr-static-test,pepr.dev/controller=admission,pod-template-hash=b7f858d7 pod/pepr-static-test-b7f858d7-vr89k 1/1 Running 0 5m24s app=pepr-static-test,pepr.dev/controller=admission,pod-template-hash=b7f858d7 pod/pepr-static-test-watcher-78647f6bbd-8jckv 1/1 Running 0 5m24s app=pepr-static-test-watcher,pepr.dev/controller=watcher,pod-template-hash=78647f6bbd NAME READY UP-TO-DATE AVAILABLE AGE LABELS deployment.apps/pepr-static-test 2/2 2 2 5m24s app=pepr-static-test,pepr.dev/controller=admission deployment.apps/pepr-static-test-watcher 1/1 1 1 5m24s app=pepr-static-test-watcher,pepr.dev/controller=watcher ``` ## Related Issue Fixes #426 <!-- or --> Relates to #412 ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/pepr/blob/main/CONTRIBUTING.md#submitting-a-pull-request) followed --------- Signed-off-by: Case Wylie <[email protected]>
- Loading branch information