Table of Contents
This project allows you to dynamicaly retrive kubeconfig files and use kubelogin for oidc login to authenticate on clusters managed by Cluster API.
You need to have :
- Kubelogin installed on your machine.
- A Kubernetes cluster with Cluster API and child clusters bootstraped with it.
- Your cluster can assign IPs on Services type LoadBalancer.
- kubectl binary
- Deploy the latest kapilogin server release on the Kubernetes with Cluster API :
kubectl kustomize https://github.com/aamoyel/kapilogin/deploy | kubectl apply -f -
- Get the latest release of the CLI and add it in your PATH
-
First, you need to get the LoadBalancer IP use by kapilogin API:
kubectl -n kapilogin get svc kapilogin -o json | jq '.status.loadBalancer.ingress[0].ip'
-
To authenticate on your clusters and define Kapilogin API endpoint, you need to configure Kapilogin. You can use an url to the raw file (eg: https://raw.githubusercontent.com/project/main/kapilogin.yaml) or directly create the file on you system with the command below:
cat <<EOF > $HOME/.kapilogin.yaml kapiloginApiEndpoint: KAPILOGIN_API_ENDPOINT # LoadBalancer IP oidcIssuerUrl: ISSUER_URL oidcClientId: YOUR_CLIENT_ID oidcClientSecret: YOUR_CLIENT_SECRET # Optional EOF
-
To use this configuration you can pass "-c CFG_PATH" to the kapilogin CLI or set the var KAPILOGIN_CONFIG=... (url of local file path)
-
Now, you can use the 'kapilogin' CLI.
kapilogin --help
You can create issues and PRs on this project if you have any problems or suggestions.
Distributed under the Apache-2.0 license. See LICENSE.txt
for more information.
Alan Amoyel - @AlanAmoyel