https://github.com/arjunrn/custom-metrics-router
https://github.com/arjunrn/custom-metrics-router
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/arjunrn/custom-metrics-router
- Owner: arjunrn
- Created: 2020-10-08T16:32:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-06T21:19:42.000Z (over 5 years ago)
- Last Synced: 2023-03-12T10:11:28.248Z (over 3 years ago)
- Language: Go
- Size: 51.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Custom Metrics Router
Router to support multiple metrics adapters in Kubernetes
## Running the router
### Build and push the image
```bash
IMAGE=custom-metrics-router VERSION=v0.1.0 make build.push
```
Here `IMAGE` should be the set to an image name which to which location
the built image will be subsequently pushed. `VERSION` can also be set
accordingly, or a value will be generated from the git commit.
### Deploy the router
```bash
kubectl create ns custom-metrics
kubectl apply -f deploy/metricsrouter.io_custommetricsssources.yaml
kubectl apply -f deploy/rbac.yaml
```
In the `deploy/deployment.yaml`file modify the `image` field with the value
of the docker image from the previous step.
```bash
kubectl apply -f deploy/deployment.yaml
kubectl apply -f deploy/service.yaml
```
The next step registers the router as the default API service for
`custom.metrics.k8s.io` and `external.metrics.k8s.io`. Before this step
ensure that there is no existing service for that API group or the existing
service register has lower priority.
```bash
kubectl apply -f deploy/apiservice.yaml
```
Modify the file `deploy/example.yaml` to point to an existing custom or external
metrics provider
### Testing the metrics router.
```bash
kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/"
kubectl get --raw "/apis/external.metrics.k8s.io/v1beta2/"
```