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

Support edit set configmap #4493

Closed
Tracked by #5233
gaeljw opened this issue Feb 25, 2022 · 21 comments · Fixed by #5467
Closed
Tracked by #5233

Support edit set configmap #4493

gaeljw opened this issue Feb 25, 2022 · 21 comments · Fixed by #5467
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@gaeljw
Copy link

gaeljw commented Feb 25, 2022

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

I have a deployment workflow that includes:

  • generating a bunch of files (specific to application)
  • define a configMapGenerator referencing those files in kustomization.yaml

The list of files is not static and might change (files removed or added), thus I want to automate this (everything is then committed to Git for a GitOps process).

Unfortunately if my kustomization.yaml already contains a configMapGenerator, I cannot overwrite it with kustomize edit: I can only add a new one.


Let's take an example.

If I have this kustomization.yaml:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: my-config
  files:
  - conf/file1.properties

I would like to have a kustomize edit command that allows me to change it to:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: my-config
  files:
  - conf/file1.properties
  - conf/file2.properties

Describe the solution you'd like

In the same spirit as other kustomize edit set xxx commands, something like kustomize edit set configmap my-config --from-file=conf/* would be perfect.

Describe alternatives you've considered

Only alternative is to manipulate the kustomization.yaml manually with any scripting tool.

Additional context

@gaeljw gaeljw added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 25, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 25, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 26, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 25, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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.

@gaeljw
Copy link
Author

gaeljw commented Jul 25, 2022

The issue is still valid, please keep open.

@gaeljw
Copy link
Author

gaeljw commented Jul 25, 2022

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Jul 25, 2022
@k8s-ci-robot
Copy link
Contributor

@gaeljw: Reopened this issue.

In response to this:

/reopen

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.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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.

@gaeljw
Copy link
Author

gaeljw commented Aug 24, 2022

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Aug 24, 2022
@k8s-ci-robot
Copy link
Contributor

@gaeljw: Reopened this issue.

In response to this:

/reopen

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.

@Blackclaws
Copy link

Yeah I've just run into the same issue. I found that you can add a configmap using

kustomize edit add configmap

and was very surprised that trying to use the same command to update the configmap results in an error for duplicate keys.

@Blackclaws
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 25, 2022
@yufeiminds
Copy link
Contributor

Hi, all.

What status is the issue?

@yufeiminds
Copy link
Contributor

yufeiminds commented Sep 15, 2022

Hi @gaeljw, I had draft a pull request to add a remove command to Kustomize.

It can be used with add configmap command. Like this:

# Initialize
kustomize edit add configmap routes-01 --from-file="folder1/conf.d/*"
kustomize edit add configmap routes-02 --from-file="folder2/conf.d/*"

# Refresh configmap
kustomize edit remove configmap routes-01,routes-02
kustomize edit add configmap routes-01 --from-file="folder1/conf.d/*"
kustomize edit add configmap routes-01 --from-file="folder1/conf.d/*"

Hope it can resolve you problem.

@gaeljw
Copy link
Author

gaeljw commented Sep 15, 2022

Nice job @yufeiminds , sounds like it would do the trick. Hopefully your PR can be merged soon 🤞 (I've had some PRs opened for several months without feedback, I'm a bit grumpy on this :) )

@natasha41575
Copy link
Contributor

If we have a kustomize edit add configmap then I agree we should also have a kustomize edit remove configmap. I have CCd someone to review the above PR.

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 14, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 12, 2023
@gaeljw
Copy link
Author

gaeljw commented Jan 16, 2023

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2023
@stormqueen1990
Copy link
Member

/assign

@natasha41575
Copy link
Contributor

natasha41575 commented Sep 1, 2023

@stormqueen1990 FYI, #4796 is helpful by adding edit remove configmap (and we should accept the PR), I think we should still add a dedicated edit set configmap to overwrite the kustomization file as described in the issue. Likewise, an edit set secret command.

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. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Development

Successfully merging a pull request may close this issue.

7 participants