Add a new hub in a AWS kops-based cluster¶
The idea behind this guide is showcase the process of setting up a kops-based AWS cluster and manually deploy a new hub on top of it using our deployer tool. This is a preliminary but fully functional and manual process. Once #381 is resolved, we should be able to automate the hub deployment process as we currently do with the GKE-based hubs.
We will continue working toward a definitive one once we figured out some of the discussions outlined in #431.
Deploy the new hub¶
cdback to the root of the repository
Generate a kubeconfig that will be used by the deployer. To do so, run the following command:
KUBECONFIG=secrets/<cluster_name>.yaml kops export kubecfg --admin=730h <cluster_name>hub.k8s.local
Encrypt (in-place) the generated kubeconfig with sops.
sops -i -e secrets/<cluster_name>.yaml
Generate a new config file for your cluster.
You can use of the existing cluster config files as a “template” for your cluster (for example, here is the Farallon Institute config file). You may need to tweak names,
serverIPand singleuser’s images references. Make sure you set up the
profileListsection to be compatible with your kops cluster (ie. match the
node_selectorwith the proper
false. This creates the hubs without trying to give them HTTPS, so we can appropriately create DNS entries for them.
Deploy the hub (or hubs in case you are deploying more than one) without running the test with
python3 deployer deploy <cluster_name> --skip-hub-health-test
Get the AWS external IP for your hub with (supposing your hub is
kubectl -n staging get svc proxy-public
Create a CNAME record for
staging.foo.2i2c.cloudand point it to the AWS external IP.
Wait for about 10 minutes to make sure the DNS records actually resolves properly. If you are deploying
prodhub as well, you will need to repeat this step for
truein the cluster config file so we can get HTTPS.
Finally run the deployer again with
python3 deployer deploy <cluster_name>
This last run should setup HTTPS and finally run a test suite.