ks validate

Check generated component manifests against the server’s API

Synopsis

The validate command checks that an application or file is compliant with the
server APIs Kubernetes specification. Note that this command actually communicates
with the server for the specified <env-name>, so it only works if your
$KUBECONFIG specifies a valid kubeconfig file.

When NO component is specified (no -c flag), this command checks all of
the files in the components/ directory. This is the same as what would
get deployed to your cluster with ks apply <env-name>.

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

  • ks show — Show expanded manifests for a specific environment.
  • ks apply — Apply local Kubernetes manifests (components) to remote clusters

Syntax

  1. ks validate <env-name> [-c <component-name>] [flags]

Examples

  1. # Validate all resources described in the ksonnet app, against the server
  2. # specified by the 'dev' environment.
  3. # NOTE: Make sure your current $KUBECONFIG matches the 'dev' cluster info
  4. ksonnet validate dev
  5. # Validate resources from the 'redis' component only, against the server specified
  6. # by the 'prod' environment
  7. # NOTE: Make sure your current $KUBECONFIG matches the 'prod' cluster info
  8. ksonnet validate prod -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 (multiple -c flags accepted, allows YAML, JSON, and Jsonnet)
  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 validate
  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