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

475
Vistas
Kubernetes - Is it possible to combine Pod.yaml and Service.yaml in one yaml file (but without Deployment)

I have two different YAMLs one for Pod and one for Service. Is it possible to combine them into one YAML but not to use Deployment kind YAML in which I know we can specify both Pod and Service definition but I do not need to worry about replicas etc. Is it possible to combine them together? I haven't find such example/ guidance in documentation.

Thank you.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Yes you can put whatever resources you want in a yaml file, you just need to separate them with three dashes e.g:

apiVersion: apps/v1
kind: Service

---
apiVersion: apps/v1
kind: Pod
over 4 years ago · Santiago Trujillo Denunciar

0

What are you intending to do with this yaml file? 'kubectl create'?

You can separate objects by a line of 3 hyphens: '---'.

over 4 years ago · Santiago Trujillo Denunciar

0

You can concatenate objects in a single YAML, separating them with ---

Something like:

---
apiVersion: v1
kind: Service
...
---
apiVersion: v1
kind: Pod
...

You may want to create a Deployment first, figuring out what your Pod definition should look like.

Order shouldn't matter, though depending on the client loading it, failure may or may not stop applying the rest of the objects -- kubectl would apply everything it can.

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