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: .. code-block:: bash kubectl label nodes nodes.ppc-robot.net/db=true kubectl label nodes nodes.ppc-robot.net/redis=true kubectl label nodes nodes.ppc-robot.net/web=true kubectl label nodes nodes.ppc-robot.net/scheduler=true kubectl label nodes nodes.ppc-robot.net/rate-limiter=true kubectl label nodes nodes.ppc-robot.net/worker-system=true kubectl label nodes nodes.ppc-robot.net/worker-cluster=true kubectl label nodes nodes.ppc-robot.net/worker=true kubectl label nodes nodes.ppc-robot.net/worker-url-check=true To deploy PPC Robot in development, take the following steps (cd to the `kubernetes` directory first): 1. Create SSD volume type and prepare Persistent Volumes: .. code-block:: bash kubectl apply -f development/ssd-storage-class.yml -f development/ssd-volumes.yml 2. Create necessary secrets and configmaps (update the configmaps/secrets if necessary): .. code-block:: bash bash create-configmaps.sh bash create-secrets.sh 3. Deploy PostgreSQL and Redis: .. code-block:: bash kubectl apply -f postgresql.yml -f redis.yml 4. Create database and user for ppc_robot: .. code-block:: bash bash development/create-database.sh 5. Apply development configuration for PPC Robot: .. code-block:: bash kubectl apply -f development/ppc-robot-config.yml 6. Deploy all containers and pods (requires the project to be installed on the machine): .. code-block:: bash fab k8s_deploy_resources **Enabling access to the web UI:** Add the following service that will bind the web UI to NodePort: .. code-block:: bash kubectl apply -f development/ppc-robot-web-nodeport.yml Get the port on which the service was bound using the following command: .. code-block:: bash $ kubectl describe services/ppc-robot-web-nodeport Name: ppc-robot-web-node-port Namespace: default ... NodePort: 31830/TCP ...