If you simply want to logout, you can clear the cache with rm -r ~/.kube/cache/oidc-login
and this will re-trigger the authorization flow with your identity provider. Add an alias if it is something that you often need to do.
In the case you have multiple users, you probably want to define 2 users in your kubeconfig and add the login_hint
parameter with --oidc-auth-request-extra-params=login_hint=username@company.com
. Note that in that case, both user should always be signed in so it works properly. Alternatively, you may want to use --oidc-auth-request-extra-params=prompt=select_account
to always prompt and select the user, regardless if they are signed in or not.
Source: