https://github.com/sdrozdkov/kubectl-login
Kubectl plugin for re-authenticate into OpenID Connect Provider via CLI
https://github.com/sdrozdkov/kubectl-login
auth authentication kubectl kubectl-plugin kubectl-plugins kubernetes oidc
Last synced: 5 months ago
JSON representation
Kubectl plugin for re-authenticate into OpenID Connect Provider via CLI
- Host: GitHub
- URL: https://github.com/sdrozdkov/kubectl-login
- Owner: sdrozdkov
- License: mit
- Created: 2018-11-08T16:32:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-08T18:25:25.000Z (over 7 years ago)
- Last Synced: 2025-03-31T22:33:06.844Z (about 1 year ago)
- Topics: auth, authentication, kubectl, kubectl-plugin, kubectl-plugins, kubernetes, oidc
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kubectl-plugins - kubectl-login - authenticate into OpenID Connect Provider via CLI | Authn/Authz | [](https://github.com/sdrozdkov/kubectl-login/stargazers) | (kubectl Plugins / Installing plugins via awesome-kubectl-plugins)
README
# kubectl-login
This is a kubectl plugin for login via CLI with OpenID Connect provider (e.g. DEX)
> kubectl-login only compatible with kubectl v1.12 or higher.
But also kubectl-login may used as separate binary.
## Requirements
Your OpenID Connect provider must have this endpoint for kubernetes api client into configuration:
Default callback endponit: `http://localhost:33768/auth/callback`
## Installation
Download and place kubectl-login binary anywhere in your `$PATH` with execute permissions.
For further information, see the offical [plugin documentation](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/).
Or you can compile it by self.
```bash
git clone https://github.com/sdrozdkov/kubectl-login
cd kubectl-login
go build
```
## Usage
Plugin takes OpenID Connect issuer URL from your .kube/config, so it must be placed in your .kube/config.
Use username assigned to your oidc provider:
```bash
kubectl login sdrozdkov-oidc
```
After command executed browser will be opened with redirect to OpenID Connect Provider login page.
Tokens into your .kube/config will be replaced after succesful authenticate at your provider.
## TODO
* Add creation new user profile into .kube/config based on command line args or something else.