ks env

Manage ksonnet environments

Synopsis

An environment is a deployment target for your ksonnet app and its constituent
components. You can use ksonnet to deploy a given app to multiple environments,
such as dev and prod.

Intuitively, an environment acts as a sort of “named cluster”, similar to a
Kubernetes context. (Running ks env add --help provides more detail
about the fields that you need to create an environment).

All of this environment info is cached in local files. Metadata such as k8s version, API server address, and namespace are found in app.yaml. Environments are
represented as a hierarchy in the environments/ directory of a ksonnet app, like
‘default’ and ‘us-west/staging’ in the example below.

  1. ├── environments
  2. ├── base.libsonnet
  3. ├── default
  4. ├── globals.libsonnet // Default generated environment ('ks init')
  5. ├── main.jsonnet
  6. └── params.libsonnet
  7. └── us-west
  8. └── staging // Example of user-generated env ('ks env add')
  9. ├── globals.libsonnet
  10. ├── main.jsonnet // Main file that imports all components (expanded on apply, delete, etc). Add environment-specific logic here.
  11. └── params.libsonnet // Customize components *per-environment* here.

  1. ks env [flags]

Options

  1. -h, --help help for env

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
  • ks env add - Add a new environment to a ksonnet application
  • ks env current - Sets the current environment
  • ks env describe - Describe an environment
  • ks env list - List all environments in a ksonnet application
  • ks env rm - Delete an environment from a ksonnet application
  • ks env set - Set environment-specific fields (name, namespace, server)
  • ks env targets - Set target modules for an environment
  • ks env update - Updates the libs for an environment