DevOps / Gitlab Interview questions
What is the difference between shell, Docker, and Kubernetes GitLab Runner executors?
The executor determines the environment a GitLab Runner uses to actually run a job's script. Picking the wrong one is a common source of "works on my machine but not in CI" bugs.
| Shell | Docker | Kubernetes |
| Runs jobs directly on the runner's host OS. | Runs each job inside a fresh container from a specified image. | Runs each job as a pod in a Kubernetes cluster. |
| Fast, but environment can drift between runs. | Clean, reproducible environment per job. | Scales elastically with cluster capacity. |
| No isolation between jobs. | Strong isolation via containers. | Strong isolation, plus horizontal scaling. |
| Good for simple, trusted, host-specific tasks. | Good for most standard CI/CD workloads. | Good for large teams needing autoscaling runners. |
Shell executors are the simplest to set up but leave leftover state between builds unless carefully managed. Docker executors are the common default because every job starts from a known, clean image. Kubernetes executors are typically chosen when a team wants runners to scale up and down automatically with cluster load instead of maintaining fixed runner capacity.
More Related questions...