Metadata-Version: 2.4
Name: kubed-krm
Version: 0.0.5
Summary: Python implementation of the Kubernetes KRM Function Interface
Author-email: Kelly <admin@kellyferrone.com>
Maintainer-email: Kelly <admin@kellyferrone.com>
Project-URL: Homepage, https://github.com/kubed-io
Project-URL: Documentation, https://github.com/kubed-io/krm-py
Project-URL: Repository, https://github.com/kubed-io/krm-py
Project-URL: Issues, https://github.com/kubed-io/krm-py/issues
Project-URL: Changelog, https://github.com/kubed-io/krm-py/blob/main/CHANGELOG.md
Project-URL: LatestRelease, https://github.com/kubed-io/krm-py/releases
Keywords: kubernetes,krm,kustomize,kubectl,krew
Requires-Python: >=3.10.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.22.0
Requires-Dist: cachetools>=5.2.0
Requires-Dist: jmespath>=1.0.1
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: jsonpatch>=1.33
Requires-Dist: jsonpointer>=2.4
Requires-Dist: netaddr>=0.8.0
Requires-Dist: kubernetes>=33.1.0
Provides-Extra: build
Requires-Dist: invoke; extra == "build"
Requires-Dist: setuptools_scm; extra == "build"
Requires-Dist: build; extra == "build"
Requires-Dist: wheel; extra == "build"
Requires-Dist: twine; extra == "build"
Requires-Dist: pyinstaller; extra == "build"
Requires-Dist: toml; extra == "build"
Requires-Dist: semver; extra == "build"
Dynamic: license-file

# 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`](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/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).

```yaml
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`](examples/random/) and
[`docs/transformers/random.md`](docs/transformers/random.md).
