Portainer Namespace Issue

Hi all, I am new to the forum. I wonder if I can get some help please? I am quite new to kubernetes and have installed microk8s on a one node cluster as a test. I have enabled portainer with “microk8s.kubectl enable portainer” and everything pre-requisite necessary by following this guide https://www.portainer.io/blog/how-to-deploy-portainer-on-microk8s. I am able to open portainer and have created the user and its automatically connected the local environment. The problem is whenever I try to click anything in Portainer, like “Applications”, “Helm”, “Volumes” etc I get an error saying “unable to retrieve namespaces”. Could I get some help on this at all please?

I am having the same issue on a 3-node cluster. Ubuntu 22.04, microk8s 1.24

Help is appreciated!

I have tried to replicate this issue but cannot…

Steps i took:

  1. Deployed a brand new Ubuntu 22.04 VM
  2. Logged in as root
  3. Ran the command “snap install microk8s --classic --channel=1.24”
  4. waited a few minutes, then ran the command “microk8s enable dns metrics-server rbac hostpath-storage”
  5. waited a few minutes, then ran the command “microk8s enable community”
  6. then ran the command “microk8s enable portainer”
  7. ran the command “microk8s kubectl get service -n portainer” to check all is well, and my nodeport is published
  8. opened the portainer UI, set the password, and clicked “get started”
  9. navigate around… no access issues at all

So can you please post the steps you went through to get the issue ?

Neil@Portainer.io

all i can assume is that the portainer service account did not get created for some reason (it should, as part of the deployment)… do a microk8s kubectl get serviceaccounts -n portainer and make sure the account was created by the install script…

1 Like

Hi, I checked the accounts, result:

NAME SECRETS AGE
default 0 47h
portainer-sa-clusteradmin 0 47h

I must add that I have a three-node cluster on three raspberry pi’s. On a single node I had no problems.

I have opened an issue on microk8s at github.

I only tested a single node, as more than one shouldnt matter… will spin up a 3 node and test, just in case…

is your cluster multi-master or single master and 2x workers?

If multi-master, what are you using for cluster-storage?

OK, setup a 3 node cluster…

Cannot replicate your issue.

Here are the steps i went through…

  1. Deployed 3x brand new Ubuntu 22.04 VMs (2 CPU, 4 GB RAM)

  2. Logged in as root on each

  3. on each node, ran the command “snap install microk8s --classic --channel=1.24”

  4. on each node, created host files for each other node. comment out the 127.0.0.1 entry for the hostname (eg mine is below):
    #127.0.1.1 microk8s-01 microk8s-01
    127.0.0.1 localhost
    # The following lines are desirable for IPv6 capable hosts
    ::1 localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    192.241.202.149 microk8s-01
    192.241.204.72 microk8s-02
    192.241.202.212 microk8s-03

  5. on the first node, ran the command “microk8s add-node”

  6. used the result to join the second node

  7. ran the add node command again for 3rd node

  8. waited a few minutes, then on the first node, I ran the command “microk8s status” to check all 3 nodes ok and cluster is in HA mode

  9. on the first node, I ran the command “microk8s enable dns metrics-server rbac hostpath-storage”

  10. waited a few minutes, then ran the command “microk8s enable community”

  11. then ran the command “microk8s enable portainer”

  12. ran the command “microk8s kubectl get service -n portainer” to check all is well, and my nodeport is published

  13. opened the portainer UI, set the password, and clicked “get started”

  14. navigate around… no access issues at all

Note though, without cluster-shared storage, Portainer could be rescheduled on another node, and your config would be lost… Portainer needs cluster-wide persistence, else you need to pin Portainer to just one node.

What did i do differently from your setup?

The difference of my setup with yours is that I am running the kubernetes cluster on 3 physycal raspberry PI nodes.

I did some googling and found out that on the Raspberry PI running Ubuntu 22.04 the VXLAN module is not loaded by default.

Running

sudo apt install linux-modules-extra-5.15.0-1005-raspi linux-modules-extra-raspi

solved the problem.

More info can be found here: High CPU load on newish install (v1.23.5 / arm64 / Ubuntu 22.04) · Issue #3087 · canonical/microk8s · GitHub

Maybe DanW9 (the person who filed this issue) also has ubuntu running on raspberry pi’s.

Hi I am not using running a raspi. I am using Ubuntu.

Sorry for the late reply. I am removing microk8s and going to try again.

Hi @neilatportainer.io I have completely removed microk8s and then rebooted my PC and then installed microk8s classic channel 1.24 as you demonstrated. I have followed exactly the same steps you laid out and I am still getting the same issue. Any ideas? Any help would be appreciated.

Your PC? Is this Ubuntu running under WSL2 or Ubuntu Desktop natively?

when you enabled MicroK8s, did you include rbac?

N

@neilatportainer.io So rbac is enabled. I am running Ubuntu natively.

Hi @neilatportainer.io any ideas at all? I am keen to get started with microk8s.

I will spin up an ubuntu desktop and try this out. What ver of Ubuntu and what arch (x86 or ARM)?

Can you try accessing over the network from another pc? We cannot replicate this…

@neilatportainer.io x86

@neilatportainer.io I don’t understand? I have spun up a single node swarm with microk8s. Are you saying to start up portainer on another pc and then connect to the portainer agent from there? Not quite sure what is being asked? Thank you.

As we cannot replicate this, can you please help by redoing your setup whilst screen recording and then send the recording to me?

I have deployed MicroK8s around 10 times now tryinf different scenarios that might cause your issue and none of them do. So i need to work out whats different with yours.

We even tried Ubuntu desktop…

Neil@portainer.io