Skip to content

Latest commit

 

History

History
390 lines (274 loc) · 14.5 KB

_index.md

File metadata and controls

390 lines (274 loc) · 14.5 KB
title linkTitle weight
CLI
CLI
110

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 build

Builds the artifacts

Usage:
  skaffold build

Flags:
  -b, --build-image stringArray      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")
  -n, --namespace string             Run deployments in the specified namespace
  -o, --output *flags.TemplateFlag   Used in conjuction with --quiet flag. Format output with go-template. For full struct documentation, see https://godoc.org/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd#BuildOutput (default {{.}})
  -p, --profile stringArray          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")


skaffold completion SHELL

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")


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")


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")


skaffold delete

Delete the deployed resources

Usage:
  skaffold delete

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)
  -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")
  -n, --namespace string          Run deployments in the specified namespace
  -p, --profile stringArray       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
      --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")


skaffold deploy

Deploys the artifacts

Usage:
  skaffold deploy

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)
  -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")
      --images strings            A list of pre-built images to deploy
  -l, --label stringArray         Add custom labels to deployed objects. Set multiple times for multiple labels.
  -n, --namespace string          Run deployments in the specified namespace
  -p, --profile stringArray       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
      --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")


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 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)
      --experimental-gui          Experimental Graphical User Interface
  -f, --filename string           Filename or URL to the pipeline file (default "skaffold.yaml")
  -l, --label stringArray         Add custom labels to deployed objects. Set multiple times for multiple labels
  -n, --namespace string          Run deployments in the specified namespace
      --port-forward              Port-forward exposed container ports within pods (default true)
  -p, --profile stringArray       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 stringArray   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")


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 stringArray   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")


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")


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 stringArray   '='-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")


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)
  -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")
  -l, --label stringArray         Add custom labels to deployed objects. Set multiple times for multiple labels.
  -n, --namespace string          Run deployments in the specified namespace
  -p, --profile stringArray       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
      --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")


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")