Skip to content

qcrisw/kubeconfig-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubeconfig-exporter

A tool to process KUBECONFIG files with secrets as file paths replacing them with actual base64 encoded contents of those secrets. It is useful to move KUBECONFIG (typically generated by minikube) files to different machines. It is safe to invoke it on any YAML file as it does not do the replacement unless it finds the expected paths in the input. It also does not do in-place replacement, and the caller should redirect the output to a file.

Build

docker build . -t kubeconfig-exporter:latest

Run

cat /root/.kube/config | \
  docker run -i --rm \
  -v /root/.minikube:/root/.minikube \
  kubeconfig-exporter:latest > \
    new.kubeconfig

Note that in the above example, the input file is located at /root/.kube/config and this file is referencing paths in /root/.minikube. This is why it has to be mounted inside the container. Also, in this example the output is saved in new.kubeconfig on the host machine.

No-build run

Run directly from Docker Hub by referencing qcrisw/kubeconfig-exporter:latest as the docker image repository:

cat /root/.kube/config | \
  docker run -i --rm \
  -v /root/.minikube:/root/.minikube \
  qcrisw/kubeconfig-exporter:latest > \
    new.kubeconfig

About

A tiny tool to export kubeconfig files by merging certificates and keys inside

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published