TLTR;
You might need to increase resources for ES container
The long answer:
We use Kubernetes runners in our project.
We had similar problem - we couldn't connect with elastic service even the alias was set in the correct way.
We tried to use solutions from @bersling, @Pieter Verloop, @N N, @Jake Anderson without success.
After more debugging we found that the docker container started (docker ps in pipelines), but there were no logs (./kubectl -n <namespace> logs <runner_pod_name> svc-0).
Based on @Pieter Verloop answer we decided to check resources for the service (./kubectl -n <namespace> describe pod <runner_pod_name> and they were quite low.
Init Containers:
<pod_name>:
Limits:
cpu: 200m
memory: 512Mi
Requests:
cpu: 100m
memory: 256Mi
After the pod config update and with additional command from the @bersling answer it started working
values.yaml
config: |
[[runners]]
[runners.kubernetes]
# ...
# These values might be overkill for your project
# Check metrics to get the correct amount for your project
service_cpu_limit = "900m"
service_memory_limit = "2.3Gi"
gitlab-ci.yaml
# ...
command:
- /bin/bash
- -c
- docker-entrypoint.sh elasticsearch -Ediscovery.type=single-node
elasticsearch(http://elasticsearch:9200)? See documentation docs.gitlab.com/ce/ci/docker/…