https://rancher.com/ logo
Title
b

better-analyst-42417

09/22/2022, 3:27 AM
Hello folks. We setup a k3s single server in the lab using the online instructions and now trying to access its API from a remote windows machine using postman. Can someone please point us to the right direction. We are getting 403 forbidden errors when we try.
c

creamy-pencil-82913

09/22/2022, 4:13 AM
Trying to access what? The Kubernetes apiserver? A service deployed to the cluster? How are you accessing it? 403 suggests that you are not authenticating properly, what are you using for auth? Why are you using postman?
b

better-analyst-42417

09/22/2022, 4:17 AM
Trying to access The Kubernetes apiserver to configure it from an external system
creating deployments and checkng pod statuses etc.
c

creamy-pencil-82913

09/22/2022, 5:57 AM
Ok so how are you authenticating? The default admin kubeconfig uses client cert auth.
b

better-analyst-42417

09/22/2022, 2:03 PM
I found some instructions here "https://rancher.com/docs/k3s/latest/en/installation/kube-dashboard/" to create a service account. I generated a token to authenticate myself. It was working yesterday as follows: "curl -k -XGET -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" https://10.10.10.185:6443/api/v1/pods -k". Today, it doesn't anymore. Is this the recommended method?
c

creamy-pencil-82913

09/22/2022, 5:13 PM
Possibly a dumb question, but do you still have $TOKEN set in your shell?
b

better-analyst-42417

09/22/2022, 5:15 PM
I typed it that way for the channel. I use the real token value in my curl