ks diff

Compare manifests, based on environment or location (local or remote)

Synopsis

The diff command displays standard file diffs, and can be used to compare manifests
based on environment or location (‘local’ ksonnet app manifests or what’s running
on a ‘remote’ server).

Using this command, you can compare:

  1. Remote and local manifests for a single environment
  2. Remote manifests for two separate environments
  3. Local manifests for two separate environments
  4. A remote manifest in one environment and a local manifest in another environment

To see the official syntax, see the examples below. Make sure that your $KUBECONFIG
matches what you’ve defined in environments.

When NO component is specified (no -c flag), this command diffs all of
the files in the components/ directory.

When a component IS specified via the -c flag, this command only checks
the manifest for that particular component.

  • ks param diff — Display differences between the component parameters of two environments

Syntax

  1. ks diff <location1:env1> [location2:env2] [flags]

Examples

  1. # Show diff between remote and local manifests for a single 'dev' environment.
  2. # This command diffs *all* components in the ksonnet app, and can be used in any
  3. # of that app's subdirectories.
  4. ks diff remote:dev local:dev
  5. # Shorthand for the previous command (remote 'dev' and local 'dev')
  6. ks diff dev
  7. # Show diff between the remote resources running in two different ksonnet environments
  8. # 'us-west/dev' and 'us-west/prod'. This command diffs all resources defined in
  9. # the ksonnet app.
  10. ks diff remote:us-west/dev remote:us-west/prod
  11. # Show diff between local manifests in the 'us-west/dev' environment and remote
  12. # resources in the 'us-west/prod' environment, for an entire ksonnet app
  13. ks diff local:us-west/dev remote:us-west/prod
  14. # Show diff between what's in the local manifest and what's actually running in the
  15. # 'dev' environment, but for the Redis component ONLY
  16. ks diff dev -c redis

Options

  1. --as string Username to impersonate for the operation
  2. --as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
  3. --certificate-authority string Path to a cert file for the certificate authority
  4. --client-certificate string Path to a client certificate file for TLS
  5. --client-key string Path to a client key file for TLS
  6. --cluster string The name of the kubeconfig cluster to use
  7. -c, --component strings Name of a specific component
  8. --context string The name of the kubeconfig context to use
  9. -V, --ext-str strings Values of external variables
  10. --ext-str-file strings Read external variable from a file
  11. -h, --help help for diff
  12. --insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
  13. -J, --jpath strings Additional jsonnet library search path
  14. --kubeconfig string Path to a kubeconfig file. Alternative to env var $KUBECONFIG.
  15. -n, --namespace string If present, the namespace scope for this CLI request
  16. --password string Password for basic authentication to the API server
  17. --request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
  18. --server string The address and port of the Kubernetes API server
  19. -A, --tla-str strings Values of top level arguments
  20. --tla-str-file strings Read top level argument from a file
  21. --token string Bearer token for authentication to the API server
  22. --user string The name of the kubeconfig user to use
  23. --username string Username for basic authentication to the API server

Options inherited from parent commands

  1. --dir string Ksonnet application root to use; Defaults to CWD
  2. --tls-skip-verify Skip verification of TLS server certificates
  3. -v, --verbose count Increase verbosity. May be given multiple times.

SEE ALSO

  • ks - Configure your application to deploy to a Kubernetes cluster