CLI

Skaffold command-line interface provides the following commands:

End-to-end pipelines:

  • skaffold run - to build & deploy once
  • skaffold dev - to trigger the watch loop build & deploy workflow with cleanup on exit

Pipeline building blocks for CI/CD:

Getting started with a new project:

Utilities:

Global flags

Flag Description
-h, --help Prints the HELP file for the current command.
-v, --verbosity LOG-LEVEL Uses a specific log level. Available log levels are info, warn, error, fatal. Default value is warn.

Global environment variables

Flag Description
SKAFFOLD_UPDATE_CHECK Enables checking for latest version of the Skaffold binary. By default it’s true.

Skaffold commands

skaffold

A tool that facilitates continuous development for Kubernetes applications.

Usage:
  skaffold [command]

Available Commands:
  build        Builds the artifacts
  completion   Output shell completion for the given shell (bash or zsh)
  config       A set of commands for interacting with the Skaffold config.
  debug        Runs a pipeline file in debug mode
  delete       Delete the deployed resources
  deploy       Deploys the artifacts
  dev          Runs a pipeline file in development mode
  diagnose     Run a diagnostic on Skaffold
  find-configs Find in a given directory all skaffold yamls files that are parseable or upgradeable with their versions.
  fix          Converts old Skaffold config to newest schema version
  init         Automatically generate Skaffold configuration for deploying an application
  run          Runs a pipeline file
  version      Print the version information

Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")

Use "skaffold [command] --help" for more information about a command.


Env vars:

  • SKAFFOLD_COLOR (same as --color)
  • SKAFFOLD_FORCE_COLORS (same as --force-colors)
  • SKAFFOLD_VERBOSITY (same as --verbosity)

skaffold build

Builds the artifacts

Usage:
  skaffold build

Flags:
  -b, --build-image strings          Choose which artifacts to build. Artifacts with image names that contain the expression will be built only. Default is to build sources for all artifacts
      --cache-artifacts              Set to true to enable caching of artifacts
      --cache-file string            Specify the location of the cache file (default $HOME/.skaffold/cache)
  -d, --default-repo string          Default repository value (overrides global config)
      --enable-rpc skaffold dev      Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string              Filename or URL to the pipeline file (default "skaffold.yaml")
      --insecure-registry strings    Target registries for built images which are not secure
  -n, --namespace string             Run deployments in the specified namespace
  -o, --output *flags.TemplateFlag   Used in conjunction with --quiet flag. Format output with go-template. For full struct documentation, see https://godoc.org/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/flags#BuildOutput (default {{json .}})
  -p, --profile strings              Activate profiles by name
  -q, --quiet                        Suppress the build output and print image built on success. See --output to format output.
      --rpc-http-port int            tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                 tcp port to expose event API (default 50051)
      --skip-tests                   Whether to skip the tests after building
      --toot                         Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_BUILD_IMAGE (same as --build-image)
  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_OUTPUT (same as --output)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_QUIET (same as --quiet)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TOOT (same as --toot)

skaffold completion

Output shell completion for the given shell (bash or zsh)

Usage:
  skaffold completion SHELL

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


skaffold config

A set of commands for interacting with the Skaffold config.

Usage:
  skaffold config [command]

Available Commands:
  list        List all values set in the global Skaffold config
  set         Set a value in the global Skaffold config
  unset       Unset a value in the global Skaffold config

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")

Use "skaffold config [command] --help" for more information about a command.


skaffold config list

List all values set in the global Skaffold config

Usage:
  skaffold config list

Flags:
  -a, --all                   Show values for all kubecontexts
  -c, --config string         Path to Skaffold config
  -k, --kube-context string   Kubectl context to set values against

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_ALL (same as --all)
  • SKAFFOLD_CONFIG (same as --config)
  • SKAFFOLD_KUBE_CONTEXT (same as --kube-context)

skaffold config set

Set a value in the global Skaffold config

Usage:
  skaffold config set

Flags:
  -c, --config string         Path to Skaffold config
  -g, --global                Set value for global config
  -k, --kube-context string   Kubectl context to set values against

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CONFIG (same as --config)
  • SKAFFOLD_GLOBAL (same as --global)
  • SKAFFOLD_KUBE_CONTEXT (same as --kube-context)

skaffold config unset

Unset a value in the global Skaffold config

Usage:
  skaffold config unset

