0

I am writing some backup scripts on bastion node but need to know how we can generate the auto login token for kubeadmin in bash so that after login scripts get executed. General error before login to cluster “error: you must be logged in to the server (unauthorised)”

Or do we need to change the token on every 24h in this command “oc login - -token=sometext - -server=https://example.com/6443”

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – ethry Jul 02 '22 at 21:08
  • You will likely have your best experience creating a ServiceAccount, then exporting that ServiceAccount's token (`oc sa get-token `). This will provide you with a token that doesn't expire. Then you would just need to grant whatever permissions necessary to the ServiceAccount. – Will Gordon Jul 04 '22 at 13:54

0 Answers0