CLI that help you encode normal string in data fields of Kubernetes secret yaml to base64.
When writing the Kubernetes secret declaration file in YAML format, the value of the data fields must be encoded using base64. I was annoy to just convert each secret one-by-one. Therefore, I built this CLI to help convert the normal secret value to base64 string.
Install Go from https://golang.org
go get -u github.com/thetkpark/k64
go install github.com/thetkpark/k64
To encode from string to base64
k64 encode <filename>
By default the output of that YAML file will be printed to stdout. You can use -o
to write the output to another file or -s
to save output to the save file.
k64 encode <filename> -s
k64 encode <filename> -o <filename>
To decode from base64 to string. The flag -o
and -s
can also be used here.
k64 decode <filename>