k8s-dotenv
A commandline tool to fetch, merge and convert secrets and config maps in kubernetes to a dot env file.
Install
Download from the Releases page, extract and put in PATH.
Alternatively, use install.sh to download and extract the latest version automatically.
Install as kubectl plugin
Download from the Releases page, extract and put in PATH, rename to kubectl-dotenv.
Alternatively, use install-kubectl.sh to download and extract the latest version automatically.
Documentation
Supported Resource Types
- cronjob
- deployment
- daemonset
- job
- pod
- statefulset
Usage
k8s-dotenv get <resource_type> <RESOURCE_NAME>
Examples
Get Deployment and write to .env
k8s-dotenv get deploy my-deployment
Get DaemonSet and write to out.txt file
k8s-dotenv get ds my-daemonset -f out.txt
Get Job and write output to console (stdout)
k8s-dotenv get job my-job -c
Help
k8s-dotenv --help
Shell Completions
k8s-dotenv comes with shell completions for bash, zsh, fish and powershell built-in. After install, run k8s-dotenv completion --help
for information.