This is to provision the base cluster and domain for Student Robotics' Digital Ocean setup.
Obsolete. Replaced by https://github.com/srobo/ansible/
Create your team and project on DigitalOcean.
Export the token on your command line
$ export DIGITALOCEAN_TOKEN=<your token>
Install the Gems
$ bundle install
Provision the environment you want (currently development/production)
$ rake main:provision[development]
Install doctl - to manage your DigitalOcean infrastructure
Install kubectl - to interact with the kubernetes cluster
Switch to your newly created cluster for kubectl
$ doctl k8s cluster kubeconfig save application-cluster-development
The kubernetes provisioning brings up a firewall for the nodes, exposing every port above 30000 to the outside world. For StudentRobotics this isn't ideal, so it's been adjusted manually in the DigitalOcean account so only the load balancer can speak to the nodes directly.
Running Terraform generates state files, which represent what Terraform is
responsible for, and stops it modifying or deleting things it doesn't know
about. When you provision the environment, it will generate some state files,
and place them in the state
directory.
For StudentRobotics, this state currently lives in DigitalOcean Spaces. Meaning when you want to provision the environment, you need to download the latest version from there and upload it when you're done.
Not ideal, and can definitely be improved.