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

Allow specifying key in secretGenerator #4252

Closed
skluthe opened this issue Oct 20, 2021 · 4 comments
Closed

Allow specifying key in secretGenerator #4252

skluthe opened this issue Oct 20, 2021 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@skluthe
Copy link

skluthe commented Oct 20, 2021

Is your feature request related to a problem? Please describe.

I am trying to setup an additional scrape config in prometheus-operator but I am restricted to one key. When generating a secret, it uses the file names as the key. I would like to combine these all into one key so I can separate the files out some for easier management.

Describe the solution you'd like

I would like to specify the following to combine said files into a single key:

secretGenerator:
- name: additional-scrape-configs
  files:
  - targets/production/app-servers.yaml
  - targets/production/db-primary.yaml
  key: additional-scrape-configs.yaml

Describe alternatives you've considered
Tried looking through generatorOptions but didn't see anything. I can just combine everything into one file for it to work but it will be significantly more difficult to maintain as I get all of my additional servers into the config. I could request a change on the prometheus-operator side of things.

If this is not something you would like to do, please let me know. I am also happy to open this ticket on the prometheus-operator side of things if you feel like this is not something that would be useful for other usecases.

@skluthe skluthe added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 20, 2021
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 20, 2021
@k8s-ci-robot
Copy link
Contributor

@skluthe: This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@skluthe
Copy link
Author

skluthe commented Oct 20, 2021

It looks like this is actually not the recommended way to accomplish doing what I'm looking to do. If this would not be useful for other use cases, feel free to close this.

(The recommended way is using ServiceMonitors)

@KnVerey
Copy link
Contributor

KnVerey commented Oct 27, 2021

For what it's worth, it is possible to change the key name for secretGenerator the same way as for configMapGenerator: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/configmapgenerator (at the end of the first section). However, it's not possible to cause it to merge multiple values into a single key. That is because Kustomize intentionally treats the values as opaque strings. We are open to accepting a targeted, structured merge feature as in #3787, but we would need a contributor to drive the design and implementation.

/close

@k8s-ci-robot
Copy link
Contributor

@KnVerey: Closing this issue.

In response to this:

For what it's worth, it is possible to change the key name for secretGenerator the same way as for configMapGenerator: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/configmapgenerator (at the end of the first section). However, it's not possible to cause it to merge multiple values into a single key. That is because Kustomize intentionally treats the values as opaque strings. We are open to accepting a targeted, structured merge feature as in #3787, but we would need a contributor to drive the design and implementation.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

3 participants