An open API service indexing awesome lists of open source software.

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

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