Flags:
  -c, --config string         Path to Skaffold config
  -g, --global                Set value for global config
  -k, --kube-context string   Kubectl context to set values against

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CONFIG (same as --config)
  • SKAFFOLD_GLOBAL (same as --global)
  • SKAFFOLD_KUBE_CONTEXT (same as --kube-context)

skaffold debug

Runs a pipeline file in debug mode

Usage:
  skaffold debug

Flags:
      --cache-artifacts             Set to true to enable caching of artifacts
      --cache-file string           Specify the location of the cache file (default $HOME/.skaffold/cache)
      --cleanup                     Delete deployments after dev or debug mode is interrupted (default true)
  -d, --default-repo string         Default repository value (overrides global config)
      --enable-rpc skaffold dev     Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string             Filename or URL to the pipeline file (default "skaffold.yaml")
      --force                       Recreate kubernetes resources if necessary for deployment (warning: might cause downtime!) (default true)
      --insecure-registry strings   Target registries for built images which are not secure
  -l, --label strings               Add custom labels to deployed objects. Set multiple times for multiple labels
  -n, --namespace string            Run deployments in the specified namespace
      --no-prune                    Skip removing images and containers built by Skaffold
      --no-prune-children           Skip removing layers reused by Skaffold
      --port-forward                Port-forward exposed container ports within pods
  -p, --profile strings             Activate profiles by name
      --rpc-http-port int           tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                tcp port to expose event API (default 50051)
      --skip-tests                  Whether to skip the tests after building
      --tail                        Stream logs from deployed objects (default true)
      --toot                        Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_CLEANUP (same as --cleanup)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_FORCE (same as --force)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_NO_PRUNE_CHILDREN (same as --no-prune-children)
  • SKAFFOLD_PORT_FORWARD (same as --port-forward)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)

skaffold delete

Delete the deployed resources

Usage:
  skaffold delete

Flags:
  -d, --default-repo string   Default repository value (overrides global config)
  -f, --filename string       Filename or URL to the pipeline file (default "skaffold.yaml")
  -n, --namespace string      Run deployments in the specified namespace
  -p, --profile strings       Activate profiles by name

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_PROFILE (same as --profile)

skaffold deploy

Deploys the artifacts

Usage:
  skaffold deploy

Flags:
  -a, --build-artifacts *flags.BuildOutputFileFlag   Filepath containing build output.
                                                     E.g. build.out created by running skaffold build --quiet {{json .}} > build.out
  -d, --default-repo string                          Default repository value (overrides global config)
      --enable-rpc skaffold dev                      Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string                              Filename or URL to the pipeline file (default "skaffold.yaml")
      --force                                        Recreate kubernetes resources if necessary for deployment (default false, warning: might cause downtime!)
  -i, --images *flags.Images                         A list of pre-built images to deploy
  -l, --label strings                                Add custom labels to deployed objects. Set multiple times for multiple labels
  -n, --namespace string                             Run deployments in the specified namespace
  -p, --profile strings                              Activate profiles by name
      --rpc-http-port int                            tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                                 tcp port to expose event API (default 50051)
      --tail                                         Stream logs from deployed objects (default false)
      --toot                                         Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_BUILD_ARTIFACTS (same as --build-artifacts)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_FORCE (same as --force)
  • SKAFFOLD_IMAGES (same as --images)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)

skaffold dev

Runs a pipeline file in development mode

Usage:
  skaffold dev

Flags:
      --cache-artifacts             Set to true to enable caching of artifacts
      --cache-file string           Specify the location of the cache file (default $HOME/.skaffold/cache)
      --cleanup                     Delete deployments after dev or debug mode is interrupted (default true)
  -d, --default-repo string         Default repository value (overrides global config)
      --enable-rpc skaffold dev     Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string             Filename or URL to the pipeline file (default "skaffold.yaml")
      --force                       Recreate kubernetes resources if necessary for deployment (warning: might cause downtime!) (default true)
      --insecure-registry strings   Target registries for built images which are not secure
  -l, --label strings               Add custom labels to deployed objects. Set multiple times for multiple labels
  -n, --namespace string            Run deployments in the specified namespace
      --no-prune                    Skip removing images and containers built by Skaffold
      --no-prune-children           Skip removing layers reused by Skaffold
      --port-forward                Port-forward exposed container ports within pods
  -p, --profile strings             Activate profiles by name
      --rpc-http-port int           tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                tcp port to expose event API (default 50051)
      --skip-tests                  Whether to skip the tests after building
      --tail                        Stream logs from deployed objects (default true)
      --toot                        Emit a terminal beep after the deploy is complete
      --trigger string              How are changes detected? (polling, manual or notify) (default "polling")
  -w, --watch-image strings         Choose which artifacts to watch. Artifacts with image names that contain the expression will be watched only. Default is to watch sources for all artifacts
  -i, --watch-poll-interval int     Interval (in ms) between two checks for file changes (default 1000)

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_CLEANUP (same as --cleanup)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_FORCE (same as --force)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_NO_PRUNE_CHILDREN (same as --no-prune-children)
  • SKAFFOLD_PORT_FORWARD (same as --port-forward)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)
  • SKAFFOLD_TRIGGER (same as --trigger)
  • SKAFFOLD_WATCH_IMAGE (same as --watch-image)
  • SKAFFOLD_WATCH_POLL_INTERVAL (same as --watch-poll-interval)

