Kafka K8s

Channel Revision Published Runs on
latest/stable 5 09 Mar 2022
Ubuntu 20.04
latest/edge 27 25 Apr 2023
Ubuntu 22.04
3/stable 56 27 Feb 2024
Ubuntu 22.04
3/candidate 56 27 Feb 2024
Ubuntu 22.04
3/beta 56 27 Feb 2024
Ubuntu 22.04
3/edge 59 18 Apr 2024
Ubuntu 22.04
juju deploy kafka-k8s --channel 3/edge
Show information

Platform:

This is part of the Charmed Kafka Tutorial. Please refer to this page for more information and the overview of the content.

Setup the environment

Multipass is a quick and easy way to launch virtual machines running Ubuntu. It uses “cloud-init” standard to install and configure all the necessary parts automatically.

Let’s install Multipass from Snap and launch a new VM using “charm-dev” cloud-init config:

sudo snap install multipass && \
multipass launch --cpus 4 --memory 8G --disk 30G --name my-vm charm-dev # tune CPU/RAM/HDD accordingly to your needs

Note: all ‘multipass launch’ params are described here.

Multipass list of commands is short and self-explanatory, e.g. show all running VMs:

multipass list

As soon as new VM started, enter inside using:

multipass shell my-vm

Note: if at any point you’d like to leave Multipass VM, enter Ctrl+d or type exit.

All the parts have been pre-installed inside VM already, like MicroK8s, LXD and Juju (the files ‘/var/log/cloud-init.log’ and ‘/var/log/cloud-init-output.log’ contain all low-level installation details). Also, the image already comes with two juju controllers already setup, one for LXD and one for MicroK8s

$ juju list-controllers
Use --refresh option with this command to see the latest information.

Controller  Model     User   Access     Cloud/Region         Models  Nodes    HA  Version
lxd*        tutorial  admin  superuser  localhost/localhost       2      1  none  3.1.5
microk8s    -         admin  superuser  microk8s/localhost        1      1     -  3.1.5

Make sure that you use the controller binded to the MicroK8s cluster, e.g.

juju switch microk8s

The Juju controller can work with different models; models host applications such as Charmed Kafka K8s. Set up a specific model for Charmed Kafka K8s named ‘tutorial’:

juju add-model tutorial

You can now view the model you created above by entering the command juju status into the command line. You should see the following:

Model     Controller  Cloud/Region        Version  SLA          Timestamp
tutorial  microk8s    microk8s/localhost  3.1.5    unsupported  15:46:55+02:00

Model "admin/tutorial" is empty.

Help improve this document in the forum (guidelines). Last updated 2 months ago.