8000 Option to supply name when exporting k8s config map · Issue #720 · configu/configu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Option to supply name when exporting k8s config map #720

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

Open
dipsywong98 opened this issue Mar 7, 2025 · 1 comment
Open

Option to supply name when exporting k8s config map #720

dipsywong98 opened this issue Mar 7, 2025 · 1 comment
Labels
co 8000 mmunity feat New feature or request triage The issue is new and needs to be triaged by a maintainer

Comments

@dipsywong98
Copy link

Suggestion

I am using configu to manage configurations and export the configs to a k8s config map, however I could not find a way to supply a name to the config map definition as required by k8s.

For example I have a fruit.cfgu.yaml

$schema: 'https://files.configu.com/schema/.cfgu.json'
keys:
  FRUIT:
    default: banana

And I run configu eval | configu export --format config-map, it gives

apiVersion: v1
kind: ConfigMap
metadata:
  creationTimestamp: 2025-03-07T12:26:56.567Z
data:
  FRUIT: banana

But the response is missing metadata.name to work so I am looking for a direct way to properly supply the config map name, so it can output.

apiVersion: v1
kind: ConfigMap
metadata:
  name: fruit-config
  creationTimestamp: 2025-03-07T12:26:56.567Z
data:
  FRUIT: banana

I took a further look into how the configmap export is implemented, there is name: options?.name?.toLowerCase() in the KubernetesConfigMapFormatter but looks like the value of options is always to be {} as I see in reduceConfigs, so I suspect there is no way to supply a value to options at the moment, not sure if I read the code correctly. And I think adding this option will change the cli and quite a bit of architecture, so I hold back from directly submitting a PR, but I am happy to contribute.

For anyone facing the same issue, I will suggest doing the following, as there is another issue causing k8s config map export is not working out of the box - #718

configu eval | configu export --format ini > fruit.env
kubectl create configmap fruit-config --from-env-file=fruit.env --dry-run -o yaml > fruit-config.yaml

Motivation

No response

Context

No response

@dipsywong98 dipsywong98 added the feat New feature or request label Mar 7, 2025
@github-actions github-actions bot added triage The issue is new and needs to be triaged by a maintainer community labels Mar 7, 2025
@rannn505
Copy link
Contributor

I created a small example that also control the name:
#718 (comment)
We will fix the ability to pass format options to the formatters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community feat New feature or request triage The issue is new and needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants
0