Using configGeneration hash suffix with arbitrary resources referring to it (e.g. Flux HelmRelease) #5710
Unanswered
grrttedwards
asked this question in
Q&A
Replies: 1 comment
-
Name reference transformer is one solution to this problem: # kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrelease.yaml
secretGenerator:
- name: FOOBAR
options:
disableNameSuffixHash: false
files:
- config.json
configurations:
- nameReference.yaml # nameReference.yaml
---
nameReference:
- kind: Secret
fieldSpecs:
- kind: HelmRelease
path: spec/values/secretName # helmrelease.yaml
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: myapp
spec:
values:
secretName: FOOBAR then apiVersion: v1
data:
config.json: MTIzYWJj
kind: Secret
metadata:
name: FOOBAR-6642c8mk9m
type: Opaque
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: myapp
spec:
values:
secretName: FOOBAR-6642c8mk9m |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. Is there a general solution which allows for using the hash suffix generation and have kustomize replace references to it from other arbitrary resources? Or perhaps another workaround using replacements or transformers? For example, take the following setup:
and
config.json
containing123abc
Using kustomize's config generation suffix hash feature, as far as I can tell, does not work with arbitrary resources which refer to this configmap name (of course kustomize cannot just blindly replace all instances of
FOOBAR
it finds in other resources). In my case, a Flux HelmRelease has no meaning to kustomize.The output from above is
This https://github.com/kubernetes-sigs/kustomize/tree/master/examples/transformerconfigs#name-reference-transformer seems very close to my solution, but given that this is 5+ year old documentation, is this at risk of being deprecated? I find it difficult to establish truth with kustomize and what features are new or old or deprecated.
Beta Was this translation helpful? Give feedback.
All reactions