I am trying to follow this documentation to enable readiness and liveness probe on my pods for health checkes in my cluster, however it gives me an error where connection refused to the container IP and port. Portion where i have added the readiness and liveness is below.
I am using helm for deployment and the port i am trying to monitor is 80. The service file for ingress is also given below.
https://docs.microsoft.com/en-us/azure/application-gateway/ingress-controller-add-health-probes
Service.yaml
apiVersion: v1
kind: Service
metadata:
name: expose-portal
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "{{ .Values.isInternal }}"
spec:
type: LoadBalancer
ports:
- port: 80
selector:
app: portal
Deployment.yaml
spec:
containers:
- name: App-server-portal
image: myacr-app-image-:{{ .Values.image_tag }}
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
protocol: TCP
readinessProbe:
httpGet:
path: /
port: 80
periodSeconds: 3
timeoutSeconds: 1
livenessProbe:
httpGet:
path: /
port: 80
periodSeconds: 3
timeoutSeconds: 1
volumeMounts:
- mountPath: /etc/nginx
readOnly: true
name: mynewsite
imagePullSecrets:
- name: my-secret
volumes:
- name: mynewsite.conf
configMap:
name: mynewsite.conf
items:
- key: mynewsite.conf
path: mynewsite.conf
Am i doing something wrong here. As per azure documentation as of today Probing on a port other than the one exposed on the pod is currently not supported. My understanding is that port 80 on my pod is already exposed.
taken from the docs:
The solution was to increase timeout.
PS. I think you might need to introduce initialDelaySeconds
instead of increasing timeout to 3 minutes