{"id":18640460,"url":"https://github.com/slashpai/prometheus-operator-examples","last_synced_at":"2025-10-12T16:38:04.372Z","repository":{"id":73876192,"uuid":"477665996","full_name":"slashpai/prometheus-operator-examples","owner":"slashpai","description":"prometheus-operator example configs","archived":false,"fork":false,"pushed_at":"2024-02-02T14:20:51.000Z","size":6922,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T17:13:44.229Z","etag":null,"topics":["examples","kubernetes-operator","prometheus-metrics","prometheus-operator"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slashpai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-04-04T11:13:54.000Z","updated_at":"2024-08-10T06:43:33.000Z","dependencies_parsed_at":"2024-02-02T14:42:07.747Z","dependency_job_id":null,"html_url":"https://github.com/slashpai/prometheus-operator-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/slashpai/prometheus-operator-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fprometheus-operator-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fprometheus-operator-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fprometheus-operator-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fprometheus-operator-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slashpai","download_url":"https://codeload.github.com/slashpai/prometheus-operator-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fprometheus-operator-examples/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262685694,"owners_count":23348451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["examples","kubernetes-operator","prometheus-metrics","prometheus-operator"],"created_at":"2024-11-07T05:54:39.339Z","updated_at":"2025-10-12T16:37:59.342Z","avatar_url":"https://github.com/slashpai.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus-operator-examples\n\n**Disclaimer:** *The configs in this repo should be treated as examples only. This is not tested in production cluster. These examples can serve as a starting point for creating production ready configs.*\n\nFor each example config, check README page in respective folder.\n\nExamples are created in `default` namespace\n\n## Pre-requisites\n\nCreate kind cluster or minikube cluster (examples in this repo are tested with kind cluster)\n\n## Create a playground kubernetes cluster\n\n### kind cluster\n\nThis will create a multi-node kind cluster with one control plane node\nand two worker nodes\n\n```bash\n kind create cluster --name multi-node --config kind-config.yaml\n```\n\nor\n\n### minikube (not fully tested for all examples)\n\n```bash\nminikube start --nodes 3 -p multi-node --kubernetes-version=v1.27.3 --memory=6g --bootstrapper=kubeadm --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=Webhook --extra-config=scheduler.bind-address=0.0.0.0 --extra-config=controller-manager.bind-address=0.0.0.0\n```\n\n### Configure prometheus-operator\n\n```bash\ngit clone https://github.com/prometheus-operator/prometheus-operator.git\ncd prometheus-operator\n# install crds\nkubectl create -f example/prometheus-operator-crd-full\n# deploy prometheus-operator\nkubectl create -f example/rbac/prometheus-operator\n```\n\nYou should see prometheus-operator pod running\n\n```bash\nkubectl get pods\nNAME                                  READY   STATUS     RESTARTS   AGE\nprometheus-operator-bcbbc87bd-mmbrl   1/1     Running    0          3m47s\n```\n\n### Create Prometheus stack\n\nFrom this repo path:\n\n```bash\nkubectl create -f prometheus_only_stack\n```\n\nYou should see prometheus pods running after a while\n\n```bash\nprometheus-prometheus-0               2/2     Running   0          3m20s\nprometheus-prometheus-1               2/2     Running   0          3m20s\n```\n\n## Helpful Commands\n\n- Access Prometheus UI\n\n  ```bash\n  kubectl -n default port-forward svc/prometheus-operated 9090\u0026\n  ```\n\n## Notes\n\nFor most of the examples, app deployed is [prometheus-example-app](https://github.com/rhobs/prometheus-example-app). You can deploy a different app adjust configs accordingly (mainly the port number).\n\nPort-forward the app deployed to see more metrices generated by the [prometheus-example-app](https://github.com/rhobs/prometheus-example-app). Otherwise you will see only `version` metric and [automatically generated timeseries](https://prometheus.io/docs/concepts/jobs_instances/#automatically-generated-labels-and-time-series) only in prometheus when you query.\n\nIf app is deployed as a pod:\n\n```bash\nkubectl port-forward pod/\u003cpod-name\u003e 8080\n```\n\nIf service exists/deployed as a Deployment and exposed it through service\n\n```bash\nkubectl port-forward svc/\u003cservice-name\u003e 8080\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslashpai%2Fprometheus-operator-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslashpai%2Fprometheus-operator-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslashpai%2Fprometheus-operator-examples/lists"}