title | description | services | author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Add health probes to your AKS pods |
This article provides information on how to add health probes (readiness and/or liveness) to AKS pods with an Application Gateway. |
application-gateway |
greg-lindsay |
application-gateway |
how-to |
06/10/2022 |
greglin |
By default, Ingress controller will provision an HTTP GET probe for the exposed pods.
The probe properties can be customized by adding a Readiness or Liveness Probe to your deployment
/pod
spec.
apiVersion: networking.k8s.io/v1
kind: Deployment
metadata:
name: aspnetapp
spec:
replicas: 3
template:
metadata:
labels:
service: site
spec:
containers:
- name: aspnetapp
image: mcr.microsoft.com/dotnet/samples:aspnetapp
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
readinessProbe:
httpGet:
path: /
port: 80
periodSeconds: 3
timeoutSeconds: 1
Kubernetes API Reference:
Note
readinessProbe
andlivenessProbe
are supported when configured withhttpGet
.- Probing on a port other than the one exposed on the pod is currently not supported.
HttpHeaders
,InitialDelaySeconds
,SuccessThreshold
aren't supported.
If the above probes aren't provided, then the Ingress Controller makes an assumption that the service is reachable on the Path
specified for backend-path-prefix
annotation, or the path
specified in the ingress
definition for the service.
For any property that can't be inferred by the readiness/liveness probe, default values are set.
Application Gateway Probe Property | Default Value |
---|---|
Path |
/ |
Host |
localhost |
Protocol |
HTTP |
Timeout |
30 |
Interval |
30 |
UnhealthyThreshold |
3 |