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

339
Visualizações
how to get container host machine ip address and container name in EKS

I have a docker file and using that i have build the image and then used EKS service to launch the containers. Now in my application for logging purpose I am taking environment variables like "container_instance" and "ec2_instance_id" and logging it so that I can see in Elastic Search from which container or host ec2 machine this log got generated.

How can I set these 2 data when I start my container in environment variable?

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

0

In your Kubernetes Pod spec, you can use the downward API to inject some of this information. For example, to get the node's Kubernetes node name, you can set

env:
  - name: MY_NODE_NAME
    valueFrom:
      fieldRef:
        fieldPath: spec.nodeName

The node name is typically a hostname for the node (this example in the EKS docs shows the EC2 internal hostnames, for example). You can't easily get things like an EC2 instance ID at a per-pod level.

You also might configure logging globally at a cluster level. The Kubernetes documentation includes a packaged setup to route logs to Elasticsearch and Kibana. The example shown there includes only the pod name in the log message metadata, but you should be able to reconfigure the underlying fluentd to include additional host-level metadata.

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