microk8s.io icon indicating copy to clipboard operation
microk8s.io copied to clipboard

Update command examples from "Install MicroK8s" section

Open neitsab opened this issue 1 year ago • 1 comments

Summary

The command examples provided at https://microk8s.io/#install-microk8s don't match the experience on a fresh Ubuntu Server 22.04.4 install:

  • prepending sudo is required for all microk8s invocations
  • the dns addon is enabled by default
  • the istio addon isn't spontaneously available anymore.

Process

  • install a fresh ubuntu-server-22.04.4 (tested with aarch64 and amd64) choosing default options
  • once logged in after the reboot, follow the steps at https://microk8s.io/#install-microk8s

Current and expected result

First we observe that sudo is required for microk8s invocation:

$ microk8s status --wait-ready
Insufficient permissions to access MicroK8s.
You can either try again with sudo or add the user neitsab to the 'microk8s' group:

    sudo usermod -a -G microk8s neitsab
    sudo chown -R neitsab ~/.kube

After this, reload the user groups either via a reboot or by running 'newgrp microk8s'.

Secondly, that the dns addon is already enabled by default so trying to enable it manually proves redundant:

$ sudo microk8s status --wait-ready
microk8s is running
high-availability: no
  datastore master nodes: 127.0.0.1:19001
  datastore standby nodes: none
addons:
  enabled:
    dns                  # (core) CoreDNS
    ha-cluster           # (core) Configure high availability on the current node
    helm                 # (core) Helm - the package manager for Kubernetes
    helm3                # (core) Helm 3 - the package manager for Kubernetes

$ sudo microk8s enable dns
Infer repository core for addon dns
Addon core/dns is already enabled

Finally, that the istio addon isn't in the core repository anymore, leading to two different outcomes depending on the architecture:

  • on aarch64 it simply says it wasn't found:
$ sudo microk8s enable istio
Addon istio was not found in any repository
  • on amd64 it suggests enabling the community repo :
$ sudo microk8s enable istio
Addon istio was not found in any repository
To use the community maintained flavor enable the respective repository:

    microk8s enable community

Versions

  • Ubuntu 22.04.4 LTS on both GNU/Linux 5.15.0-105-generic x86_64 or GNU/Linux 6.5.0-1021-oracle aarch64
  • microk8s (1.29/stable) v1.29.2 from Canonical✓ installed

neitsab avatar Apr 24 '24 10:04 neitsab

Regarding the requirement for elevated permissions to use microk8s, as an alternative to using sudo, instructions could be copied from https://ubuntu.com/kubernetes/install#tab-linux__content to "add your user to the microk8s admin group":

MicroK8s creates a group to enable seamless usage of commands which require admin privilege. Use the following commands to join the group:

sudo usermod -a -G microk8s $USER

sudo chown -f -R $USER ~/.kube

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

su - $USER

neitsab avatar Apr 24 '24 12:04 neitsab