No project description provided
Project description
Kubernetes Secret Generator
This package contains a nice and convienient class to create Kubernetes secret files
It can create secrets from .env files or from files using the
path of the file, and reading them.
installation
pip install k8s-secretgenerator
Examples
Below two examples. One for creation of secrets from files like eg. service account credentials or other files
you want in a variable for Kubernetes.
The other one is an example to generate a secret file from a .env file.
All values will be base64 encoded, just the way Kubernetes likes them.
# Example:
namespace = 'your-awesome-namespace'
# Define file input
credentials = [
{
'secret_name': 'google-credentials',
'namespace': namespace,
'type': 'Opaque',
'input_files': [
{'name': 'service_account.json', 'path': './secrets/service_account.json'},
]
}
]
# Define env file input
env_files = [
{
'secret_name': 'env-vars',
'namespace': namespace,
'type': 'Opaque',
'input_file': '.env'
}
]
manifest_generator = ManifestGenerator(output_dir='secrets')
manifest_generator.create_from_files(credentials)
manifest_generator.create_from_env_files(env_files)
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
Built Distribution
Close
Hashes for k8s-secretgenerator-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a09f5b328c5a27131c16b9c1d9d1569025f5afc65febfdc689e9c03595977ffe |
|
MD5 | be51abe05fbaf3f598b1660318f83743 |
|
BLAKE2b-256 | 88fcaf9bae901503d3b18f68bea64c89bf15803e30faa4f9ce148b32efaecd51 |
Close
Hashes for k8s_secretgenerator-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e52f7d37df76c9d6a114f93d5ae415cac8b93f1350007d9bac6c74fc5415a3 |
|
MD5 | 3cca068ab100f5a30157704f803bff3a |
|
BLAKE2b-256 | f6cf96785d581f2549718b30872adfba11a34c913bd24dbbcce0d687acbd1923 |