Not Authorized to Access the ARTESCA UI

Problem Description

You are unable to access the ARTESCA UI and receive an error message stating Not Authorized like the following screenshot:

If you remain authenticated and wait longer, you may also see an error similar to this:

Root Cause

This issue occurs when the control plane certificate has expired and has not been properly renewed, preventing the control plane from authenticating the user.

Problem Resolution

To resolve this issue, you need to force the control plane to renew the certificate. To do this, follow these steps:

  1. Apply the state to the bootstrap node to renew the control plane certificate:

    [artesca-os@bootstrap ~]$
    
    sudo salt-call state.sls \
       metalk8s.addons.nginx-ingress-control-plane.certs
    
  2. Export the MetalK8s version you are using as an environment variable:

    [artesca-os@bootstrap ~]$
    
    export MK8SVERSION=`sudo kubectl \
        --kubeconfig=/etc/kubernetes/admin.conf \
        get cm -n kube-system artesca-version \
        -o jsonpath="{.data.metalk8s}"`
    
  3. Renew the dependent resources by running the following command:

    [artesca-os@bootstrap ~]$
    
    sudo kubectl exec -n kube-system -c salt-master \
      --kubeconfig /etc/kubernetes/admin.conf \
      $(sudo kubectl --kubeconfig /etc/kubernetes/admin.conf \
        get pods -n kube-system -l app=salt-master -o name) \
      -- salt-run  state.sls metalk8s.addons.nginx-ingress-control-plane.deployed saltenv=metalk8s-$MK8SVERSION