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 absolute
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:
import os
namespace = 'your-awesome-namespace'
# Define file input
credentials = [
{
'secret_name': 'google-credentials',
'namespace': namespace,
'type': 'Opaque',
'input_files': [
# Please use the absolute path for input
{'name': 'service_account.json', 'path': 'secrets/service_account.json'},
]
}
]
# Define env file input
env_files = [
{
'secret_name': 'env-vars',
'namespace': namespace,
'type': 'Opaque',
# Please use the absolute path for input
'input_file': '.env'
}
]
# Please use the absolute path for output
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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6929ab1d3a5b9a123546be7b2c6fcf8eb8a697aeb632e6a5ec009b8c03d32862 |
|
MD5 | c597ab446326052d402705f4fa28a1c9 |
|
BLAKE2b-256 | ac13331d1b9b7a2d2b1a31f3ec3e01005d4fc0966ffbf75d4cf80dd60df57f35 |
Close
Hashes for k8s_secretgenerator-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d7961b5c73c601fa8d9318ad852bb92140e75251f8c1abc45cbbe7ad3a5358c |
|
MD5 | de961f08df5ffdbfece4154af5517b3c |
|
BLAKE2b-256 | 76f217f475d8dfd4f07f3a1b6999c06cc98aff77f88dee3a5833b5e626b0131c |