{"id":18797475,"url":"https://github.com/noris-network/kustomize-generalreplacementstransformer","last_synced_at":"2026-05-08T04:02:22.370Z","repository":{"id":57659107,"uuid":"472780146","full_name":"noris-network/kustomize-generalreplacementstransformer","owner":"noris-network","description":"A kustomize transformer plugin","archived":false,"fork":false,"pushed_at":"2022-09-16T07:44:32.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-29T17:53:38.802Z","etag":null,"topics":["go","golang","kubernetes","kustomize","plugin","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noris-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-22T13:28:57.000Z","updated_at":"2022-09-16T07:18:03.000Z","dependencies_parsed_at":"2022-08-29T09:20:12.286Z","dependency_job_id":null,"html_url":"https://github.com/noris-network/kustomize-generalreplacementstransformer","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noris-network%2Fkustomize-generalreplacementstransformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noris-network%2Fkustomize-generalreplacementstransformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noris-network%2Fkustomize-generalreplacementstransformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noris-network%2Fkustomize-generalreplacementstransformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noris-network","download_url":"https://codeload.github.com/noris-network/kustomize-generalreplacementstransformer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727054,"owners_count":19687098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","kubernetes","kustomize","plugin","yaml"],"created_at":"2024-11-07T22:08:23.379Z","updated_at":"2026-05-08T04:02:22.313Z","avatar_url":"https://github.com/noris-network.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kustomize-generalreplacementstransformer\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/noris-network/kustomize-generalreplacementstransformer)](https://goreportcard.com/report/github.com/noris-network/kustomize-generalreplacementstransformer)\n[![Latest Release](https://img.shields.io/github/v/release/noris-network/kustomize-generalreplacementstransformer?sort=semver)](https://github.com/noris-network/kustomize-generalreplacementstransformer/releases/latest)\n[![License](https://img.shields.io/github/license/noris-network/kustomize-generalreplacementstransformer)](https://github.com/noris-network/kustomize-generalreplacementstransformer/blob/main/LICENSE)\n\n## What is this for?\n[Kustomize](https://github.com/kubernetes-sigs/kustomize) is a great tool\nfor deploying Applications following GitOps. But Sometimes you need to\nchange \"things\" that are not addressable with the build in\n[replacements](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/replacements/).\nThat's where GeneralReplacementsTransformer comes into play. It's a kustomize\nplugin that allows you to select values in a similar way than the build in\nreplacements, but uses golang template expressions wherever you need to insert\nvalues. This is very powerful, but should definitely be used with care.\n\n## Installation\n\nThe `GeneralReplacementsTransformer` binary can be downloaded from the\n[GitHub releases page](https://github.com/noris-network/kustomize-generalreplacementstransformer/releases).\nIn order to be called by [kustomize](https://github.com/kubernetes-sigs/kustomize),\nit has to be installed to `$XDG_CONFIG_HOME/kustomize/plugin/noris.net/v1alpha1/generalreplacementstransformer`.\n(`$XDG_CONFIG_HOME` points by default to `$HOME/.config` on Linux and OS X, and `%LOCALAPPDATA%` on Windows.)\n\nInstall version 0.16.0 on Linux:\n\n    VERSION=0.16.0 OS=linux ARCH=amd64\n    INSTALL_DIR=\"${XDG_CONFIG_HOME:-$HOME/.config}/kustomize/plugin/noris.net/v1alpha1/generalreplacementstransformer\"\n    curl -Lo GeneralReplacementsTransformer https://github.com/noris-network/kustomize-generalreplacementstransformer/releases/download/v${VERSION}/GeneralReplacementsTransformer_${VERSION}_${OS}_${ARCH}\n    chmod +x GeneralReplacementsTransformer\n    mkdir -p $INSTALL_DIR\n    mv GeneralReplacementsTransformer $INSTALL_DIR\n\n## Usage\n\nLet's say you need a password in more than one place, but some locations are not\naddressable by build in replacements, and you only want to define it once...\n\nCreate a kustomization.yaml file:\n\n    cat \u003c\u003c. \u003ekustomization.yaml\n    apiVersion: kustomize.config.k8s.io/v1beta1\n    kind: Kustomization\n    namespace: demo\n    secretGenerator:\n      - name: mongodb-auth\n        literals:\n          - mongodb-root-password=secret123\n      - name: mongodb-env\n        literals:\n          - MONGO_URL=mongodb://demo:{{.password}}@mongodb/demo\n    transformers:\n      - transformer.yaml\n    .\n\n    cat \u003c\u003c. \u003etransformer.yaml\n    apiVersion: noris.net/v1alpha1\n    kind: GeneralReplacementsTransformer\n    metadata:\n      name: example\n    selectValues:\n      - name: password\n        resource:\n          kind: Secret\n          name: mongodb-auth\n          fieldPath: data.mongodb-root-password\n    replacements:\n      - resource:\n          kind: Secret\n          name: mongodb-env\n        type: template\n    .\n\n    kustomize build --enable-alpha-plugins\n\nIt is of cause not recommended to put your secret data unencrypted into any files,\nyou could e.g. use [SopsSecretGenerator](https://github.com/goabout/kustomize-sopssecretgenerator)\nto protect them. GeneralReplacementsTransformer will still work.\n\n## Selecting Values\n\nThe `resource`-selector in `selectValues` supports `kind`, `name` and `fieldPath`.\n\n## Loading Values\n\nThe transformer manifest can also load values from an external file defined in\n`valuesFile`, see [examples](examples/transformer.yaml#L10). Secrets encrypted with\n[SOPS](https://github.com/mozilla/sops) can be loaded with `secretsFile`, analog\nto `valuesFile`. Values from `valuesFile` overwrite values given in `values`, values\nfrom `secretsFile` overwrite values from `valuesFile`.\n\n## Inserting Values\n\nThe `resource`-selector in `replacements` supports `kind` and `name`, which might\nbe empty to select multiple resources.\n\nAll string values in yaml content can contain golang template expressions, e.g.:\n\n    key: \"{{.value}}\"\n\nValues can contain template expressions, see\n[examples -\u003e values -\u003e hostname](examples/transformer.yaml#L7-L8).\n[Slim-sprig](https://go-task.github.io/slim-sprig/) functions are also available:\n\n    key: \"deployed at {{ now | date \"2006-01-02 }}\"\n\nRight now just `type: template` is supported, this might change some time, but there\nare no plans so far.\n\n## Using GeneralReplacementsTransformer with ArgoCD\n\nGeneralReplacementsTransformer can be added to ArgoCD by [patching](doc/argocd.md)\nan initContainer into the ArgoCD provided `install.yaml`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoris-network%2Fkustomize-generalreplacementstransformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoris-network%2Fkustomize-generalreplacementstransformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoris-network%2Fkustomize-generalreplacementstransformer/lists"}