june alex
june alex

Reputation: 294

Get cluster azure kubernetes service (AKS) health/availability in C# application

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.

Upvotes: 2

Views: 892

Answers (1)

Faheem
Faheem

Reputation: 3569

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/

Upvotes: 2

Related Questions