Kubernetes Intercept Plan

Kubernetes interception is a powerful feature with many configuration options. Specifying the full configuration every time interception is started can be tedious. To simplify this, all interception settings can be defined in the sandbox or Template definition as a plan.

See Kubernetes Development Experience for a detailed overview of how Kubernetes interception works.

Definition

One or more Kubernetes plans can be defined in the customizations section of a sandbox or Template. For example:

workspaces:
- name: dev
customizations:
- kubernetes:
    plan: intercept-1
    cluster: cluster-1
    workloads:
    - namespace: default
      kind: Deployment
      name: hello
      workload: dev
      port_forward:
      - port: 3000
        to: 8000
    ingresses:
    - namespace: default
      kind: Service
      name: hello
      endpoint_name: dev
      custom_headers:
        CustomTrace: 'crafting-{{.SandboxID}}'
    intercept_condition:
      custom_headers:
        CustomTrace: 'crafting-{{.SandboxID}}'

Start with a Plan

From the Web UI, click INTERCEPT K8S, select a predefined plan, and click start. Alternatively, use the CLI:

cs k8s intercept start --plan=intercept-1

Start When a Sandbox Is Created

A plan can be specified in the default flavor of a Template so that it is activated automatically when a sandbox is created from that template.

For example:

customizations:
- flavor:
    name: bestChoice
    default: true
    kubernetes_plan: intercept-1