
9/10/2021 · Fernando Diaz
What this post added
This post details the technical steps and configurations required to deploy the GitLab Agent for Kubernetes (`agentk`) with limited permissions. It explains how to configure the agent to operate within specific namespaces by defining custom `Role` and `RoleBinding` resources, and how to limit its cluster-wide access using `ClusterRole` and `ClusterRoleBinding`. The post provides a comprehensive `agentk.yaml` manifest that includes the creation of namespaces, service accounts, deployments, and the necessary RBAC configurations to restrict the agent's write and read access to designated namespaces ('dude') while preventing access to others ('naww'). It also outlines the process of creating the agent record in GitLab and setting up the Kubernetes secret for the agent token.