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.post1.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.post1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ksecret-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 7592afbd9ad5a0eccb978051cda9cf7c4b5d6d7df79feb7c7c8c99283fd254c9
MD5 9a9456978a31d82659d2d7ea68f55cab
BLAKE2b-256 4452f7b108f2bb34a37ef510918a4fab8846b6ecbaa86c9517b2746166826bff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ksecret-0.1.0.post1-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.12.9

File hashes

Hashes for ksecret-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8cd7eea3a5f3b7f4fc87247cce0b1d181c91526a6abddaf2285f018a3221fd
MD5 7f14e33f383022512c39832388e6e6e3
BLAKE2b-256 d813142a653f0404e9cd2aef59e570d652e8376b1dd8c2cdec88e4bd2b739db5

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