robtuley / rainchasers

River Content & Gauge Data Services
MIT License
5 stars 2 forks source link

Rainchasers Gauge Service

Responsible for retrieving updates from various flavours of river gauges and providing a consistent stream of these through Google Pub/Sub and presenting out a gauge API.

EA Flooding Monitoring API

The EA Hydrology API provides access to quality checked historical data. This is not used yet.

NRW Levels API

This is an authenticated API and requires an API key (from your profile) to be stored in k8s:

kubectl create secret generic -n default nrw-apikey \
--from-literal=key=<your API Key>

SEPA CSV Data

Not Used Yet

Deployment

Deployed onto k8s (GKE), with a continuous deliovery pipeline via Google Cloud Build.

Pub/Sub & Firestore Permissions via Service Account

Following [this process to allow access to pub/sub from the deamons](https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform.

Honeycomb

The k8s cluster needs the Honeycomb API key in a secrets store:

kubectl create secret generic -n default honeycomb-writekey \
  --from-literal=key=<your API Key>

Daemons will post events to Honeycomb alongside JSON structured logs to Stdout.

Algolia

The firestore daemon persists the river state infomation to Algolia SAAS search service and this requires algolia credentials:

kubectl create secret generic -n default algolia-writekey \
  --from-literal=id=<app ID> --from-literal=key=<admin API key>

GKE

The service is designed to be deployed to a Google Cloud k8s cluster.

# setup kubectl access
gcloud config set project rainchasers
gcloud config set compute/zone europe-west2-b
gcloud container clusters get-credentials prod

# create the deployments
kubectl apply -f ./cmd/ea/deployment.yaml
kubectl apply -f ./cmd/nrw/deployment.yaml
kubectl apply -f ./cmd/sepa/deployment.yaml
kubectl apply -f ./cmd/store/deployment.yaml
kubectl apply -f ./cmd/web/deployment.yaml
kubectl apply -f ./cmd/web/service.yaml

# view the web IP
kubectl get service com-rainchasers --output yaml