These instructions will help you create a Kubernetes cluster on a set of Nimbus instances. This procedure takes approximately two hours of elapsed time.
Before beginning, ensure that you have a running Ubuntu instance on Nimbus, and that you can connect to it.
1. Install Juju on your seed instance
1.1. Run this command to install Juju. It will take approximately 15 minutes to process.
1.2. When processing completes, list the clouds Juju has preconfigured. Note that Nimbus is not listed:
1.3a. Create a working directory in your home directory:
1.3. Add configuration for a Nimbus cloud.
- Further details can be found at https://juju.is/docs/openstack-cloud
- There should now be a 'nimbus' entry in the listing
1.4. Add your credentials for the Nimbus cloud:
2. Prepare an image for use by Juju
2.1. Run these commands to configure the metadata for an image (click for details). In this case we have given the IMAGE_ID for Ubuntu 18.04.
- Further details can be found at https://juju.is/docs/cloud-image-metadata
3. Use Juju to bootstrap the controller instance
During this step, you need to get the network ID of your private network. This should be connected via your router to the Public external network. You can check this at the Network Topology page. To bootstrap the controller instance:
3.1. Go to the Networks page.
3.2. Click on your network, which will be named something like projectname-network
3.3. Select and copy the ID (not Project ID), ready to paste into the NETID=... command below.
3.4. Back on the seed instance, run the following commands. The final bootstrap command will take approximately 20 minutes to process. While it is running, you can check https://nimbus.pawsey.org.au/horizon/project/instances/ to see a new controller instance being created.
4. Create a new model for the Kubernetes deployment
Models are Juju's concept of a workspace, so it is a good idea to create one for each deployment, to encapsulate them. This is true even with only one deployment. Refer to https://juju.is/docs/models for more information.
4.1. Create the model, then
switch to ensure you are using it.
From here onward, you can revert to this point in the instructions by deleting the model and recreating it:
Then go back and start again from step 4.
5. Use Juju to deploy Kubernetes, install kubectl
5.1. Install Kubernetes.
- Installing Kubernetes takes approximately one hour.
- If you are familiar with the
screenprogram, this would be a good time to use it.
- If you are familiar with the
- View the status command to see installation progress.
- Once everything is active and started the installation is ready to use.
- Note: This approach installs Kubernetes with default machine constraints. For further information, including increasing those constraints, refer to https://jaas.ai/canonical-kubernetes
5.2. While waiting, use another window to install the Kubernetes controller client kubectl. This will take 10 minutes.
6. Configure the kubectl Kubernetes client
6.1. Use the following commands to install and configure the client:
7. (Optional) Run an autoscaling stress test on Kubernetes
7.1. Use the commands below to run a stress test.
- These steps are taken from https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
7.2. Launch a web server deployment and create an autoscaler:
7.3. In a separate window, generate load on the deployment:
7.4. In the first window again, oberve the scaling as it stabilises:
7.5. Stop and delete the pod and autoscaler: