Michael Delzer Updated by Michael Delzer

Create ~/.kube/config from state file


Create or update kubectl context with Kubernetes key files stored in state file. The context name is stack FQDN, ie. dns.domain. State files are separate command line arguments or separated by comma - to match deploy -s / –state syntax.

hub kubeconfig hub.yaml.state[,s3://bucket/hub.yaml.state] [more.yaml.state] [flags]


  -c, --context string        Context name (default to dns.domain output of kubernetes, stack-k8s-aws, stack-k8s-eks, k8s-aws, k8s-eks, k8s-gke, k8s-metal)
-h, --help help for kubeconfig
-p, --providers string Component name(s) providing Kubernetes outputs (default to kubernetes, stack-k8s-aws, stack-k8s-eks, k8s-aws, k8s-eks, k8s-gke, k8s-metal)
-k, --switch-kube-context Switch current Kubeconfig context to new context

Options inherited from parent commands

      --all-warnings                   Repeat all warnings before [successful] exit (default true)
--api string Hub API service base URL, HUB_API (default "")
--aws_profile string AWS ~/.aws/credentials profile, AWS_PROFILE (default "agilestacks")
--aws_region string AWS region hint (for S3 state access), AWS_DEFAULT_REGION (default "us-east-2")
--aws_use_iam_role_credentials Try EC2 instance credentials (default true)
--cache string API cache file (default is $HOME/.automation-hub-cache.yaml)
--compressed Write gzip compressed files (default true)
--config string Config file (default is $HOME/.automation-hub.{yaml,json})
-d, --debug Print debug info. Or set HUB_DEBUG=1
--encrypted string Write encrypted files if HUB_CRYPTO_PASSWORD is set. true / false (default "if-password-set")
-f, --force Force operation despite of errors. Or set HUB_FORCE=1
--log-destination string stderr or stdout (default "stderr")
-t, --trace Print detailed trace info. Or set HUB_TRACE=1
-v, --verbose Verbose mode (default true)


Automation Hub is a lifecycle and stack composition tool, hub Click Here

How did we do?