2

I have a AKS cluster in which I have deployed three Docker containers in three different namespaces. The first pod needs to check the availability of the other two pods. What I mean is that POD-1 monitors the POD-2 and POD-3. Is there any option to monitor the pod this way? Can POD-1 generate logs or alerts if any error occurs in the other two pods? The first pods is a C# application.

Faheem
  • 3,429
  • 19
  • 26
june alex
  • 244
  • 4
  • 17
  • Looks like a Kubernetes question, not a specific AKS one, you may have to rewrite your question to get a better answer and be more specific with your use case. See here if this answer solves your scenario: https://stackoverflow.com/questions/51079849/kubernetes-wait-for-other-pod-to-be-ready – jmservera Aug 29 '20 at 10:02
  • is this possible via azure monitor right? then why you telling this is not related to aks.? – june alex Aug 29 '20 at 14:20
  • 1
    Even if you can write some code to query Azure Monitor in "realtime", it will be a huge task and will add an external dependency to your solution, while you have a built-in way to do it in Kubernetes through the API without the need of an external service for it: https://kubernetes.io/docs/concepts/overview/kubernetes-api/ – jmservera Aug 29 '20 at 23:38

1 Answers1

2

You can use the Kubernetes API client SDK for C# (https://github.com/kubernetes-client/csharp) to connect with the API Server and get the status of the desired PODS.

You may need to create a Service Account and assign it to your POD if you get permission issues.

Client libraries often handle common tasks such as authentication for you. Most client libraries can discover and use the Kubernetes Service Account to authenticate if the API client is running inside the Kubernetes cluster, or can understand the kubeconfig file format to read the credentials and the API Server address.

https://kubernetes.io/docs/reference/using-api/client-libraries/

Faheem
  • 3,429
  • 19
  • 26