builtin:kubectl#
Applies a manifest, a directory of manifests, or a kustomization to a Kubernetes cluster, with the kubectl command on the host. See Deploying workloads.
app: {
uses: "builtin:kubectl"
needs: ["cluster"]
with: {
kubeconfig: "${needs.cluster.out.kubeconfig}"
context: "${needs.cluster.out.context}"
manifest: "apiVersion: v1\nkind: Namespace\nmetadata:\n name: demo\n"
}
}| Field | Type | Default | Description |
|---|---|---|---|
kubeconfig | string | - | Required. A path, or a "${...}" expression that reads one from needs, such as "${needs.cluster.out.kubeconfig}". |
context | string | - | Selects the kubeconfig context. Defaults to the kubeconfig’s current-context. |
namespace | string | - | The target namespace for a manifest that names none. |
manifest | string | - | Inline YAML to apply. |
path | string | - | A manifest file or directory, applied with -f. Relative to the project directory unless absolute. |
kustomize | string | - | A kustomization directory, applied with kubectl -k. Relative to the project directory unless absolute. |
server_side | bool | - | Applies with –server-side. |
keep | bool | - | Leaves the applied resources in place on teardown, instead of deleting them. |
Set exactly one of manifest, path, and kustomize.
Behavior#
- Runs
kubectl apply, so running the step again is safe. - Deletes the applied resources on teardown, unless
keepistrue. - Does not wait for the resources to become ready. Add a
builtin:waitstep.