I want to implement Kubernetes Liveliness Probes in my .Net core application with C# language. I understood that first I need to define the liveliness probe in deployment.yaml file of my application. I also created the http service in my application that is responding at 8080 port.
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
httpHeaders:
- name: Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
Apart from this what changes do I need to do in my C# code ? I am using below Kubernetes nuget in .csproj :
<PackageReference Include="KubernetesClient" Version="3.0.7" />