Multi-node Clusters
Charmed Kubernetes installs CNCF-certified Kubernetes clusters across clouds
Charmed Kubernetes is a fully automated, model-driven approach to installing and managing Kubernetes from bare-metal to the cloud. Build your Kubernetes cloud from the ground up, integrate it with your favorite tools, and create multi-cloud topologies.
These instructions represent the complete set of commands you need to enter into your terminal to install Charmed Kubernetes on AWS.
1. Install LXD
LXD is a system container and VM hypervisor that allows you to create a local cloud. It can be installed via a snap package.
sudo snap install lxd --classic
2. Initialise LXD
LXD provides an interactive dialogue to configure your local cloud during the initialisation procedure:
lxd init
The init script itself may vary depending on the version of LXD. You can use most default options in the dialogue. The important configuration options for Charmed Kubernetes are:
- Networking: Do NOT enable ipv6 networking on the bridge interface
- Storage Pool: Use the ‘dir’ storage type
Running result:
Name of the new storage pool [default=default]:
Name of the storage backend to use (dir, lvm, powerflex, zfs, btrfs, ceph) [default=zfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
Would you like the LXD server to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
3. Install Juju
Juju is a tool for deploying, configuring and operating complex software on public or private clouds. It can be installed with a snap:
sudo snap install juju --classic
4. Add juju controller
The Juju controller is used to manage the software deployed through Juju, from deployment to upgrades to day-two operations. One Juju controller can manage multiple projects or workspaces, which in Juju are known as ‘models’.
Juju comes preconfigured to work with LXD. A cloud created by using LXD containers on the local machine is known as localhost to Juju. To begin, you need to create a Juju controller for this cloud:
juju bootstrap localhost
Running result:
Creating Juju controller "localhost-localhost" on localhost/localhost
Looking for packaged Juju agent version 3.6.0 for amd64
Located Juju agent version 3.6.0-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/3.6.0/juju-3.6.0-linux-amd64.tgz
To configure your system to better support LXD containers, please see: https://documentation.ubuntu.com/lxd/en/latest/explanation/performance_tuning/
Launching controller instance(s) on localhost/localhost...
- juju-77ea8f-0 (arch=amd64)
Installing Juju agent on bootstrap instance
Waiting for address
Attempting to connect to <ipv4-address>:22
Attempting to connect to [<ipv6-address>]:22
Connected to <ipv6-address>
Running machine configuration script...
Bootstrap agent now started
Contacting Juju controller at <ipv4-address> to verify accessibility...
Bootstrap complete, controller "localhost-localhost" is now available
Controller machines are in the "controller" model
Now you can run
juju add-model <model-name>
to create a new model to deploy workloads.
5. Add a Kubernetes model
The model holds a specific deployment. It is a good idea to create a new one specifically for each deployment.
juju add-model k8s
Remember that you can have multiple models on each controller, so you can deploy multiple Kubernetes clusters or other applications.
6. Deploy Kubernetes
Deploy the Kubernetes bundle to the model. This will add instances to the model and deploy the required applications. This can take up to 20 minutes depending on your machine.
juju deploy charmed-kubernetes
7. Monitor the deployment
Juju is now busy creating instances, installing software and connecting the different parts of the cluster together, which can take several minutes. You can monitor what’s going on by running:
watch -c juju status --color
To view the last twenty log messages for the “k8s” model:
juju debug-log -m k8s -n 20
8. Start using your cluster!
Congratulations! You have a Kubernetes cluster up and running - now let’s use it!