ks_validate.md 3.76 KB
Newer Older
Jessica Yao's avatar
Jessica Yao committed
1 2
## ks validate

3
Check generated component manifests against the server's API
Jessica Yao's avatar
Jessica Yao committed
4 5 6 7

### Synopsis


8
The `validate` command checks that an application or file is compliant with the
bryanl's avatar
bryanl committed
9
server APIs Kubernetes specification. Note that this command actually communicates
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
*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.

### Related Commands

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

### Syntax

Jessica Yao's avatar
Jessica Yao committed
27 28

```
bryanl's avatar
bryanl committed
29
ks validate <env-name> [-c <component-name>] [flags]
Jessica Yao's avatar
Jessica Yao committed
30 31 32 33 34 35
```

### Examples

```

36 37 38 39
# Validate all resources described in the ksonnet app, against the server
# specified by the 'dev' environment.
# NOTE: Make sure your current $KUBECONFIG matches the 'dev' cluster info
ksonnet validate dev
Jessica Yao's avatar
Jessica Yao committed
40

41 42 43 44
# Validate resources from the 'redis' component only, against the server specified
# by the 'prod' environment
# NOTE: Make sure your current $KUBECONFIG matches the 'prod' cluster info
ksonnet validate prod -c redis
Jessica Yao's avatar
Jessica Yao committed
45 46 47 48 49 50 51

```

### Options

```
      --as string                      Username to impersonate for the operation
Jessica Yuen's avatar
Jessica Yuen committed
52 53
      --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --certificate-authority string   Path to a cert file for the certificate authority
Jessica Yao's avatar
Jessica Yao committed
54 55 56
      --client-certificate string      Path to a client certificate file for TLS
      --client-key string              Path to a client key file for TLS
      --cluster string                 The name of the kubeconfig cluster to use
bryanl's avatar
bryanl committed
57
  -c, --component stringSlice          Name of a specific component (multiple -c flags accepted, allows YAML, JSON, and Jsonnet)
Jessica Yao's avatar
Jessica Yao committed
58 59 60
      --context string                 The name of the kubeconfig context to use
  -V, --ext-str stringSlice            Values of external variables
      --ext-str-file stringSlice       Read external variable from a file
bryanl's avatar
bryanl committed
61
  -h, --help                           help for validate
Jessica Yao's avatar
Jessica Yao committed
62 63
      --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
  -J, --jpath stringSlice              Additional jsonnet library search path
Jessica Yao's avatar
Jessica Yao committed
64
      --kubeconfig string              Path to a kubeconfig file. Alternative to env var $KUBECONFIG.
Jessica Yao's avatar
Jessica Yao committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
  -n, --namespace string               If present, the namespace scope for this CLI request
      --password string                Password for basic authentication to the API server
      --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")
      --server string                  The address and port of the Kubernetes API server
  -A, --tla-str stringSlice            Values of top level arguments
      --tla-str-file stringSlice       Read top level argument from a file
      --token string                   Bearer token for authentication to the API server
      --user string                    The name of the kubeconfig user to use
      --username string                Username for basic authentication to the API server
```

### Options inherited from parent commands

```
  -v, --verbose count[=-1]   Increase verbosity. May be given multiple times.
```

### SEE ALSO
bryanl's avatar
bryanl committed
83

Jessica Yao's avatar
Jessica Yao committed
84
* [ks](ks.md)	 - Configure your application to deploy to a Kubernetes cluster
Jessica Yao's avatar
Jessica Yao committed
85