Sign inSign up

inwinstack/kg-server

By inwinstack

•Updated over 8 years ago

A server to generate kubeconfig.

Image
0

1.1K

inwinstack/kg-server repository overview

Build Status Docker Build Status

⁠Kubeconfig Generator

Kubeconfig Generator is a tool to generate kubeconfig for LDAP, Keystone, ..., etc webhook.

Now support webhook as below:

  • LDAP Webhook.
  • Keystone Webhook.

⁠Building from Source

Clone into your go path under $GOPATH/src/github.com/inwinstack:

$ git clone https://github.com/inwinstack/kubeconfig-generator.git $GOPATH/src/github.com/inwinstack/kubeconfig-generator.git
$ cd $GOPATH/src/github.com/inwinstack/kubeconfig-generator.git
$ make

⁠Quick Start

In this first, modified the deploy/kg-deployment.yml file to match our LDAP and Kubernetes API server endpoint:

# container args
spec:
  template:
    spec:
      containers:
      - name: kg-server
        image: inwinstack/kg-server: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:

$ kubectl apply -f deploy/

To generate the config using kgctl:

$ 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.

web-ui

Tag summary

Content type

Image

Digest

Size

6.8 MB

Last updated

over 8 years ago

docker pull inwinstack/kg-server