Skip to main content

A Kubernetes Secret Helper

Project description

🔑 ksecret: A Kubernetes Secret Helper

ksecret is a command-line tool to simplify the management of Kubernetes Secrets. It provides functionalities to encode, decode, and generate Kubernetes Secret YAML files.

✨ Features

  • 🔐 Encode/Decode Secrets: Easily encode and decode the data field in your Kubernetes Secret files from and to base64.
  • 📝 Generate from .env: Create a Kubernetes Secret YAML file directly from a .env file.
  • 🌱 Generate Environment Variables: Automatically generate Kubernetes env entries for your deployments from Secret and ConfigMap YAML files.

🚀 Installation

You can install ksecret using pip:

pip install ksecret

🛠️ Usage

ksecret provides several commands to help you manage your Kubernetes secrets.

🔒 Encode a Secret

To base64 encode the values in the data field of a Secret YAML file:

ksecret encode my-secret.yaml

This will overwrite the my-secret.yaml file with the encoded data. You can specify an output file using the -o or --output option.

🔓 Decode a Secret

To decode the base64 encoded values in the data field of a Secret YAML file:

ksecret decode my-secret.yaml

This will overwrite the my-secret.yaml file with the decoded data. You can specify an output file using the -o or --output option.

📄 Generate a Secret from a .env file

To generate a Kubernetes Secret YAML file from a .env file:

ksecret generate --name my-secret --namespace my-namespace --env-file .env --output my-secret.yaml

This will create a new file named my-secret.yaml with the generated secret.

🌿 Generate Environment Variables from YAMLs

To generate a list of environment variables for a Kubernetes Deployment from Secret and ConfigMap YAML files:

ksecret generate-env-from-yamls -f my-secret.yaml -f my-configmap.yaml

This will print the env entries to the console. You can save the output to a file using the -o or --output option.

🤝 Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue on the GitHub repository.

📜 License

This project is licensed under the BSD 3-Clause License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ksecret-0.1.0.post2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ksecret-0.1.0.post2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file ksecret-0.1.0.post2.tar.gz.

File metadata

  • Download URL: ksecret-0.1.0.post2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ksecret-0.1.0.post2.tar.gz
Algorithm Hash digest
SHA256 27691c89bad77d17f656feb9726d91c90f06919d905df05c12b483bf1c634be3
MD5 140fc322e63d003285e0f2dbe0866694
BLAKE2b-256 9dd817d92fa57359b8f5789556f56d9b36a3e1038e9322bb0c117ba59f50d2f5

See more details on using hashes here.

File details

Details for the file ksecret-0.1.0.post2-py3-none-any.whl.

File metadata

  • Download URL: ksecret-0.1.0.post2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ksecret-0.1.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 3fdc8db5814fa0e44987d3003f2315a4e5fb0599dd9e0ac405a82e899a04935f
MD5 697e27981cb1ccdb14fa569b2f001f59
BLAKE2b-256 69347a5ff93e74ad998205226a3a306171f6bbbf95f043a1efccadac7d355f8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page