Canonical's Sunbeam MicroStack is an open-source project designed to enable users to effortlessly deploy a fully-functional OpenStack environment on their workstation or even a virtual machine (VM) within minutes. Leveraging snaps, Juju and Kubernetes, MicroStack provides essential core services, prioritizing efficiency and scalability in cloud deployment and administration
Requirements
Before proceeding with the deployment, ensure your system meets the following requirements:
Operating System: Ubuntu 22.04 LTS Server
CPU: 4 cores, AMD64 only
RAM: 16 GiB
Root Disk: 100 GiB free space (SSD recommended)
Internal Network: 1 Gbps (minimal requirement)
External Network: 1 Gbps (required for remote access)
Optional Storage: 1 x 100 GiB SSD (required for block storage service)
Our Setup
For this guide, we shall deploy MicroStack on a single node with the following specifications:
Ubuntu Server: 22.04 LTS
CPU: 8 cores
RAM: 16 GiB
Root Disk: 100 GiB
IP address: 10.0.100.43
Range of IP addresses for loadbalancer: 10.0.100.41-10.0.100.43
Networking: Two NICs, with the second NIC utilized for external traffic for guest machines
Installation
Let's begin the deployment process step by step:
Step 1: Patch the System
Ensure your Ubuntu Server is up to date by running:
sudo apt-get update && sudo apt-get upgrade -y
Step 2: Install MicroK8s
Install MicroK8s using the following command:
sudo snap install microk8s --classic --channel=1.26-strict/stable
After installation, check the status of MicroK8s using :
microk8s status
If you see a warning like this, then create a directory at your home directory.
mkdir ~/.kube
Step 3: Create user for the service
Now we need to add the local user to the 'snap_microk8s' group. Please follow the below given commands.
sudo usermod -a -G snap_microk8s user
sudo chown -R user ~/.kube
newgrp snap_microk8s
Step 4: MicroK8s configuration
To enable DNS for MicroK8s to use public DNS, if you prefer to add your own DNS server, replace the IP addresses with your DNS servers.
sudo microk8s enable dns:8.8.8.8,8.8.4.4
Now, we will enable MetalLB local balancer for OpenStack's services. In accordance with my environment setup, I will assign a preferred IP address range for OpenStack's services. You may use this range according to your setup.
sudo microk8s enable metallb 10.0.100.41-10.0.100.43
Note: Replace the IP address range, according to your setup. Now we need to stop renewable of certificates, run the following command to do that.
sudo touch /var/snap/microk8s/current/var/lock/no-cert-reissue
Step 5: Install OpenStack
Install OpenStack and related components:
sudo snap install openstack --channel 2023.1
sudo snap install openstack-hypervisor
sudo snap install openstackclients
Step 6: Prepare Server Node
Generate initial configuration script and start setup:
sunbeam prepare-node-script | bash -x && newgrp snap_daemon
Step 7: Prepare Server Node
Initiate the bootstrap process:
sunbeam cluster bootstrap
You will be prompted to confirm the management network, which corresponds to your host's network. Simply press 'Enter' to confirm. In the subsequent prompt, we need to specify the IP range for the MetalLB load balancer.
Please note that the setup process may take up to half an hour to complete, depending on your server's hardware configuration.
Important: If you encounter a 'Minimum system requirements (4 core CPU, 16 GB RAM) not met.' warning, you can safely disregard it.
Step 8: Initial Setup of MicroStack
Setup user, domain, and network for demo user:
sunbeam configure --openrc demo-openrc
I have provided the details according to my setup environment here, which will generate a demo-openrc file. This file is used to access OpenStack from the command line terminal.
As depicted in the image above, I have allocated the enp7s0 NIC for external traffic for guest VMs (enp7s0 is utilized as the bridge-port of br-ex). However, ensure that the NIC is in the UP state. If it is not, execute the following command to activate it.
sudo ip link set enp7s0 up
Step 9: Access the Dashboard
Get the dashboard URL.
juju status -m openstack horizon
As we can see in the above picture, highlighted line is the URL of dashboard for MicroStack. (It might be different for your environment)
http://10.0.100.43/openstack-horizon is my WebUI URL for the OpenStack.
Open your browser and go to the above URL.
Username: demo
Password:
Domain: users
Then click on the Sign in button.
Step 10: Launch a Test Instance
Create a test instance on MicroStack, either we can use Web dashboad, openstack CLI or sunbeam command.
sunbeam launch ubuntu --name test
Then, we will see SSH command in the output to login test guest instance.
Generate the openrc file for admin user, run following command.
sunbeam openrc > admin-openrc
source admin-openrc
Now, we can use "openstack" command to interact with our MicroStack.
Conclusion
In conclusion, deploying Canonical’s Sunbeam MicroStack presents an opportunity for businesses to streamline their cloud infrastructure with efficiency and ease. Throughout this guide, we've explored the step-by-step process of setting up MicroStack on a single Ubuntu server, leveraging its Kubernetes-native architecture to simplify OpenStack deployment. By adhering to the outlined requirements and following the deployment steps meticulously, businesses can establish a robust cloud environment tailored to their needs. With MicroStack's compact yet powerful design, small-scale enterprises can benefit from essential core services without the complexity of traditional OpenStack deployments.
As cloud computing continues to evolve, embracing solutions like Sunbeam MicroStack empowers businesses to adapt, innovate, and scale their operations effectively. Whether it's optimizing resource utilization, enhancing data management, or facilitating seamless access to cloud services, MicroStack offers a versatile platform for modern cloud deployment needs.
In essence, Canonical’s Sunbeam MicroStack embodies simplicity, scalability, and reliability, making it a compelling choice for businesses seeking to harness the power of cloud computing. As you embark on your MicroStack journey, remember that innovation thrives on simplicity, and with MicroStack, the possibilities are endless.