Operations grimoire/Add a service to Docker PaaS

From Nasqueron Agora

📕📁📜 Old technical information :: content warning

⌛ This Nasqueron Operations Grimoire page hasn't been updated for a long time.

☣ As our infrastructure evolves quickly, there is a good chance this information is outdated or now inaccurate. Be careful and consider update it.

➡️ To assert the information is still up-to-date or not, you can check the history of the relevant role in our Operations repository.

Procedure

To add a service to the Docker PaaS, follow the following steps:

Docker container

  • Prepare a Docker image if none is suitable
  • Deploy dependencies services like databases
  • When you need to interact from the command line with the container, prepare a wrapper script
  • Configure the service in rOPS: pillar/paas/docker.sls
  • Create a new service sls file in rOPS: roles/paas-docker/containers. The name must match the service name in the pillar.

nginx

If you need a nginx configuration, add it (again using service name) in rOPS: roles/­paa­s-d­ock­er/­ngi­nx/­fil­es/­vhosts.

If you don't need to configure anything, just add this in your file: {% include 'roles/paas-docker/nginx/files/vhosts/_default.conf' %}

To deploy your change, use one of the following:

  • salt equatower state_sls roles/paas-docker/nginx/config
  • salt equatower state.sls_id /etc/nginx/vhosts/phabricator/devcentral.conf roles/paas-docker/nginx/config if you need to pinpoint only your change

Replace equatower by the server to target.

Kernel

Kernel for the Docker Engine is configured through sysctl and tuned in rOPS: roles/paas-docker/kernel.

Cheat sheet

A cheat sheet is available at https://www.cheatography.com/dereckson/cheat-sheets/docker-paas/ with the following content: