https://github.com/cbuschka/k8s-service-registry
Proof of concept of a service registry that exposes k8s services via a custom http api
https://github.com/cbuschka/k8s-service-registry
k8s python3 registry
Last synced: 7 months ago
JSON representation
Proof of concept of a service registry that exposes k8s services via a custom http api
- Host: GitHub
- URL: https://github.com/cbuschka/k8s-service-registry
- Owner: cbuschka
- Created: 2019-10-31T18:26:08.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-01T02:21:43.000Z (almost 6 years ago)
- Last Synced: 2025-01-16T04:24:29.928Z (9 months ago)
- Topics: k8s, python3, registry
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Prototype of a service registry exposing services registered in k8s
## Prerequesites
* python3
* make
* k8s cluster and $HOME/.kube/config setup## Usage
### Start locally
```
make run
```goto [localhost:5000/services](http://localhost:5000/services?namespace=default&field_selector=&label_selector=)
### Example response
```json
{
"services": [
{
"ip": "10.102.245.22",
"labels": {
"service": "hello"
},
"name": "hello-service",
"namespace": "default",
"ports": [
{
"name": "http",
"port": 8080,
"protocol": "TCP"
}
]
}
]
}
```### Build docker container
```
make build
```## Related docs
* [k8s services](https://kubernetes.io/docs/concepts/services-networking/)
* [kubernetes-client for python](https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CoreV1Api.md#list_namespaced_service)## License
MIT