Carvel Logo

Command Reference

App Commands

App commands provides options to deploy, delete, inspect and list apps.

deploy

The kapp deploy command can be used to deploy resources as a single app to your cluster.

# Deploy app 'app1' based on config files in config/
$ kapp deploy -a app1 -f config/

# Deploy app 'app1' while showing full text diff
$ kapp deploy -a app1 -f config/ --diff-changes

# Deploy app 'app1' based on remote file
$ kapp deploy -a app1 \
    -f https://github.com/...download/v0.6.0/crds.yaml \
    -f https://github.com/...download/v0.6.0/release.yaml
Supported flags:

Common flags:

  • -a, --app string, Set app name (or label selector) (format: name, label:key=val, !key)
  • -c, --diff-changes boolean, Show changes
  • -f, --file, strings, Set file (format: /tmp/foo, https://…, -) (can repeat)
  • -n, --namespace string, Specified namespace ($KAPP_NAMESPACE or default from kubeconfig)

Diff Flags:

  • --diff-against-last-applied, boolean, Show changes against last applied copy when possible (default true)
  • -c, --diff-changes boolean, Show changes
  • --diff-changes-yaml, boolean, Print YAML to be applied
  • --diff-context, int, Show number of lines around changed lines (default 2)
  • --diff-exit-status, boolean, Return specific exit status based on number of changes
  • --diff-filter string, Set changes filter (example: {“and”:[{“ops”:[“update”]},{“existingResource”:{“kinds”:[“Deployment”]}]})
  • --diff-line-numbers, boolean, Show line numbers (default true)
  • --diff-mask, boolean, Apply masking rules (default true)
  • --diff-run, boolean, Show diff and exit successfully without any further action
  • --diff-summary, boolean, Show diff summary (default true)
  • --diff-ui-alpha, boolean, Start UI server to inspect changes (alpha feature)

Apply flags:

  • --apply-check-interval, duration, Amount of time to sleep between applies (default 1s)
  • --apply-concurrency, int, Maximum number of concurrent apply operations (default 5)
  • --apply-default-update-strategy, string, Change default update strategy
  • --apply-exit-status, boolean, Return specific exit status based on number of changes
  • --apply-ignored, boolean, Set to apply ignored changes
  • --apply-timeout, duration, Maximum amount of time to wait in apply phase (default 15m0s)
  • --dangerous-allow-empty-list-of-resources, boolean, Allow to apply empty set of resources (same as running kapp delete)
  • --dangerous-override-ownership-of-existing-resources, boolean, Steal existing resources from another app
  • --dangerous-ownership-override-allowed-apps, strings, Specify existing apps in the same namespace that existing resources can be stolen from

Wait flags:

  • --wait, boolean, Set to wait for changes to be applied (default true)
  • --wait-check-interval, duration, Amount of time to sleep between checks while waiting (default 3s)
  • --wait-concurrency, int, Maximum number of concurrent wait operations (default 5)
  • --wait-ignored, boolean, Set to wait for ignored changes to be applied
  • --wait-resource-timeout, duration, Maximum amount of time to wait for a resource in wait phase (0s means no timeout)
  • --wait-timeout, duration, Maximum amount of time to wait in wait phase (default 15m0s)

Resource Filter Flags:

  • --filter, string, Set filter (example: {“and”:[{“not”:{“resource”:{“kinds”:[“foo%”]}}},{“resource”:{“kinds”:["!foo"]}}]})
  • --filter-age, string, Set age filter (example: 5m-, 500h+, 10m-)
  • --filter-kind, strings, Set kinds filter (example: Pod) (can repeat)
  • --filter-kind-name, strings, Set kind-name filter (example: Pod/controller) (can repeat)
  • --filter-kind-ns, strings, Set kind-namespace filter (example: Pod/, Pod/knative-serving) (can repeat)
  • --filter-kind-ns-name, strings, Set kind-namespace-name filter (example: Deployment/knative-serving/controller) (can repeat)
  • --filter-labels, strings, Set label filter (example: x=y)
  • --filter-name, strings, Set name filter (example: controller) (can repeat)
  • --filter-ns, strings. Set namespace filter (example: knative-serving) (can repeat)

Resource Validation Flags:

  • --allow-all-ns, boolean, Set to allow all namespaces for resources (does not apply to the app itself)
  • --allow-check, boolean, Enable client-side allowing
  • --allow-cluster, boolean, Set to allow cluster level for resources (does not apply to the app itself)
  • --allow-ns, strings, Set allowed namespace for resources (does not apply to the app itself)

Resource Mangling Flags:

  • --into-ns, string, Place resources into namespace
  • --map-ns, strings, Map resources from one namespace into another (could be specified multiple times)

Logs Flags:

  • --logs, boolean, Show logs from Pods annotated as ‘kapp.k14s.io/deploy-logs’ (default true)
  • --logs-all, boolean, Show logs from all Pods

Available/Other Flags:

  • --app-changes-max-to-keep, int, Maximum number of app changes to keep (default 200)
  • --app-metadata-file-output, string, Set filename to write app metadata
  • --dangerous-disable-gk-scoping, boolean, Disable scoping of resource searching to used GroupKinds
  • --dangerous-ignore-failing-api-services, boolean, Allow to ignore failing APIServices
  • --dangerous-scope-to-fallback-allowed-namespaces, boolean, Scope resource searching to fallback allowed namespaces
  • --default-label-scoping-rules, boolean, Use default label scoping rules (default true)
  • --existing-non-labeled-resources-check, boolean, Find and consider existing non-labeled resources in diff (default true)
  • --existing-non-labeled-resources-check-concurrency, int, Concurrency to check for existing non-labeled resources (default 100)
  • --exit-early-on-apply-error, boolean, Exit quickly on apply failure (default true)
  • --exit-early-on-wait-error, boolean, Exit quickly on wait failure (default true)
  • -h, --help, boolean, help for deploy
  • --labels, strings, Set app label (format: key=val, key=) (can repeat)
  • -p, --patch, boolean, Add or update existing resources only, never delete any
  • --prev-app, string, Set previous app name
  • --sort, boolean, Sort by namespace, name, etc. (default true)
  • --tty, boolean, Force TTY-like output (default true)

inspect

The kapp inspect command can be used inspect the resources present in an app.

# Inspect app 'app1' 
$ kapp inspect -a app1

Supported flags:

  • -a, --app, string, Set app name (or label selector) (format: name, label:key=val, !key)
  • --dangerous-disable-gk-scoping, boolean, Disable scoping of resource searching to used GroupKinds
  • --dangerous-ignore-failing-api-services, boolean, Allow to ignore failing APIServices
  • --dangerous-scope-to-fallback-allowed-namespaces, boolean, Scope resource searching to fallback allowed namespaces
  • --filter, string, Set filter (example: {“and”:[{“not”:{“resource”:{“kinds”:[“foo%”]}}},{“resource”:{“kinds”:["!foo"]}}]})
  • --filter-age, string, Set age filter (example: 5m-, 500h+, 10m-)
  • --filter-kind, strings, Set kinds filter (example: Pod) (can repeat)
  • --filter-kind-name, strings, Set kind-name filter (example: Pod/controller) (can repeat)
  • --filter-kind-ns, strings, Set kind-namespace filter (example: Pod/, Pod/knative-serving) (can repeat)
  • --filter-kind-ns-name, strings, Set kind-namespace-name filter (example: Deployment/knative-serving/controller) (can repeat)
  • --filter-labels, strings, Set label filter (example: x=y)
  • --filter-name, strings, Set name filter (example: controller) (can repeat)
  • --filter-ns, strings, Set namespace filter (example: knative-serving) (can repeat)
  • -h, --help, boolean, help for inspect
  • --managed-fields, boolean Keep the metadata.managedFields when printing objects
  • -n, --namespace, string, Specified namespace ($KAPP_NAMESPACE or default from kubeconfig)
  • --raw, boolean Output raw YAML resource content
  • --status, boolean Output status content
  • -t, --tree, boolean Tree view
  • --tty, boolean Force TTY-like output

list

The kapp list command can be used to list resources present on the cluster.

$ kapp list

Supported flags:

  • -A, --all-namespaces, boolean, List apps in all namespaces
  • --filter-age, string, Set age filter (example: 5m-, 500h+, 10m-)
  • --filter-labels, strings, Set label filter (example: x=y)
  • -h, --help, boolean, help for list
  • -n, --namespace, string, Specified namespace ($KAPP_NAMESPACE or default from kubeconfig)
  • --tty, boolean, Force TTY-like output

logs

The kapp list command can be used to print app’s pod logs.

# Follow all pod logs in app 'app1'
$ kapp logs -a app1 -f

# Show logs from pods that start with 'web'
$ kapp logs -a app1 -f -m web%

Supported flags:

  • -a, --app, string, Set app name (or label selector) (format: name, label:key=val, !key)
  • -c, --container-name, strings, Set container name to filter logs (% acts as wildcard, e.g. ‘app%’) (can repeat)
  • --container-tag, boolean, Include container tag (default true)
  • -f, --follow, boolean, As new pods are added, new pod logs will be printed
  • -h, --help, boolean, help for logs
  • --lines, int, Limit to number of lines (use -1 to remove limit) (default 10)
  • -n, --namespace, string, Specified namespace ($KAPP_NAMESPACE or default from kubeconfig)
  • -m, --pod-name, string, Set pod name to filter logs (% acts as wildcard, e.g. ‘app%’)
  • --tty, boolean, Force TTY-like output

delete

The kapp delete command can be used to delete an app from your cluster.

$ kapp delete -a app1

Supported flags:

  • -a, --app, string, Set app name (or label selector) (format: name, label:key=val, !key)
  • --apply-check-interval, duration, Amount of time to sleep between applies (default 1s)
  • --apply-concurrency, int, Maximum number of concurrent apply operations (default 5)
  • --apply-default-update-strategy, string, Change default update strategy
  • --apply-exit-status, boolean, Return specific exit status based on number of changes
  • --apply-ignored, boolean, Set to apply ignored changes
  • --apply-timeout, duration, Maximum amount of time to wait in apply phase (default 15m0s)
  • --dangerous-disable-gk-scoping, boolean, Disable scoping of resource searching to used GroupKinds
  • --dangerous-ignore-failing-api-services, boolean, Allow to ignore failing APIServices
  • --dangerous-scope-to-fallback-allowed-namespaces, boolean, Scope resource searching to fallback allowed namespaces
  • --diff-against-last-applied, boolean, Show changes against last applied copy when possible (default true)
  • -c, --diff-changes, boolean, Show changes
  • --diff-changes-yaml, boolean, Print YAML to be applied
  • --diff-context, int, Show number of lines around changed lines (default 2)
  • --diff-exit-status, boolean, Return specific exit status based on number of changes
  • --diff-filter, string, Set changes filter (example: {“and”:[{“ops”:[“update”]},{“existingResource”:{“kinds”:[“Deployment”]}]})
  • --diff-line-numbers, boolean, Show line numbers (default true)
  • --diff-mask, boolean, Apply masking rules (default true)
  • --diff-run, boolean, Show diff and exit successfully without any further action
  • --diff-summary, boolean, Show diff summary (default true)
  • --diff-ui-alpha, boolean, Start UI server to inspect changes (alpha feature)
  • --exit-early-on-apply-error, boolean, Exit quickly on apply failure (default true)
  • --exit-early-on-wait-error, boolean, Exit quickly on wait failure (default true)
  • --filter, string, Set filter (example: {“and”:[{“not”:{“resource”:{“kinds”:[“foo%”]}}},{“resource”:{“kinds”:["!foo"]}}]})
  • --filter-age, string, Set age filter (example: 5m-, 500h+, 10m-)
  • --filter-kind, strings, Set kinds filter (example: Pod) (can repeat)
  • --filter-kind-name, strings, Set kind-name filter (example: Pod/controller) (can repeat)
  • --filter-kind-ns, strings, Set kind-namespace filter (example: Pod/, Pod/knative-serving) (can repeat)
  • --filter-kind-ns-name, strings, Set kind-namespace-name filter (example: Deployment/knative-serving/controller) (can repeat)
  • --filter-labels, strings, Set label filter (example: x=y)
  • --filter-name, strings, Set name filter (example: controller) (can repeat)
  • --filter-ns, strings, Set namespace filter (example: knative-serving) (can repeat)
  • -h, --help, boolean, help for delete
  • -n, --namespace, string, Specified namespace ($KAPP_NAMESPACE or default from kubeconfig)
  • --prev-app, string, Set previous app name
  • --tty, boolean, Force TTY-like output (default true)
  • --wait, boolean, Set to wait for changes to be applied (default true)
  • --wait-check-interval, duration, Amount of time to sleep between checks while waiting (default 3s)
  • --wait-concurrency, int, Maximum number of concurrent wait operations (default 5)
  • --wait-ignored, boolean, Set to wait for ignored changes to be applied (default true)
  • --wait-resource-timeout, duration, Maximum amount of time to wait for a resource in wait phase (0s means no timeout)
  • --wait-timeout, duration, Maximum amount of time to wait in wait phase (default 15m0s)

Global Flags

  • --color boolean, Set color output (default true)
  • --column string, Filter to show only given columns
  • --debug boolean, Include debug output
  • -h, --help boolean, help for kctrl
  • --json boolean, Output as JSON
  • --kube-api-burst, int, Set Kubernetes API client burst limit (default 1000)
  • --kube-api-qps float32, Set Kubernetes API client QPS limit (default 1000)
  • --kubeconfig string, Path to the kubeconfig file ($KCTRL_KUBECONFIG),
  • --kubeconfig-contextstring, Kubeconfig context override ($KCTRL_KUBECONFIG_CONTEXT)
  • --kubeconfig-yaml string, Kubeconfig contents as YAML ($KCTRL_KUBECONFIG_YAML)
  • --tty boolean, Force TTY-like output (default true)
  • -v, --version boolean, version for kctrl
  • -y, --yes, boolean, Assumes yes for any prompt

Environment variables

Environment Variables:

  • FORCE_COLOR: set to 1 to force colors to the printed. Useful to preserve colors when piping output such as in kctrl app list --tty --all-namespaces |& less -R

(Help improve our docs: edit this page on GitHub)