Create a server

A server is created either when a service is moving to a new server, or when a service is being introduced.

Setup

  1. Get the deploy token
  2. Create the server via the host’s interface (below)

Create the server

Bytemark

  1. Login to Bytemark
  2. Click “Servers” and “Add a cloud server”
    1. Enter a Name
    2. Select a Group
    3. Set Location to “York”
    4. Set Server Resources
    5. Set Operating system to “Ubuntu 18.04 (LTS)”
    6. Check Enable backups
    7. Set Take a backup every to 7 days
    8. Set Starting on to the following Thursday at a random time before 10:00 UTC
    9. Set Root user has to “SSH key (+ Password)” and enter your public key
    10. Click “Add this server”
  3. Wait for the server to boot (a few minutes)
  4. Click “Info” and copy the “Hostname/SSH”

Deploy the service

  1. Connect to the server over SSH

    1. Change the password of the root user

    2. Install packages for Agentless Salt:

      apt-get install python-concurrent.futures python-msgpack
      
  2. Update this repository

    1. Add the server to salt-config/roster, using the hostname from above
    2. Add a target to salt/top.sls, if necessary, and include the prometheus-client-apache state
    3. Add a target to pillar/top.sls, if necessary
    4. Add any states, if necessary
    5. If a service is moving to the new server, update occurrences of the old server’s hostname and IP address, as needed
  3. Upgrade packages (can be slow):

    salt-ssh TARGET pkg.upgrade refresh=True dist_upgrade=True
    
  4. Reboot the server:

    salt-ssh TARGET system.reboot
    
  5. Deploy the service (can be slow)

  6. Release the deploy token

Update external services

  1. Add the server to Prometheus
  2. Add (or update) the service’s DNS entries in GoDaddy

If the service is being introduced:

  1. Add its downtime monitor to UptimeRobot
  2. Add its error monitor to Sentry