How to initialize cloud environment¶
This how-to guide shows you how to initialize the cloud environment where you will deploy your Charmed HPC cluster.
Charmed HPC uses a converged architecture where a machine cloud hosts compute plane applications like the cluster’s workload manager and filesystem, and a Kubernetes (K8s) cloud hosts common control plane applications like identity management and observability services. It is strongly recommended that you pair your machine cloud with a complimenting Kubernetes cloud to simplify the deployment and management of both clouds. For example, LXD should be paired with Canonical Kubernetes, Azure paired with AKS, AWS paired with EKS, and so on.
Note
To Charmed HPC, a cloud (or backing cloud) is any entity that has an API that can provide compute, networking, and optionally storage resources to applications deployed on them. This includes public clouds such as Amazon Web Services, Google Compute Engine, Microsoft Azure and Kubernetes as well as private OpenStack-based clouds. Charmed HPC can also make use of environments, such as MAAS and LXD, which are not necessarily considered clouds, but can be treated as a cloud.
Prerequisites¶
To initialize the cloud environment where you will deploy your Charmed HPC cluster, you will need:
Access to a supported machine cloud
Access to a supported Kubernetes cloud
The Juju CLI client installed on your machine
Initialize machine cloud¶
Follow the instructions below to initialize the charmed-hpc
machine cloud.
Prerequisites for LXD
To use LXD as the machine cloud for your Charmed HPC cluster, you will need to have:
Hint
If you’re unfamiliar with operating an LXD server, see the First steps with LXD tutorial for a high-level introduction to LXD.
Add LXD cloud to Juju
To make your LXD cloud known to Juju, first create the file charmed-hpc-cloud.yaml and enter the following
content, substituting <public address of lxd server>
with the public address of your LXD server:
charmed-hpc-cloud.yaml
¶1clouds:
2 charmed-hpc:
3 type: lxd
4 description: "Machine cloud for Charmed HPC"
5 auth-types: [certificate, interactive]
6 endpoint: <public address of lxd server>
Now, after creating charmed-hpc-cloud.yaml, use juju add-cloud
to add
your LXD cloud to Juju:
juju add-cloud charmed-hpc --file ./charmed-hpc-cloud.yaml
Add LXD cloud credentials to Juju
Before you can start deploying applications on your LXD server, you must add credentials for contacting
your LXD server to Juju. Create the file charmed-hpc-cloud-credentials.yaml and enter the following content, with
<lxd server trust password>
substituted with your LXD server’s configured trust password:
charmed-hpc-cloud-credentials.yaml
¶1credentials:
2 charmed-hpc:
3 accesskey:
4 auth-type: interactive
5 trust-password: <lxd server trust password>
Now use juju add-credential
to add the credentials for contacting your LXD server to Juju:
juju add-credential charmed-hpc --file ./charmed-hpc-cloud-credentials.yaml
Note
Juju will use your LXD server’s configured trust password to automatically retrieve your server’s TLS certificates.
Bootstrap LXD cloud controller
With both your LXD server’s endpoint and credentials added to Juju, use juju bootstrap
to deploy
the cloud controller:
juju bootstrap charmed-hpc charmed-hpc-controller
After a few minutes, your LXD cloud controller will become active. The output of juju status
command should be similar to the following:
user@host:~$
juju status -m controller
Model Controller Cloud/Region Version SLA Timestamp
controller charmed-hpc-controller charmed-hpc/default 3.6.2 unsupported 13:55:33-05:00
App Version Status Scale Charm Channel Rev Exposed Message
controller active 1 juju-controller 3.6/stable 116 no
Unit Workload Agent Machine Public address Ports Message
controller/0* active idle 0 10.190.89.114
Machine State Address Inst id Base AZ Message
0 started 10.190.89.114 juju-3b4cde-0 ubuntu@24.04 Running
Initialize Kubernetes cloud¶
After initializing the charmed-hpc
machine cloud, follow the instructions below to initialize the
charmed-hpc-k8s
Kubernetes cloud.
Prerequisites for Canonical Kubernetes
To use Canonical Kubernetes as the Kubernetes cloud for your Charmed HPC cluster, you will need to have:
Hint
If you’re unfamiliar with operating a Canonical Kubernetes cluster, see the Canonical Kubernetes tutorials for a high-level introduction to Canonical Kubernetes.
Add Canonical Kubernetes cloud to deployed controller
To make your Canonical Kubernetes cloud known to Juju and use the same controller as your
machine cloud, pipe the output of k8s config
to juju add-k8s
by running the
following command:
sudo k8s config | \
juju add-k8s --controller charmed-hpc-controller charmed-hpc-k8s
juju add-k8s
will immediately add your Canonical Kubernetes cloud to the controller of your machine
cloud. The output of juju clouds
should be similar to the following:
user@host:~$
juju clouds --controller charmed-hpc-controller
Clouds available on the controller:
Cloud Regions Default Type
charmed-hpc 1 default lxd
charmed-hpc-k8s 1 default k8s
Next Steps¶
Now that both the charmed-hpc
machine cloud and charmed-hpc-k8s
Kubernetes cloud are initialized,
you can start deploying applications with Juju. Go to the How to deploy Slurm guide
for how to deploy Slurm as the workload manager of your Charmed HPC cluster.