Azure Kubernetes deploy image with ConfigMap

Lyndon 0 Reputation points
2023-07-20T11:33:26.43+00:00

We have an Az devops pipeline that deploys an image and a configMap to AKS. Sometimes the service doesn't start up, and it appears that the configMap is either not available or has no values in it. The configMap has values needed for the service to successfully start, and when it fails it shows as CrashLoopBackOff, and repeatedly seems to attempt a restart, but with no success. Deleting the pod with kubectl causes K8s to deploy another instance, and this comes up running correctly. Are there any logs to examine that might help get to the cause of this? I'm thinking logs of the K8s service, as opposed to the logs of the individual pod. Sadly this behaviour isn't consistent, it doesn't always fail. Many thanks for any suggestions

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,257 questions
{count} votes

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 26,331 Reputation points Microsoft Employee
    2023-07-20T19:56:22.34+00:00

    Hello, @Lyndon !

    What logs or tools can I use to help troubleshoot a Kubernetes deployment using DevOps and AKS?

    This may end up being more of a Kubernetes question than an AKS or DevOps question but there are some things that we can try. If the pods are failing only sometimes and in these cases startup is ultimately successful when deleted and recreated by Kubernetes, then there is likely an issue with whatever is controlling the pods.

    The object controlling the pod(s) (maybe a replicaset, daemonset, deployment, etc.) may have some Events that can help determine the status of the object doing the controlling using the following (assuming it is a deployment). If there is nothing there, the pod could be described for any Events.

    kubectl describe deployment DEPLOYMENTNAME -n NAMESPACE

    Looking further inside the Kubernetes level, kubectl get events -o wide may give some info on what is happening. Adding a -w for a watch would allow you to see any new events as they stream in as well.


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image

    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.