ks delete

Remove component-specified Kubernetes resources from remote clusters

Synopsis

The delete command removes Kubernetes resources (described in local
component manifests) from a cluster. This cluster is determined by the mandatory
<env-name>argument.

An entire ksonnet application can be removed from a cluster, or just its specific
components.

This command can be considered the inverse of the ks apply command.

  • ks diff — Compare manifests, based on environment or location (local or remote)
  • ks apply — Apply local Kubernetes manifests (components) to remote clusters

Syntax

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

Examples

  1. # Delete resources from the 'dev' environment, based on ALL of the manifests in your
  2. # ksonnet app's 'components/' directory. This command works in any subdirectory
  3. # of the app.
  4. ks delete dev
  5. # Delete resources described by the 'nginx' component. $KUBECONFIG is overridden by
  6. # the CLI-specified './kubeconfig', so these changes are deployed to the current
  7. # context's cluster (not the 'default' environment)
  8. ks delete --kubeconfig=./kubeconfig -c nginx

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. --grace-period int Number of seconds given to resources to terminate gracefully. A negative value is ignored (default -1)
  12. -h, --help help for delete
  13. --insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
  14. -J, --jpath strings Additional jsonnet library search path
  15. --kubeconfig string Path to a kubeconfig file. Alternative to env var $KUBECONFIG.
  16. -n, --namespace string If present, the namespace scope for this CLI request
  17. --password string Password for basic authentication to the API server
  18. --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")
  19. --server string The address and port of the Kubernetes API server
  20. -A, --tla-str strings Values of top level arguments
  21. --tla-str-file strings Read top level argument from a file
  22. --token string Bearer token for authentication to the API server
  23. --user string The name of the kubeconfig user to use
  24. --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