AKS pod Could not resolve host during poststart

muhammad.kodrad 6 Reputation points
2022-03-24T14:29:33.923+00:00

Hi there, I hope anyone can help me with my issues in AKS. So I have magento application deployed in AKS, it runs well but with some issues, one of it is that when I describe the pod it shows errors like this Warning FailedPostStartHook 5m38s kubelet Could not resolve host: redis-master and when I check with kubectl get pod , it shows 1 restarts count on the pod. I tried to further check the issue, in my poststart command, I tried to do connection to redis, elasticsearch, varnish service using their hostname. Then when I describe the pod it shows the warning failedpoststarthook that it can't resolve the hostnames. But after the pod restart 1 time, it can resolve the hostname normally. Is there something that I missed to configure in AKS? Because I'm using the same chart in another kubernetes platform and it doesn't show any behaviour like this. Thank you for your guidance.

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,084 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Naveenaidu 0 Reputation points
    2023-01-29T15:28:24.0033333+00:00

    How did you configure Redis, using post-deployment script or you have defined has ENV variable

    0 comments No comments

  2. Rimshavictor 0 Reputation points
    2023-05-22T04:50:35.96+00:00

    The "FailedPostStartHook" warning in your AKS pod indicates an initial failure of the post-start hook, which succeeds after a restart.

    Possible reasons include timing issues, network configuration, and network policies. Troubleshoot by reviewing your pod and hook implementation, checking AKS DNS configuration, and examining network policies. Consider using readiness probes to ensure dependencies are ready before the post-start hook execution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.