Closed ghost closed 4 years ago
Hey @Ares3266,
Could you describe your elasticsearch pod and post that information as well? It might give us some extra information as we work on investigating this.
output of k describe pod/strix-elasticsearch-0
Name: strix-es-elasticsearch-0
Namespace: default
Priority: 0
Node: gke-phoenix-cluster-phoenix-node-pool-d457f538-xhtk/10.0.40.227
Start Time: Mon, 27 Apr 2020 15:33:17 +0100
Labels: common.k8s.elastic.co/type=elasticsearch
controller-revision-hash=strix-es-elasticsearch-67fc7445b9
elasticsearch.k8s.elastic.co/cluster-name=strix
elasticsearch.k8s.elastic.co/config-hash=1795391612
elasticsearch.k8s.elastic.co/http-scheme=http
elasticsearch.k8s.elastic.co/node-data=true
elasticsearch.k8s.elastic.co/node-ingest=true
elasticsearch.k8s.elastic.co/node-master=true
elasticsearch.k8s.elastic.co/node-ml=true
elasticsearch.k8s.elastic.co/statefulset-name=strix-es-elasticsearch
elasticsearch.k8s.elastic.co/version=7.6.2
statefulset.kubernetes.io/pod-name=strix-es-elasticsearch-0
Annotations: consul.hashicorp.com/connect-inject: true
kubernetes.io/limit-ranger: LimitRanger plugin set: cpu request for container elasticsearch; cpu request for init container sysctl
update.k8s.elastic.co/timestamp: 2020-04-27T14:34:03.909017302Z
Status: Running
IP: 172.22.2.4
IPs: <none>
Controlled By: StatefulSet/strix-es-elasticsearch
Init Containers:
elastic-internal-init-filesystem:
Container ID: docker://4f6485a3ffc41e5e6f6db149879bd0fb522487fd766838fcd0c9bda1b77bac46
Image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
Image ID: docker-pullable://docker.elastic.co/elasticsearch/elasticsearch@sha256:59342c577e2b7082b819654d119f42514ddf47f0699c8b54dc1f0150250ce7aa
Port: <none>
Host Port: <none>
Command:
bash
-c
/mnt/elastic-internal/scripts/prepare-fs.sh
State: Terminated
Reason: Completed
Exit Code: 0
Started: Mon, 27 Apr 2020 15:34:02 +0100
Finished: Mon, 27 Apr 2020 15:34:03 +0100
Ready: True
Restart Count: 0
Limits:
cpu: 100m
memory: 50Mi
Requests:
cpu: 100m
memory: 50Mi
Environment:
POD_IP: (v1:status.podIP)
POD_NAME: strix-es-elasticsearch-0 (v1:metadata.name)
POD_IP: (v1:status.podIP)
POD_NAME: strix-es-elasticsearch-0 (v1:metadata.name)
Mounts:
/mnt/elastic-internal/downward-api from downward-api (ro)
/mnt/elastic-internal/elasticsearch-bin-local from elastic-internal-elasticsearch-bin-local (rw)
/mnt/elastic-internal/elasticsearch-config from elastic-internal-elasticsearch-config (ro)
/mnt/elastic-internal/elasticsearch-config-local from elastic-internal-elasticsearch-config-local (rw)
/mnt/elastic-internal/elasticsearch-plugins-local from elastic-internal-elasticsearch-plugins-local (rw)
/mnt/elastic-internal/probe-user from elastic-internal-probe-user (ro)
/mnt/elastic-internal/scripts from elastic-internal-scripts (ro)
/mnt/elastic-internal/transport-certificates from elastic-internal-transport-certificates (ro)
/mnt/elastic-internal/unicast-hosts from elastic-internal-unicast-hosts (ro)
/mnt/elastic-internal/xpack-file-realm from elastic-internal-xpack-file-realm (ro)
/usr/share/elasticsearch/config/http-certs from elastic-internal-http-certificates (ro)
/usr/share/elasticsearch/data from elasticsearch-data (rw)
/usr/share/elasticsearch/logs from elasticsearch-logs (rw)
sysctl:
Container ID: docker://fddc4e6d27d40ada7314cb960755b92c7d52f2ec843b5cc85541cb2636ace965
Image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
Image ID: docker-pullable://docker.elastic.co/elasticsearch/elasticsearch@sha256:59342c577e2b7082b819654d119f42514ddf47f0699c8b54dc1f0150250ce7aa
Port: <none>
Host Port: <none>
Command:
sh
-c
sysctl -w vm.max_map_count=262144
State: Terminated
Reason: Completed
Exit Code: 0
Started: Mon, 27 Apr 2020 15:34:04 +0100
Finished: Mon, 27 Apr 2020 15:34:04 +0100
Ready: True
Restart Count: 0
Requests:
cpu: 100m
Environment:
POD_IP: (v1:status.podIP)
POD_NAME: strix-es-elasticsearch-0 (v1:metadata.name)
Mounts:
/mnt/elastic-internal/downward-api from downward-api (ro)
/mnt/elastic-internal/elasticsearch-config from elastic-internal-elasticsearch-config (ro)
/mnt/elastic-internal/probe-user from elastic-internal-probe-user (ro)
/mnt/elastic-internal/scripts from elastic-internal-scripts (ro)
/mnt/elastic-internal/unicast-hosts from elastic-internal-unicast-hosts (ro)
/mnt/elastic-internal/xpack-file-realm from elastic-internal-xpack-file-realm (ro)
/usr/share/elasticsearch/bin from elastic-internal-elasticsearch-bin-local (rw)
/usr/share/elasticsearch/config from elastic-internal-elasticsearch-config-local (rw)
/usr/share/elasticsearch/config/http-certs from elastic-internal-http-certificates (ro)
/usr/share/elasticsearch/config/transport-certs from elastic-internal-transport-certificates (ro)
/usr/share/elasticsearch/data from elasticsearch-data (rw)
/usr/share/elasticsearch/logs from elasticsearch-logs (rw)
/usr/share/elasticsearch/plugins from elastic-internal-elasticsearch-plugins-local (rw)
Containers:
elasticsearch:
Container ID: docker://b92d1ebc46eeb969d7d8f92af7d5fe8149d0ee137e812038739c1730e73ded20
Image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
Image ID: docker-pullable://docker.elastic.co/elasticsearch/elasticsearch@sha256:59342c577e2b7082b819654d119f42514ddf47f0699c8b54dc1f0150250ce7aa
Ports: 9200/TCP, 9300/TCP
Host Ports: 0/TCP, 0/TCP
State: Running
Started: Mon, 27 Apr 2020 15:34:05 +0100
Ready: True
Restart Count: 0
Limits:
memory: 2Gi
Requests:
cpu: 100m
memory: 2Gi
Readiness: exec [bash -c /mnt/elastic-internal/scripts/readiness-probe-script.sh] delay=10s timeout=5s period=5s #success=1 #failure=3
Environment:
HEADLESS_SERVICE_NAME: strix-es-elasticsearch
NSS_SDB_USE_CACHE: no
POD_IP: (v1:status.podIP)
POD_NAME: strix-es-elasticsearch-0 (v1:metadata.name)
PROBE_PASSWORD_PATH: /mnt/elastic-internal/probe-user/elastic-internal-probe
PROBE_USERNAME: elastic-internal-probe
READINESS_PROBE_PROTOCOL: http
Mounts:
/mnt/elastic-internal/downward-api from downward-api (ro)
/mnt/elastic-internal/elasticsearch-config from elastic-internal-elasticsearch-config (ro)
/mnt/elastic-internal/probe-user from elastic-internal-probe-user (ro)
/mnt/elastic-internal/scripts from elastic-internal-scripts (ro)
/mnt/elastic-internal/unicast-hosts from elastic-internal-unicast-hosts (ro)
/mnt/elastic-internal/xpack-file-realm from elastic-internal-xpack-file-realm (ro)
/usr/share/elasticsearch/bin from elastic-internal-elasticsearch-bin-local (rw)
/usr/share/elasticsearch/config from elastic-internal-elasticsearch-config-local (rw)
/usr/share/elasticsearch/config/http-certs from elastic-internal-http-certificates (ro)
/usr/share/elasticsearch/config/transport-certs from elastic-internal-transport-certificates (ro)
/usr/share/elasticsearch/data from elasticsearch-data (rw)
/usr/share/elasticsearch/logs from elasticsearch-logs (rw)
/usr/share/elasticsearch/plugins from elastic-internal-elasticsearch-plugins-local (rw)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
strix-es-data:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: strix-es-data-strix-es-elasticsearch-0
ReadOnly: false
elasticsearch-data:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: elasticsearch-data-strix-es-elasticsearch-0
ReadOnly: false
downward-api:
Type: DownwardAPI (a volume populated by information about the pod)
Items:
metadata.labels -> labels
elastic-internal-elasticsearch-bin-local:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
elastic-internal-elasticsearch-config:
Type: Secret (a volume populated by a Secret)
SecretName: strix-es-elasticsearch-es-config
Optional: false
elastic-internal-elasticsearch-config-local:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
elastic-internal-elasticsearch-plugins-local:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
elastic-internal-http-certificates:
Type: Secret (a volume populated by a Secret)
SecretName: strix-es-http-certs-internal
Optional: false
elastic-internal-probe-user:
Type: Secret (a volume populated by a Secret)
SecretName: strix-es-internal-users
Optional: false
elastic-internal-scripts:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: strix-es-scripts
Optional: false
elastic-internal-transport-certificates:
Type: Secret (a volume populated by a Secret)
SecretName: strix-es-transport-certificates
Optional: false
elastic-internal-unicast-hosts:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: strix-es-unicast-hosts
Optional: false
elastic-internal-xpack-file-realm:
Type: Secret (a volume populated by a Secret)
SecretName: strix-es-xpack-file-realm
Optional: false
elasticsearch-logs:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events: <none>
It looks like there's a mismatch between the service name registered for Elasticsearch in Consul and the upstream definition. If not specified by an annotation, this defaults to the name of the first container, in this case elasticsearch
.
So for your upstream definition, you'll need:
consul.hashicorp.com/connect-service-upstreams: "elasticsearch:1234,static-server:1235"
rather than the consul-elasticsearch
.
Updated to reflect those changes, issue persists.
Can you show us the output of curling on one of the consul servers:
curl localhost:8500/v1/catalog/services
If there's the elasticsearch
service, then:
curl localhost:8500/v1/catalog/service/elasticsearch?pretty=true
Actually, I just realized the pod isn't getting injected. Can you look at the logs of the consul-connect-injector-webhook-deployment
Thats interesting actually, that state has changed since I've opened this issue. There was 3 pods in there, with it getting injected. I'll turn debug on and rebuild the ECK and test deployments
@adilyse you point was actually spot on. Changing the service name to "elasticsearch" after rebuilding the whole deployment has resolved this issue. Good spot. I don't exactly recall why I used the other name, but I suspect it was because that was what it was listed as in the UI list.
Curiously though, why does that return an empty response instead of...well anything else?
Edit: The reason I called it consul-elasticsearch
and not just elasticsearch
is because I was looking in kubectl get services
for the name, and the ExternalName is what I used. Wonder if that might be a nice feature to maybe support in the future?
I've recently rolled out a new GKE cluster, and installed the latest v0.19.0 consul on k8s helm chart with helm 3.
Alongside this, I've followed the steps documented here to install Elastic Cloud Kubernetes.
I've combind the advice found on this section of the docs, noting the need to turn of TLS on the HTTP layer, with your docs here, adding the only annotation, the final result looking like so:
You'll note the addition of the "connect inject" annotation which should be all thats required, as well as turning off TLS.
Appying the manifest results in a healthy cluster, and port-forwarding the service (NodePort) to my machine and curling the endpoint returns a healthy cluster.
I then continued to follow the advice in the Connect docs to be able to connect from another service, applying this manifest:
Testing the example service works without issue, proving to a limited sense that Connect has been installed successfully.
However attempting to connect to ElasticSearch returns either Error 52, Empty Response, or 56 Connection Reset
Consul values.yaml: