$HOME/.kubectl-login.json
{
"cluster-1": {
"issuer": "https://dex-for-cluster-1.example.com",
"redirectUrl": "https://dex-redirect-for-cluster-1.example.com/callback",
"loginSecret": "some shared secret",
"aliases": ["test"]
},
"cluster-2": {
"issuer": "https://dex-for-cluster-2.example.com",
"redirectUrl": "https://dex-redirect-for-cluster-2.example.com/callback",
"loginSecret": "some shared secret",
"aliases": ["prod"]
}
}
brew install dep
/ brew upgrade dep
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
GOOS=linux GOARCH=amd64 go build -o kubectl-login-linux .
GOOS=darwin GOARCH=amd64 go build -o kubectl-login-darwin .
GOOS=windows GOARCH=amd64 go build -o kubectl-login-windows.exe .
- Upload the binaries and the cluster-login.sh on the release
- rename binary to kubectl-login and put in on your PATH
- run
source ./cluster-login.sh cluster-x
or. ./cluster-login.sh cluster-x