# Readiness and Liveness probes for elasticsearch 6.3.0 on Kubernetes failing

**URL:** <https://discuss.elastic.co/t/readiness-and-liveness-probes-for-elasticsearch-6-3-0-on-kubernetes-failing/199370>\
**Category:** Elasticsearch\
**Created:** [September 13, 2019, 6:40am UTC](https://discuss.elastic.co/t/readiness-and-liveness-probes-for-elasticsearch-6-3-0-on-kubernetes-failing/199370 "2019-09-13T06:40:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kar251188](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@kar251188](https://discuss.elastic.co/u/kar251188)\
**Post date:** [September 13, 2019, 6:40am UTC](https://discuss.elastic.co/t/readiness-and-liveness-probes-for-elasticsearch-6-3-0-on-kubernetes-failing/199370/1 "2019-09-13T06:40:00Z")

</div>

Hi guys,

I am trying to setup EFK stack on Kubernetes . The Elasticsearch version being used is 6.3.2. Everything works fine until I place the probes configuration in the deployment YAML file. I am getting error as below. This is causing the pod to be declared unhealthy and eventually gets restarted which appears to be a false restart.

I did try using telnet from a different container to the elasticsearch pod with IP and port and I was successful but only kubelete is unable to resolve the IP of the pod causing the probes to fail.

_Warning Unhealthy 15s kubelet, aks-agentpool-23337112-0 Liveness probe failed: Get [http://10.XXX.Y.ZZZ:9200/\_cluster/health:](http://10.XXX.Y.ZZZ:9200/_cluster/health:) dial tcp 10.XXX.Y.ZZZ:9200: connect: connection refused_

Below is the snippet from the pod spec of the Kubernetes Statefulset YAML. Any assistance on the resolution would be really helpful. Spent quite a lot of time on this without any clue ☹

PS: The stack is being setup on AKS cluster

spec:  
selector:  
matchLabels:  
component: elasticsearch  
role: data  
serviceName: elasticsearch-data  
replicas: 3  
template:  
metadata:  
labels:  
component: elasticsearch  
role: data  
spec:  
initContainers:  
- name: init-sysctl  
image: busybox  
command:  
- sysctl  
- -w  
- vm.max\_map\_count=262144  
securityContext:  
privileged: true  
- name: fix-permissions  
image: busybox  
command: ["sh", "-c", "chown -R 1000:1000 /usr/share/elasticsearch/data"]  
securityContext:  
privileged: true  
volumeMounts:  
- name: es-data  
mountPath: /usr/share/elasticsearch/data  
- name: increase-fd-ulimit  
image: busybox  
command: ["sh", "-c", "ulimit -n 65536"]  
securityContext:  
privileged: true  
affinity:  
nodeAffinity:  
requiredDuringSchedulingIgnoredDuringExecution:  
nodeSelectorTerms:  
- matchExpressions:  
- key: server1  
operator: In  
values:  
- elasticsearch-data  
podAntiAffinity:  
requiredDuringSchedulingIgnoredDuringExecution:  
- labelSelector:  
matchExpressions:  
- key: component  
operator: In  
values:  
- elasticsearch  
- key: role  
operator: In  
values:  
- data  
topologyKey: [kubernetes.io/hostname](http://kubernetes.io/hostname)  
containers:  
- name: es-data  
image: [quay.io/pires/docker-elasticsearch-kubernetes:6.3.2](http://quay.io/pires/docker-elasticsearch-kubernetes:6.3.2)  
env:  
- name: NAMESPACE  
valueFrom:  
fieldRef:  
fieldPath: metadata.namespace  
- name: NODE\_NAME  
valueFrom:  
fieldRef:  
fieldPath: metadata.name  
- name: CLUSTER\_NAME  
value: myesdb  
- name: NODE\_MASTER  
value: "false"  
- name: NODE\_INGEST  
value: "false"  
- name: HTTP\_ENABLE  
value: "true"  
- name: NODE\_DATA  
value: "true"  
- name: DISCOVERY\_SERVICE  
value: "elasticsearch-discovery"  
- name: NETWORK\_HOST  
value: "_eth0:ipv4_"  
- name: ES\_JAVA\_OPTS  
value: -Xms512m -Xmx512m  
- name: PROCESSORS  
valueFrom:  
resourceFieldRef:  
resource: limits.cpu  
resources:  
requests:  
cpu: 0.25  
limits:  
cpu: 1  
ports:  
- containerPort: 9200  
name: http  
- containerPort: 9300  
name: transport  
livenessProbe:  
httpGet:  
port: http  
path: /\_cluster/health  
initialDelaySeconds: 40  
periodSeconds: 10  
readinessProbe:  
httpGet:  
path: /\_cluster/health  
port: http  
initialDelaySeconds: 30  
timeoutSeconds: 10  
volumeMounts:  
- name: es-data  
mountPath: /data

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 11, 2019, 6:40am UTC](https://discuss.elastic.co/t/readiness-and-liveness-probes-for-elasticsearch-6-3-0-on-kubernetes-failing/199370/2 "2019-10-11T06:40:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
