Kubernetes
This section describes the Kubernetes deployment of PPC Robot - requirements for the cluster, node taints etc.
Kubernetes Version
PPC Robot should be run on Kubernetes 1.10 or newer. All resource types and APIs must be available in the 1.10.
Node Types and Labels
The following node labels are used for pod scheduling:
Label |
Required by |
---|---|
nodes.ppc-robot.net/db |
PostgreSQL database |
nodes.ppc-robot.net/redis |
Redis |
nodes.ppc-robot.net/web |
Web Interface |
nodes.ppc-robot.net/scheduler |
Scheduler |
nodes.ppc-robot.net/worker-system |
System tasks worker |
nodes.ppc-robot.net/worker-cluster |
Cluster management worker |
nodes.ppc-robot.net/worker |
Generic reports worker |
nodes.ppc-robot.net/worker-url-check |
URL Checkers worker |
Values of the label should be set to true
, however, only existence of such label is checked at the moment.
Deployment: Development Cluster
Before you begin, you have to add labels to corresponding nodes:
kubectl label nodes <node> nodes.ppc-robot.net/db=true kubectl label nodes <node> nodes.ppc-robot.net/redis=true kubectl label nodes <node> nodes.ppc-robot.net/web=true kubectl label nodes <node> nodes.ppc-robot.net/scheduler=true kubectl label nodes <node> nodes.ppc-robot.net/rate-limiter=true kubectl label nodes <node> nodes.ppc-robot.net/worker-system=true kubectl label nodes <node> nodes.ppc-robot.net/worker-cluster=true kubectl label nodes <node> nodes.ppc-robot.net/worker=true kubectl label nodes <node> nodes.ppc-robot.net/worker-url-check=true
To deploy PPC Robot in development, take the following steps (cd to the kubernetes directory first):
Create SSD volume type and prepare Persistent Volumes:
kubectl apply -f development/ssd-storage-class.yml -f development/ssd-volumes.yml
Create necessary secrets and configmaps (update the configmaps/secrets if necessary):
bash create-configmaps.sh bash create-secrets.sh
Deploy PostgreSQL and Redis:
kubectl apply -f postgresql.yml -f redis.yml
Create database and user for ppc_robot:
bash development/create-database.sh
Apply development configuration for PPC Robot:
kubectl apply -f development/ppc-robot-config.yml
Deploy all containers and pods (requires the project to be installed on the machine):
fab k8s_deploy_resources
Enabling access to the web UI: Add the following service that will bind the web UI to NodePort:
kubectl apply -f development/ppc-robot-web-nodeport.yml
Get the port on which the service was bound using the following command:
$ kubectl describe services/ppc-robot-web-nodeport
Name: ppc-robot-web-node-port
Namespace: default
...
NodePort: <unset> 31830/TCP
...