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.4.tar.gz (55.6 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.4-py3-none-any.whl (62.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kubed_krm-0.0.4.tar.gz
  • Upload date:
  • Size: 55.6 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.4.tar.gz
Algorithm Hash digest
SHA256 ff04c2f72e2c06303f8d8e7d69f5938fb683de4e8ad0bcb801aff6d4c1741214
MD5 db2ce96816513b2b90aaf13b87988ee3
BLAKE2b-256 262f927335f0865570f0b4f3098ff583d51b96f99e89bb6683bcbc5680e37fcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for kubed_krm-0.0.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: kubed_krm-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 62.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 54194bbdbe59886334753e74d70d1f53c2929d0b8994fac662b3ab32546b2d89
MD5 306b47d7a1c2b4c58fff5ee51dc30f66
BLAKE2b-256 7a7c29ef0e22f1d8957fb3e15c4118282038a8f2e0ab448b559458c25352b87c

See more details on using hashes here.

Provenance

The following attestation bundles were made for kubed_krm-0.0.4-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