KSec is a command line tool to manage secrets in Kubernetes with the following functionallities:
- Create a secret from an env file
- Append a secret to an existing secret
- Get a secret from Kubernetes secrets
- Delete a secret from Kubernetes secrets
- List all secrets in a namespace
- Fill a file with a secret from Kubernetes secrets
- Modify a secret in Kubernetes secrets using an editor
to install Ksec use the following command:
go install github.com/karim-w/ksec
ksec -e <.env file path> -n <namespace> -s <secret name>
this command will :
- create a secret from the env file and will add it to the kubernetes secrets
- create a yaml file with the env config map
ksec -w <.env file path> -n <namespace> -s <secret name> -a
this commmand will add a secret to a existing secret in kubernetes secrets
ksec -l -n <namespace> -s <secret name>
this command will retrieve the secrets embedde in a kubernetes secrets
ksec -g -n <namespace> -s <secret name> -k <key>
this command will retrieve a the value of secret within an existing kubernetes secret
ksec -d -n <namespace> -s <secret name> -k <key>
this command will delete a secret from an existing kubernetes secret
ksec -f <file path> -n <namespace> -s <secret name>
ksec -m -n <namespace> -s <secret name>
ksec -m -n <namespace> -s <secret name> -F <file format: json/yaml>