Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

478
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda