Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

354
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda