The Project Initializer is a Kubernetes Initializer that automates the creation of the Project namespaces and grants privileges to the appropriate Users.
Build the Project Initializer controller:
./project-initializer/build-containerThis will build and push the container image to Docker Hub.
Deploy the project-initializer controller:
➜ kubectl apply -f project-initializer-k8s/
clusterrolebinding.rbac.authorization.k8s.io/add-on-cluster-admin created
serviceaccount/project-initializer created
deployment.apps/project-initializer createdA ServiceAccount project-initializer was created on kube-system namespace and was given cluster-admin privileges:
➜ kubectl get clusterrolebinding -l app=project-initializer
NAME AGE
add-on-cluster-admin 1m
➜ kubectl describe clusterrolebinding -l app=project-initializer
Name: add-on-cluster-admin
Labels: app=project-initializer
Annotations: ...
Role:
Kind: ClusterRole
Name: cluster-admin
Subjects:
Kind Name Namespace
---- ---- ---------
ServiceAccount project-initializer kube-systemAlso a deployment project-initializer was created on kube-system namespace:
➜ kubectl logs -n kube-system -l app=project-initializer
2018/09/28 14:23:09 using in-cluster configuration
2018/09/28 14:23:09 Starting the Kubernetes project initializer...
2018/09/28 14:23:09 Initializer name set to: project.initializer.kubernetes.io