Skip to main content

Python implementation of the Kubernetes KRM Function Interface

Project description

Kubed KRM

A python Implementation of KRM function by Kustomize and Google.

Random

Generate a random string or number and stamp it into target resource fields. Configure keepers and the value is deterministically derived from the keeper field values — same inputs, same output — like Terraform's random_string. Useful for getting a Job name that only changes when upstream values actually change (a workaround for Kustomize hashing ConfigMap names after all transformers have run).

apiVersion: krm.kubed.io
kind: Random
metadata:
  name: random-string
  annotations:
    config.kubernetes.io/function: |
      exec:
        path: kubectl-kubed
spec:
  type: string
  keepers:
  # explicit fieldPaths on the keeper
  - kind: Deployment
    fieldPaths:
    - /spec/template/spec/containers/0/image
  # inverted control: matched resources declare their own keeper paths via
  # `random.krm.kubed.io/keepers.fieldpaths`. Random falls back to the
  # annotation when the keeper has no explicit fieldPaths.
  - kind: ExternalSecret
    matchLabels:
      app: drupal
  # no fieldPaths and no annotation -> whole resource (annotations stripped)
  - kind: ConfigMap
    name: site-.*
  targets:
  - kind: Job
    fieldPath: /metadata/name
    options:
      delimiter: '-'
      index: 2

See examples/random and docs/transformers/random.md.

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

kubed_krm-0.0.5.tar.gz (57.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kubed_krm-0.0.5-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

Details for the file kubed_krm-0.0.5.tar.gz.

File metadata

  • Download URL: kubed_krm-0.0.5.tar.gz
  • Upload date:
  • Size: 57.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kubed_krm-0.0.5.tar.gz
Algorithm Hash digest
SHA256 25389efbd6f61dd8513e7e66f9c636a0fd39ce9c5056a997b0f05eb08e34e6ab
MD5 c0eb610dbcc826830c7ef4100c5f93bd
BLAKE2b-256 93d2a5812ddb2b0b2c206f27f6499cbb9382bb80b52ceca855db7b0440f9a065

See more details on using hashes here.

Provenance

The following attestation bundles were made for kubed_krm-0.0.5.tar.gz:

Publisher: publish.yml on kubed-io/krm-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kubed_krm-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: kubed_krm-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 63.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kubed_krm-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6072e1fa901312179d7b05d5e5775eec27ca643c74f2015eae37e162471aa2be
MD5 05d36e237c84cfae394d0607eb98ea0e
BLAKE2b-256 55dcc866e1156c3d73e7b050c0034cbe449e0ea7fb10540712c733e3aa456826

See more details on using hashes here.

Provenance

The following attestation bundles were made for kubed_krm-0.0.5-py3-none-any.whl:

Publisher: publish.yml on kubed-io/krm-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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