https://github.com/kairen/kubeconfig-generator
Kubeconfig Generator is a tool to generate kubeconfig.
https://github.com/kairen/kubeconfig-generator
kubeconfig kubernetes
Last synced: 6 months ago
JSON representation
Kubeconfig Generator is a tool to generate kubeconfig.
- Host: GitHub
- URL: https://github.com/kairen/kubeconfig-generator
- Owner: kairen
- License: apache-2.0
- Created: 2018-05-29T17:51:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-28T09:30:24.000Z (over 6 years ago)
- Last Synced: 2024-04-28T05:03:40.171Z (over 1 year ago)
- Topics: kubeconfig, kubernetes
- Language: Go
- Homepage:
- Size: 2.75 MB
- Stars: 11
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/kairen/kubeconfig-generator) [](https://hub.docker.com/r/kairen/kubeconfig-generator/)
# LDAP Kubeconfig Generator
Kubeconfig Generator is a tool to generate kubeconfig for Kubernetes auth integration with LDAP.## Building from Source
Clone into your go path under `$GOPATH/src`:
```sh
$ git clone https://github.com/kairen/kubeconfig-generator.git $GOPATH/src/github.com/kairen/kubeconfig-generator.git
$ cd $GOPATH/src/github.com/kairen/kubeconfig-generator.git
$ make
```## Quick Start
In this first, modified the `deploy/deployment.yml` file to match our LDAP and Kubernetes API server endpoint:
```yml
# container args
spec:
template:
spec:
containers:
- name: kubeconfig-generator
image: kairen/kubeconfig-generator:v0.1.0
args:
- serve
- --kube-apiserver-endpoint=https://192.16.35.11:6443
- --ldap-address=192.16.35.20:389
- --ldap-dc=dc=k8s,dc=com
- --user-search-base=ou=People,dc=k8s,dc=com
- --user-name-attribute=givenName
- --user-token-arttribute=kubernetesToken
```And then apply to Kubernetes cluster:
```sh
$ kubectl apply -f deploy/
```To generate the config using kgctl:
```sh
$ kgctl ldap --url http://172.22.132.40:32400 \
--dn "uid=user1,ou=People,dc=k8s,dc=com" \
--password "user1" \
-o test.conf
# output
Generate the Kubernetes config to `test.conf`.$ export KUBECONFIG=test.conf
$ kubectl -n user1 get po
```
> Or access [Web-based UI](https://github.com/ellis-wu/kubeconfig-generator-ui).