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

173
Visualizações
How do I pass the name of a kubernetes deployment/replica set to the container?

I have had some success getting the name of the pod into my container for logging purposes,

          env:
            - name: ID_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name

however I would like to extend that by logging the deployment and replica sets. Is there a way to pass these values into the pod?

Based on some observation, the pod name appears to just be an extension of the set name, which is an extension of the deployment name. Is there a way to parse that info from the name?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

There's no way to get the ownerReference inside the Pod using the Downward APIs: this is the list of the unique items supported.

https://github.com/kubernetes/kubernetes/blob/cea1d4e20b4a7886d8ff65f34c6d4f95efcb4742/pkg/apis/core/pods/helpers.go#L61-L100

over 4 years ago · Santiago Trujillo Relatório

0

There is a way, but you would have to use a kubernetes client inside your pod, and query the apiserver to list the deployment or replicaset having the same labels as the pod in which the code runs, via label-selector.

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