Skip to main content

Protect Production Kubernetes Cluster

This tutorial explains how to prevent production Kubernetes cluster from running unauthorized jobs

Assumed Scenario​

Cluster Production should only run job Deploy from branch master in project hierarchy Products; all other jobs should run in cluster Dev

How to Set Up​

  1. Add first job executor of type Kuberetes Executor, give it a name, for instance production, open More Settings to point to production kubectl config, and specify job authorization as below:

    "Project" is "Products/**" and on branch "master" and "Job" is "Deploy"
  2. Add second job executor of type Kuberetes Executor, give it a name, for instance Dev, open More Settings to point to dev kubectl config, and leave job authorization empty to match all jobs

tip

For a particular job, if job executor is not specified, the first authorized executor will be used