skaffold diagnose

Run a diagnostic on Skaffold

Usage:
  skaffold diagnose

Flags:
  -f, --filename string   Filename or URL to the pipeline file (default "skaffold.yaml")
  -p, --profile strings   Activate profiles by name

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_PROFILE (same as --profile)

skaffold find-configs

Find in a given directory all skaffold yamls files that are parseable or upgradeable with their versions.

Usage:
  skaffold find-configs

Flags:
  -d, --directory string   Root directory to lookup the config files. (default ".")
  -o, --output string      Result format, default to table. [(-o|--output=)json|table] (default "table")

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_DIRECTORY (same as --directory)
  • SKAFFOLD_OUTPUT (same as --output)

skaffold fix

Converts old Skaffold config to newest schema version

Usage:
  skaffold fix

Flags:
  -f, --filename string   Filename or URL to the pipeline file (default "skaffold.yaml")
      --overwrite         Overwrite original config with fixed config

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_OVERWRITE (same as --overwrite)

skaffold init

Automatically generate Skaffold configuration for deploying an application

Usage:
  skaffold init

Flags:
      --analyze               Print all discoverable Dockerfiles and images in JSON format to stdout
  -a, --artifact strings      '='-delimited dockerfile/image pair to generate build artifact
                              (example: --artifact=/web/Dockerfile.web=gcr.io/web-project/image)
      --compose-file string   Initialize from a docker-compose file
  -f, --filename string       Filename or URL to the pipeline file (default "skaffold.yaml")
      --force                 Force the generation of the Skaffold config
      --skip-build            Skip generating build artifacts in Skaffold config

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_ANALYZE (same as --analyze)
  • SKAFFOLD_ARTIFACT (same as --artifact)
  • SKAFFOLD_COMPOSE_FILE (same as --compose-file)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_FORCE (same as --force)
  • SKAFFOLD_SKIP_BUILD (same as --skip-build)

skaffold run

Runs a pipeline file

Usage:
  skaffold run

Flags:
      --cache-artifacts             Set to true to enable caching of artifacts
      --cache-file string           Specify the location of the cache file (default $HOME/.skaffold/cache)
      --cleanup                     Delete deployments after dev or debug mode is interrupted (default true)
  -d, --default-repo string         Default repository value (overrides global config)
      --enable-rpc skaffold dev     Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string             Filename or URL to the pipeline file (default "skaffold.yaml")
      --force                       Recreate kubernetes resources if necessary for deployment (warning: might cause downtime!) (default true)
      --insecure-registry strings   Target registries for built images which are not secure
  -l, --label strings               Add custom labels to deployed objects. Set multiple times for multiple labels
  -n, --namespace string            Run deployments in the specified namespace
      --no-prune                    Skip removing images and containers built by Skaffold
      --no-prune-children           Skip removing layers reused by Skaffold
  -p, --profile strings             Activate profiles by name
      --rpc-http-port int           tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                tcp port to expose event API (default 50051)
      --skip-tests                  Whether to skip the tests after building
  -t, --tag string                  The optional custom tag to use for images which overrides the current Tagger configuration
      --tail                        Stream logs from deployed objects (default false)
      --toot                        Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_CLEANUP (same as --cleanup)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_FORCE (same as --force)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_NO_PRUNE_CHILDREN (same as --no-prune-children)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TAG (same as --tag)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)

skaffold version

Print the version information

Usage:
  skaffold version

Flags:
  -o, --output *flags.TemplateFlag   Format output with go-template. For full struct documentation, see https://godoc.org/github.com/GoogleContainerTools/skaffold/pkg/skaffold/version#Info (default {{.Version}}
                                     )

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_OUTPUT (same as --output)