Kubernetes Endpoint Controller is a program written in Golang that watches Kubernetes service annotations and creates Kubernetes endpoints based on those annotations. This program is meant to watch Cosmos blockchain nodes and determine their health and dynamically remove/add endpoint targets.
Controller will generate Endpoint with correct targets and port assignments based on annotations and service resource.
kubectl
version 1.16 or latergit clone https://github.com/example/endpoint-controller.git
kubectl apply -f k8s
Controller uses environment variables to configure how it behaves | Variable | Description | Default — | — | — SYNC_PERIOD | Reconcile period in seconds| 30 BLOCK_MISS | Allowed missed blocks amount | 6
endpoint-controller/enable
is set to true
endpoint-controller/targets
is a list of Endpoint target IPs
annotations:
endpoint-controller/enable: "true"
endpoint-controller/targets: "1.1.1.1,2.2.2.2,3.3.3.3"
kubectl get endpoints my-service
go build -o bin/endpoint-controller .
or
docker build -t endpoint-controller:latest .
```