Skip to content

docs(cos-lite): revise juju and microk8s installation instructions#334

Open
iamsharduld wants to merge 1 commit intotrack/2from
cos-lite-microk8s-doc-fixes
Open

docs(cos-lite): revise juju and microk8s installation instructions#334
iamsharduld wants to merge 1 commit intotrack/2from
cos-lite-microk8s-doc-fixes

Conversation

@iamsharduld
Copy link
Copy Markdown

@iamsharduld iamsharduld commented May 8, 2026

Issue

Following the cos-lite tutorial as written from a fresh Ubuntu environment (e.g. a default Multipass VM) fails at two points:

  1. juju bootstrap microk8s errors out with juju "3.6.x" can only work with strictly confined microk8s. The tutorial defers to a "Typical setup using snaps" link that, in practice, leads users to install MicroK8s with --classic, which Juju 3.x cannot read the kubeconfig of.
  2. The metallb enable step depends on jq, which is not preinstalled on Ubuntu. IPADDR ends up empty and microk8s enable metallb:- fails with an unclear error.

A smaller related issue: older guides tell users to add themselves to the microk8s group, but strict MicroK8s creates snap_microk8s instead, so the old instruction silently does nothing.

Solution

Rewrite the Prerequisites section of the cos-lite tutorial to be explicit and copy-pastable instead of linking out:

  • Install MicroK8s from a strict channel, with a one-liner showing how to discover a current <k8s-version>-strict/stable rather than pinning a version that goes stale.
  • Add the user to snap_microk8s, with a short note flagging the group name change for readers coming from older guides.
  • Install jq up front so the metallb step works.

Bundle deployment, overlays, Terraform, and the rest of the tutorial are unchanged.

Checklist

Context

Snap confinement is the underlying reason for the bootstrap failure. Strict snaps run in a sandboxed view of the filesystem and can only see paths granted via snap interfaces; classic snaps are unconfined. Juju 3.x ships strict, so it can only resolve a MicroK8s kubeconfig when MicroK8s is also strict and the relevant interfaces (kubernetes-support and credential content-sharing) are wired between them. There is no generic strict↔classic bridge, which is why the failure surfaces as a missing-file error rather than a permissions error.

The snap_microk8s group name follows the standard Canonical convention of prefixing system groups created by strict snaps with snap_.

References:

Testing Instructions

On a fresh Ubuntu environment (Multipass VM with 4 CPU / 8 GB RAM / 40 GB disk recommended):

  1. Follow the updated Prerequisites section verbatim, including the snap info microk8s | grep strict/stable step to pick a channel.
  2. Confirm juju bootstrap microk8s succeeds without the strict-confinement error.
  3. Run through Configure MicroK8s; confirm IPADDR is non-empty and microk8s enable metallb:$IPADDR-$IPADDR succeeds.
  4. Run juju deploy cos-lite --trust and wait for juju status to show all units active/idle.
  5. Run juju run traefik/0 show-proxied-endpoints and confirm proxied URLs are returned.

Upgrade Notes

Users with an existing classic MicroK8s installation must reinstall from a strict channel before the tutorial will work with Juju 3.x:

sudo snap remove microk8s
sudo snap install microk8s --channel=<k8s-version>-strict/stable
sudo usermod -a -G snap_microk8s $USER
newgrp snap_microk8s

Any existing Juju controllers bootstrapped against the classic MicroK8s will need to be re-bootstrapped against the new strict installation. Workloads deployed under the old controller are not migrated automatically.

Updated installation instructions for Juju and MicroK8s to specify the use of strictly confined MicroK8s and added steps for installing jq

Signed-off-by: Shardul Deshpande <iamsharduld@users.noreply.github.com>
@iamsharduld iamsharduld requested a review from MichaelThamm May 8, 2026 06:12
@iamsharduld iamsharduld marked this pull request as ready for review May 8, 2026 06:13
@iamsharduld iamsharduld requested a review from mmkay May 8, 2026 06:25
@iamsharduld
Copy link
Copy Markdown
Author

@YanisaHS Hello, please review if possible :) I couldn't add you to list of reviewers for some reason!

Copy link
Copy Markdown
Contributor

@mmkay mmkay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few notes from me, but I'd be curious to hear @MichaelThamm and @YanisaHS 's thoughts there too. I think the main question is whether we want to guide our users through setting up the prerequisites in the tutorials. What do you think on that?


Follow the instructions there to install Juju and MicroK8s.
Juju 3.x is a strictly confined snap and can only bootstrap a **strictly confined** MicroK8s, so install
MicroK8s from a strict channel (not `--classic`). Strict channels follow the pattern
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if that isn't going slightly too far away from observability itself. Is there a Juju documentation piece we could be referring to here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree with Mateusz here.
image

We have turned the Prerequisites section into a tutorial on its own. I think we can get away with a small statement or note about using --classic and having jq installed and move on.

Copy link
Copy Markdown
Contributor

@MichaelThamm MichaelThamm May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second review: the user can follow the links accordingly:

  1. https://documentation.ubuntu.com/observability/track-2/tutorial/installation/cos-lite-microk8s-sandbox/#getting-started-with-cos-lite-on-microk8s
  2. https://documentation.ubuntu.com/juju/3.6/howto/manage-your-deployment/
  3. https://documentation.ubuntu.com/juju/3.6/howto/manage-your-juju-deployment/set-up-your-juju-deployment/#set-up-your-deployment
  4. https://documentation.ubuntu.com/juju/3.6/reference/cloud/list-of-supported-clouds/#list-of-supported-clouds
  5. https://documentation.ubuntu.com/juju/3.6/reference/cloud/list-of-supported-clouds/the-microk8s-cloud-and-juju/#cloud-kubernetes-microk8s
  6. https://canonical.com/microk8s/docs/getting-started

@iamsharduld I think the latter doc is exactly what you were looking for? This explains:

sudo snap install microk8s --classic --channel=1.35

and

MicroK8s creates a group to enable seamless usage of commands which require admin privilege. To add your current user to the group and gain access to the .kube caching directory, run the following three commands:
sudo usermod -a -G microk8s $USER
mkdir -p ~/.kube
chmod 0700 ~/.kube

You will also need to re-enter the session for the group update to take place:
su - $USER

If your argument is that these instructions for groups is incorrect given that we should use snap_microk8s instead. Please raise an issue with the maintainers there:

```

```{note}
Strict MicroK8s uses the group `snap_microk8s` (older guides referencing the unprefixed `microk8s`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that as long as we have the right group, we don't necessarily need to explain that. IMO this explanation might fit the microk8s documentation more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants