[solved] Error installing istio using istioctl

Hi all,
I’m trying to install istio using istioctl but I receive various errors stating that istioctl

sysop@hoseplak3s:~/software/istio-1.4.3$ sudo istioctl manifest apply --set profile=demo
- Applying manifest for component Base...
Failed to wait for resources ready: Get http://localhost:8080/api/v1/namespaces/istio-system: dial tcp [::1]:8080: connect: connection refused
- Applying manifest for component Galley...
- Applying manifest for component Policy...

Seems that istioctl is looking for the kubernetes apiserver on localhost:8080 but in my installation (I’m using k3s) kubernetes service responds at 10.43.0.1:443

If I use kubectl proxy the address is 127.0.0.1:8001

What I’m doing wrong?

Replying to myself.

For the root user there was a missing file “/root/.kube/config”

Using a k3s installation the step to create the missing file are:

sudo cp /etc/rancher/k3s/k3s.yaml .
sudo sed -i 's:localhost:hoseplak3s:;s:default:TheNameOfYourHost:g' k3s.yaml
sudo KUBECONFIG=~/.kube/config:k3s.yaml kubectl config view --raw > config.tmp
sudo mv config.tmp /root/.kube/config
sudo istioctl manifest apply --set profile=demo

Change TheNameOfYourHost with the output of the hostname command