Version 1.43 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

Kubernetes objects

What are the relevant Kubernetes objects?

Namespace

./setup/k8s/gen-k8s-config.py (see Generate Config Files) writes some yaml files: services.yaml, scheduler.yaml, and worker.yaml. When you run kubectl apply on those, you create Kubernetes objects: Deployments and Services. Every object is created in the same Namespace (default: “engflow-re”). When you interact with kubectl (or oc), you may need to pass -n engflow-re to tell it which Namespace you mean. You need to create this Namespace before you kubectl apply the yaml files.

Deployments

scheduler.yaml and worker.yaml each declare a Deployment: scheduler-deployment and worker-deployment respectively. They specify the Docker image of the corresponding EngFlow service, the Node Labels where Pods can be deployed, and the Pod Labels used by NodePorts (see below).

Services

Worker and Scheduler processes need to find each other’s Pods. To aid that, services.yaml declares two NodePort Services: all-re-pods-service and scheduler-pods-service. Pods connect to these services and list all service endpoints, and so find each other. To allow Pods listing the Service endpoints, services.yaml also declares a RoleBinding called pod-reader.

Schedulers need a Load Balancer Service with a public IP and port. services.yaml creates this Service object called scheduler-grpc-service. Bazel will connect to the public IP and port of this service.

Last modified 2021-04-21