Permission manager : RBAC management for Kubernetes

Permission manager : RBAC management for Kubernetes

Photo by Kyle Glenn on Unsplash

Came across a GitHub repository implemented by the awesome folks at Sighup.IO for managing user permissions for Kubernetes cluster easily via web UI.

GitHub Repo :

With Permission Manager, you can create users, assign namespaces/permissions, and distribute Kubeconfig YAML files via a nice&easy web UI. The project works on the concept of templates that you can create and then use that template for different users.Template is directly proportional to clusterrole. In rder to create a new template you need to defile a clusterrole with prefix template-namespaces-resources__. The default template are present in the k8s/k8s-seeds directory.

Example template:

kind: ClusterRole
  name: template-namespaced-resources___developer
  - apiGroups:
      - "*"
      - "configmaps"
      - "endpoints"
      - "persistentvolumeclaims"
      - "pods"
      - "pods/log"
      - "pods/portforward"
      - "podtemplates"
      - "replicationcontrollers"
      - "resourcequotas"
      - "secrets"
      - "services"
      - "events"
      - "daemonsets"
      - "deployments"
      - "replicasets"
      - "ingresses"
      - "networkpolicies"
      - "poddisruptionbudgets"
      # - "rolebindings"
      # - "roles"
      - "*"

Let us now deploy it on Katakoda kubernetes playground and see the permission checker in action.

Step1: Open

Step 2: git clone

Step3: Change the deploy.yaml file

master $ kubectl cluster-info
Kubernetes master is running at [](

update the deployment file “k8s/deploy.yaml” with the CONTROL_PLANE_ADDRESS from the result of the above command.

apiVersion: apps/v1
kind: Deployment
  namespace: permission-manager
  name: permission-manager-deployment
    app: permission-manager
  replicas: 1
      app: permission-manager
        app: permission-manager
      serviceAccountName: permission-manager-service-account
        - name: permission-manager
            - containerPort: 4000
            - name: PORT
              value: "4000"
            - name: CLUSTER_NAME
              value: "my-cluster"
            - name: CONTROL_PLANE_ADDRESS
**              value: ""
**            - name: BASIC_AUTH_PASSWORD
                  name: auth-password-secret
                  key: password

apiVersion: v1
kind: Service
  namespace: permission-manager
  name: permission-manager-service
    app: permission-manager
    - protocol: TCP
      port: 4000
      targetPort: 4000
**  type: NodePort**

Step4: Deploy the manifests

cd permission-manager

master $ kubectl apply -f k8s/k8s-seeds/namespace.yml
namespace/permission-manager created

master $ kubectl apply -f k8s/k8s-seeds
secret/auth-password-secret created
namespace/permission-manager unchanged created created created created created created
serviceaccount/permission-manager-service-account created created created

master $ kubectl apply -f k8s/deploy.yaml
deployment.apps/permission-manager-deployment created
service/permission-manager-service created

Step5: Get the NodePort and open UI using Katakoda

master $ kubectl get svc -n permission-manager
NAME                         TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
permission-manager-service   NodePort   <none>        4000:**31996**/TCP   9m40s

n order to open port from Katakoda click on the + and select View HTTP port 8080 on Host 1 and change the port to 31996

Enter the username and password : username: admin password: 1v2d1e2e67dS You can change the password in k8s/k8s-seeds/auth-secret.yml file.

Now Let us create some users and assign one of the default template.

User Test1 with permission as a developer in permission-manager namespaceUser Test1 with permission as a developer in permission-manager namespace

Let us download the kubeconfig file and test the permissions:

**master $ kubectl --kubeconfig=/root/permission-manager/newkubeconfig get pods
**Error from server (Forbidden): pods is forbidden: User "test1" cannot list resource "pods" in API group "" in the namespace "default"
**master $ kubectl --kubeconfig=/root/permission-manager/newkubeconfig get pods -n permission-manager
**NAME                                             READY   STATUS    RESTARTS   AGE
permission-manager-deployment-544649f8f5-jzlks   1/1     Running   0          6m38s

master $ kubectl get clusterrole | grep template
template-cluster-resources___admin                                     7m56s
template-cluster-resources___read-only                                 7m56s
template-namespaced-resources___developer                              7m56s
template-namespaced-resources___operation                              7m56s

Summary: With permission checker you can easily create multiple users and give permission for specific resources in specific namespace using custom-defined templates.

About Saiyam

Saiyam is a Software Engineer working on Kubernetes with a focus on creating and managing the project ecosystem. Saiyam has worked on many facets of Kubernetes, including scaling, multi-cloud, managed kubernetes services, K8s documentation and testing. He’s worked on implementing major managed services (GKE/AKS/OKE) in different organizations. When not coding or answering Slack messages, Saiyam contributes to the community by writing blogs and giving sessions on InfluxDB, Docker and Kubernetes at different meetups. Reach him on Twitter @saiyampathak where he gives tips on InfluxDB, Rancher, Kubernetes and open source.

We’re hiring!

We are looking for engineers who love to work in Open Source communities like Kubernetes, Rancher, Docker, etc.

If you wish to work on such projects please do visit our job offerings page.