MicroK8s

  • By Canonical Kubernetes
Channel Revision Published Runs on
latest/stable 32 24 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
latest/beta 20 28 Apr 2022
Ubuntu 22.04 Ubuntu 20.04
latest/edge 32 24 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
juju deploy microk8s
Show information

Platform:

Ubuntu
22.04 20.04

MicroK8s

The smallest, fastest Kubernetes

Single-package fully conformant lightweight Kubernetes that works on 42 flavours of Linux. Perfect for:

  • Developer workstations
  • IoT
  • Edge
  • CI/CD

Usage

This charm deploys and manages a MicroK8s cluster. It can handle scaling up and down.

Minimum Requirements: 1 vCPU and 1GB RAM.

Recommended Requirements: 2 vCPUs and 4GB RAM, 20GB disk.

Make sure to account for extra requirements depending on the workload you are planning to deploy.

juju deploy microk8s --constraints 'cores=2 mem=4G'

Alternatively, to specify the MicroK8s version to install, you can use:

juju deploy microk8s --constraints 'cores=2 mem=4G' --config channel=1.25

Then, retrieve the kubeconfig file with:

mkdir -p ~/.kube
juju run-action microk8s/leader kubeconfig
juju scp microk8s/leader:config ~/.kube/config

In some clouds (e.g. OpenStack), you will need to expose the application before you can access it from the external network:

juju expose microk8s
Addons

Enable addons with:

juju config microk8s addons='storage dns ingress'
Scale Out Usage
juju add-unit -n 2 microk8s
Proxy configuration

In constrained environments, or environments where a proxy should be used for accessing image registries (e.g. DockerHub), you can configure HTTP proxy settings for containerd like so:

echo '
# This file is managed by Juju. Manual changes may be lost at any time.
# Configure limits for locked memory and maximum number of open files
ulimit -n 65536 || true
ulimit -l 16384 || true
# Configure a proxy for containerd
HTTP_PROXY=http://squid.internal:3128
HTTPS_PROXY=http://squid.internal:3128
NO_PROXY=10.0.0.0/8,127.0.0.1,192.168.0.0/16
' > containerd_env
juju config microk8s containerd_env=@containerd_env

Testing

Unit tests
tox
Integration tests

The integration tests require a bootstrapped Juju controller.

./integration_tests.sh

Build from source

charmcraft pack