Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configMapGenerator name with suffix not applied to custom resources #2524

Closed
whyvez opened this issue May 22, 2020 · 2 comments
Closed

configMapGenerator name with suffix not applied to custom resources #2524

whyvez opened this issue May 22, 2020 · 2 comments

Comments

@whyvez
Copy link

whyvez commented May 22, 2020

I'm deploying an Argo WorkflowTemplate with Kustomize and the configMapGenerator generated name with the suffix does not get applied to my WorkflowTemplate. Is there a way to enable this or will Kustomize only make changes to K8s builtin resource?

My WorkflowTemplate contains an env property that sources from a ConfigMap.

env:
- name: PGHOST
  valueFrom:
    configMapKeyRef:
      name: config-api-exports
      key: PGHOST
- name: PGDATABASE
  valueFrom:
    configMapKeyRef:
      name: config-api-exports
      key: PGDATABASE
- name: PGUSER
  valueFrom:
    configMapKeyRef:
      name: config-api-exports
      key: PGUSER

The config-api-exports ConfigMap is generated by a configMapGenerator.

configMapGenerator:
  - name: config-api-exports
    literals:
      - PGUSER="postgres"
      - PGDATABASE="my-db"
      - PGHOST="127.0.0.7"

Even though this is a custom type I would expect Kustomize to walk the manifest and find and replace any yaml block that matches up with a valid Kubernetes type, env/configMapKeyRef in this case.

@pst
Copy link
Contributor

pst commented May 22, 2020

Have you specified the namereferences like documented?

@whyvez
Copy link
Author

whyvez commented May 22, 2020

@pst Awesome, got it. Thank you!

Ended up adding this configuration...

nameReference:
  - kind: ConfigMap
    fieldSpecs:
    - path: spec/templates/script/env/valueFrom/configMapKeyRef/name
      kind: WorkflowTemplate

images:
  - path: spec/templates/script/image
    kind: WorkflowTemplate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants