Page MenuHomePhabricator

Provision a .kube/config file for all tools
Closed, ResolvedPublic

Description

All tools should have a .kube/config file and a namespace created for them. This should happen automatically on new tool creation. The config file would set the path to the kube master as well as credentials to access it. This allows people to use kubectl if they want to, but primary use case will be the 'webservice' command which will read this file as well.

It should probably be only readable by the tool since there's no reason for them to modify it.

Related Objects

Event Timeline

Small python script that does the following:

  1. Look at all tool users in LDAP
  2. Check if there's an entry in token auth for all of them
  3. For the users that do not have an token auth entry:
    1. Add an entry with an autogenerated password
    2. Create a namespace with proper RunAsUser annotation
    3. Add an entry to abac.json allowing the user access to this namespace
    4. Write a .kube/config file in the user's homedir, readable by them but not writeable
  4. If there were any changes in (3), then restart kube-apiserver.

In the long run, we should replace it with perhaps a CA based authentication setup, but that is a while off.

Change 296747 had a related patch set uploaded (by Yuvipanda):
tools: Provision accounts for all tools

https://gerrit.wikimedia.org/r/296747

Change 296747 merged by Yuvipanda:
tools: Provision accounts for all tools

https://gerrit.wikimedia.org/r/296747

yuvipanda claimed this task.

Done too!