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

152
Visualizações
readinessProbe use DNS instead of IP Address for Host

I currently configure my Nginx Pod readinessProbe to monitor Redis port 6379, and I configure my redis-pod behind the redis-service (ClusterIP).

So my idea is to monitor Redis port though redis-service using DNS instead of IP address.

When I use readinessProbe.host: redis-service.default.svc.cluster.local the Nginx-pod is not running. When I describe the Nginx-pod $ kubectl describe pods nginx, I found below error in Events section:

Readiness probe failed: dial tcp: lookup redis-service.default.svc.cluster.local: no such host

It only works if I use ClusterIP instead of DNS.

Please help me figure out how to use DNS instead of ClusterIP.

My Pod file:

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: nginx
  name: nginx
spec:
  containers:
  - image: nginx
    name: nginx
    livenessProbe:
      httpGet:
        path: /
        port: 80
    readinessProbe:
      tcpSocket:
        host: redis-service.default.svc.cluster.local
        port: 6379
    resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always

Thanks.

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

0

I figured out how to do it.

Instead of using tcpSocket, just use exec. Exec your tcpCheck script inside the container to check the service:port availability.

Use your init-container to share the script with the main container.

Thanks.

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