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
File details
Details for the file k8s-secretgenerator-1.0.5.tar.gz
.
File metadata
- Download URL: k8s-secretgenerator-1.0.5.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6929ab1d3a5b9a123546be7b2c6fcf8eb8a697aeb632e6a5ec009b8c03d32862 |
|
MD5 | c597ab446326052d402705f4fa28a1c9 |
|
BLAKE2b-256 | ac13331d1b9b7a2d2b1a31f3ec3e01005d4fc0966ffbf75d4cf80dd60df57f35 |
File details
Details for the file k8s_secretgenerator-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: k8s_secretgenerator-1.0.5-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d7961b5c73c601fa8d9318ad852bb92140e75251f8c1abc45cbbe7ad3a5358c |
|
MD5 | de961f08df5ffdbfece4154af5517b3c |
|
BLAKE2b-256 | 76f217f475d8dfd4f07f3a1b6999c06cc98aff77f88dee3a5833b5e626b0131c |