Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

353
Views
kubectl create configmap - options to remove file names from output configmap when generateing using --file-name option

I am using kubectl create configmap command as follows:

kubectl create configmap config-multi-yaml-files --from-file=templates/1template.yaml --from-file=apps/app1.yaml --from-file=app2/app2.yaml  --dry-run=true -o yaml > output.yaml

The resultant configmap do have file names (app1.yaml, app2.yaml) like this:

apiVersion: v1
data:
  app1.yaml: |-
  groups:
  - name: sample
    rules:
    - alert: alert

How can I use this command so that I do have a configmap from multiple yamls, but do not have the respective file names in the resultant configmap.

Any pointers are appreciated.

Thanks.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Unfortunately, you will have to use keys in order to make it work. But here is an example of what you could do:

kubectl create configmap config-multi-yaml-files --from-file <(cat templates/1template.yaml) --from-file <(cat apps/app1.yaml) --dry-run=client -o yaml

That way the keys would be numbers: 11, 12, 13...

So you will not have to use file names in your ConfigMap but keys will have to be used.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!