In this section, we provide instructions on how to set up rbac-manager in your Kubernetes cluster.
Before You Begin
Before diving into the installation and configuration of rbac-manager, please make sure you've reviewed the following points:
Kubernetes Cluster:
Ensure that you have access to a running Kubernetes cluster.
kubectl Command-line Tool:
Ensure you have the kubectl command-line tool installed and properly configured to interact with your Kubernetes cluster.
Access Permissions:
Ensure you have the necessary permissions and access to the Kubernetes cluster to install custom resources and create RBAC policies. You might need cluster admin or similar privileges depending on your cluster setup.
Understanding of RBAC Concepts:
Understanding Kubernetes RBAC concepts, such as cluster roles, roles, rolebindings, clusterrolebindings, and service accounts, is beneficial. If you're new to RBAC, consider reading Kubernetes RBAC documentation as a primer.
Installation using Helm
To install rbac-manager using Helm, you can follow these steps. Ensure you have Helm installed on your system before proceeding.
Step 1: Add the rbac-manager Helm Repository
You'll need to add the rbac-manager Helm repository using the following command:
Step 2: Update the Helm Repositories
Update your Helm repositories to ensure you have the latest information:
Step 3: Install rbac-manager
Now, you can install rbac-manager using Helm.
Advanced Installation Options
You can customize the installation by providing a values.yamlfile with your desired settings.
Replace values.yaml with the path to your configuration file if you're using one.
To access the details of values, use the following command.
Step 4: Verify the Installation
After the Helm installation is complete, you can verify that rbac-manager is running correctly in your Kubernetes cluster.
Use the Helm list command:
You can use kubectl to check the pods, services, and logs. You should see the rbac-manager pods and services listed for the installation.
Step 5: Configure RBAC Policies
Now that rbac-manager is installed, you can create RBAC policies using the RBACPolicy custom resource. Let's use a preset role named SuperAdminRead for a quick demonstration. This role would give cluster-wide read access to all resources.
Apply the above CRD to your cluster using kubectl apply command
Check that the CRD is applied.
Please verify that the following items have been created in the cluster:
Inspect the details of the ClusterRole and ClusterRoleBinding to ensure that only read access is granted.
Based on the RBACPolicy CRD, the rbac-manager operator automatically created the necessary ClusterRole and ClusterRoleBinding.
For guidance on creating more RBACPolicy resources to define access control rules, refer to the documentation.
That's it! You've successfully installed rbac-manager using Helm.