vmware-archive / photon-controller

Photon Controller
Other
26 stars 3 forks source link

Error in kubectl get pods --all-namespaces #118

Closed ghost closed 7 years ago

ghost commented 7 years ago

[Info] I successfully created a kubenetes cluster using photon controller. However, I failed to create a workable username/password in using kubectl functionalities.

[Photon Platform version] 1.2.0. Released on Jan. 2017 Change-Id: Idee45cd858fb95421eedbc1d61d0226a3b37d350

[Steps to replicate this issue]

  1. Copy kubectl to /usr/local/bin
  2. Username/Password was created using photon service get-kubectl-auth photon service get-kubectl-auth -u administrator@shawn.local \ -p 'VMware1!' 4e6993c6-0f70-4933-abf5-60712f23bd0b
  3. Execute the returned string. The returned result shows User "administrator@shawn.local" set.
  4. Following https://github.com/vmware/photon-controller/wiki/Creating-a-Kubernetes-Cluster to set cluster and context as "default-cluster" and "default-system", respectively. Returned messages are all normal.
  5. Set to use default-system as content.
  6. 'kubectl get pods --all-namespaces' returned Unable to connect to the server: oidc: JWT claims invalid: token is expired

[What's expected] It should return pods information.

AlainRoy commented 7 years ago

If it says it's expired, the most likely cause it that at least one of your systems has the incorrect time. I'd check that first.

shawnho1018 commented 7 years ago

Thanks @AlainRoy. You're right about the incorrect time. The deployed VM was not synchronised with respect to the host, which in turn causes time difference. After configuring VMtool to sync with host, this issue is resolved. Thanks for your and @Michael West's help. Please close the ticket.

AlainRoy commented 7 years ago

Thanks for letting us know.