Kubernetes plugin: `Failure executing: POST at: https://10.96.0.1/api/v1/namespaces/jenkins-agents/pods. Message: pods is forbidden: User "system:serviceaccount:jenkins:jenkins" cannot create resource "pods" in API group "" in the namespace "jenkins-agents".`
BeginnerTroubleshootingPlugins, JCasC & Kubernetes agents
Answer
Likely causes → Missing Role/RoleBinding for the controller's service account in the agent namespace.
Diagnose →
kubectl auth can-i create pods -n jenkins-agents --as system:serviceaccount:jenkins:jenkins
Fix → Create a Role with pods, pods/exec, pods/log, events permissions in jenkins-agents and bind it to jenkins:jenkins.
Prevent → RBAC in the same Helm chart/manifests as the controller.
More on Plugins, JCasC & Kubernetes agents
Startup log: `SEVERE: Failed Loading plugin Pipeline: Groovy v... (workflow-cps)` with `Update required: Pipeline: Supporting APIs (workflow-support) ... to be updated to ... or higher`IntermediatePlugin fails with `Jenkins (2.426.3) or higher required`BeginnerJCasC fails at startup: `io.jenkins.plugins.casc.ConfiguratorException: Invalid configuration elements for type class jenkins.model.Jenkins : agentProtocols`Intermediate`io.jenkins.plugins.casc.UnknownConfiguratorException: No configurator for the following root elements: sonarGlobalConfiguration`IntermediateJCasC credentials contain the literal text `${GITHUB_TOKEN}` instead of the valueAdvancedAgent pod events: `Failed to pull image "maven:3.9-eclipse-temurin21": manifest unknown` and the build log says `Unable to pull container image "maven:3.9-eclipse-temurin21". Check if image tag name is spelled correctly.`Beginner