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

281
Views
Obteniendo el error PodSpec.containers: obtuve "mapa", esperaba "matriz" o Container.volumeMounts: obtuve "mapa", esperaba "matriz";

Estoy tratando de iniciar una implementación pero recibo este error

 error: error validating "httpd-basic-deployment.yaml": error validating data: ValidationError(Deployment.spec.template.spec.containers): invalid type for io.k8s.api.core.v1.PodSpec.containers: got "map", expected "array"; if you choose to ignore these errors, turn validation off with --validate=false

del siguiente archivo de definición de pod:

 apiVersion: apps/v1 kind: Deployment metadata: name: ebay-app spec: selector: matchLabels: environment: dev app: ebay replicas: 1 template: metadata: labels: environment: dev app: ebay spec: volumes: - name: volume hostPath: path: /mnt/data containers: name: container1-nginx image: nginx volumeMounts: name: volume mountPath: /var/nginx-data name: container2-tomcat image: tomcat nodeSelector: boardType: x86vm

Intenté enumerar los cotnainers nuevamente:

 volumes: - name: volume hostPath: path: /mnt/data containers: - name: container1-nginx image: nginx volumeMounts: name: volume mountPath: /var/nginx-data - name: container2-tomcat image: tomcat nodeSelector: boardType: x86vm

eso da como resultado un error diferente

 error: error validating "httpd-basic-deployment.yaml": error validating data: ValidationError(Deployment.spec.template.spec.containers[0].volumeMounts): invalid type for io.k8s.api.core.v1.Container.volumeMounts: got "map", expected "array"; if you choose to ignore these errors, turn validation off with --validate=false

Qué estoy haciendo mal ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

VolumeMounts también debe tener - . Indica el inicio de una matriz. Cámbielo como se muestra a continuación.

 volumeMounts: - name: volume mountPath: /var/nginx-data

Eche un vistazo a este ejemplo de yaml para crear un pod que tenga dos contenedores y comparta el mismo volumen. En este ejemplo - está claro dónde usar el símbolo y dónde no.

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!