Skip to main content

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

k8s-secretgenerator-1.0.4.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

k8s_secretgenerator-1.0.4-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file k8s-secretgenerator-1.0.4.tar.gz.

File metadata

  • Download URL: k8s-secretgenerator-1.0.4.tar.gz
  • Upload date:
  • Size: 2.6 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

Hashes for k8s-secretgenerator-1.0.4.tar.gz
Algorithm Hash digest
SHA256 710ca8799661290e3b2768f3d7d7cd4c93d12ff3e1641a0949d71a06eba26929
MD5 7f4a6397ea93a5a29b4e3e35c28036e4
BLAKE2b-256 ffd03bec829b6104cbb81ab71b9deba1d13c4abc05142ba697711152c98dedf8

See more details on using hashes here.

Provenance

File details

Details for the file k8s_secretgenerator-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: k8s_secretgenerator-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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

Hashes for k8s_secretgenerator-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 df5100c6deda9daca565a06b75e84fe0a4d492bbb20697dbf057d88f1fcbc57a
MD5 19231a67bfb46fde302071cd9c21bdbd
BLAKE2b-256 a6f242d41a85848bf2fe1d4483199ffec0e12d71d5a70bad401ee971d85aeccc

See more details on using hashes here.

Provenance

Supported by

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