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

[feature request]ResourceDistribution should consider configmapGenerator #943

Closed
qixiaobo opened this issue Mar 31, 2022 · 8 comments
Closed
Assignees
Labels
kind/feature-request wontfix This will not be worked on

Comments

@qixiaobo
Copy link

qixiaobo commented Mar 31, 2022

What would you like to be added:
ResourceDistribution should support other resource like configmapgenerator with Kustomize
Why is this needed:
In k8s, configmap only used as create.
This is not a good design.
So if we want to change configmap we should delete and then create [of course we should pay attention to check exists]
So we cannot just easily to add a configmap with a file.
Luckily Kustomize support this with configmapgenerator.
https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/

Generating Resources
ConfigMaps and Secrets hold configuration or sensitive data that are used by other Kubernetes objects, such as Pods. The source of truth of ConfigMaps or Secrets are usually external to a cluster, such as a .properties file or an SSH keyfile. Kustomize has secretGenerator and configMapGenerator, which generate Secret and ConfigMap from files or literals.

configMapGenerator
To generate a ConfigMap from a file, add an entry to the files list in configMapGenerator. Here is an example of generating a ConfigMap with a data item from a .properties file

In this case we just want to copy secrets like ssl certs ,
we may not want to paste this to a yaml with format.

@qixiaobo
Copy link
Author

We just use this in agro-cd.
So it's a git-ops practise

@qixiaobo
Copy link
Author

In short , k8s support apply -f to any resources include configmap and secret.
But you know configmap or secret usually import from a file
in yaml keep it's format may be difficult.
And this file may be supported by other team.
So we often create configmap like this

kubectl create configmap game-config --from-file=configure-pod-container/configmap/

This may break the gitops pipeline

@FillZpp
Copy link
Member

FillZpp commented Apr 1, 2022

/assign @veophi

@hantmac
Copy link
Member

hantmac commented Apr 1, 2022

@FillZpp Should we support this function in kubectl-kruise?

@FillZpp
Copy link
Member

FillZpp commented Apr 6, 2022

@FillZpp Should we support this function in kubectl-kruise?

That's ok to me. @qixiaobo WDYT?

@qixiaobo
Copy link
Author

qixiaobo commented Apr 6, 2022

@FillZpp Should we support this function in kubectl-kruise?

That's ok to me. @qixiaobo WDYT?

LGTM

@stale
Copy link

stale bot commented Jul 5, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 5, 2022
@FillZpp FillZpp removed the wontfix This will not be worked on label Jul 6, 2022
@stale
Copy link

stale bot commented Oct 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 4, 2022
@stale stale bot closed this as completed Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants