Add Kubernetes context support for executor

What does this MR do?

  • Add ContextName field to KubernetesConfig to specify kubectl context
  • Allow using kubectl context when host is not specified
  • Update documentation to describe the new context option
  • Enables easier connection to specific Kubernetes clusters from kubectl config

This allows users to specify a Kubernetes context name instead of providing explicit host/cert configuration, making it easier to work with multiple clusters configured via kubectl.

Why was this MR needed?

The Kubernetes executor contains a footgun: If no host is specified, it will try to guess the kube config. This can result in accidentally sending local test workloads to a production cluster.

What's the best way to test this MR?

I tested it locally:

[[runners]]
  name = "GDK local runner"
  url = "http://127.0.0.1:3000"
  executor = "kubernetes"
  [runners.kubernetes]
    namespace = "default"
    ...
    context = "rancher-desktop"

What are the relevant issue numbers?

Merge request reports

Loading