0

I am a newbie in k8s. I have a .net framework application written in C# running in K8s orchestration. I simply want to check in fixed interval (lets say in every 300sec) that my application which is running inside pod is responding or not.
Can anyone suggest how to implement this ?

1

Kubernetes supports TCP, HTTP, and shell-exec probes for an application startup, readiness, and liveness health checks. If your application is a web application, you can use HTTP based liveness healthcheck as shown in the following code snippet:

apiVersion: v1
kind: Pod
metadata:
  labels:
    test: liveness
  name: liveness-http
spec:
  containers:
  - name: liveness
    image: k8s.gcr.io/liveness
    args:
    - /server
    livenessProbe:
      httpGet:
        path: /healthz
        port: 8080
      initialDelaySeconds: 3
      periodSeconds: 300

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.