Portainer Namespace Issue

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?