https://github.com/data-fair/elasticsearch-test-client
A simple docker image to connect to a Elasticsearch cluster using nodejs client and test it.
https://github.com/data-fair/elasticsearch-test-client
Last synced: about 1 month ago
JSON representation
A simple docker image to connect to a Elasticsearch cluster using nodejs client and test it.
- Host: GitHub
- URL: https://github.com/data-fair/elasticsearch-test-client
- Owner: data-fair
- Created: 2026-02-27T09:19:40.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-03-10T20:35:30.000Z (5 months ago)
- Last Synced: 2026-03-11T01:48:54.162Z (5 months ago)
- Language: TypeScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elasticsearch Test Client
Debug Docker image for testing Elasticsearch connectivity from a Kubernetes pod.
## Environment Variables
| Variable | Description |
|----------|-------------|
| `ES_HOST` | Single ES host (e.g., `localhost:9200`) |
| `ES_NODES` | JSON array of ES nodes |
| `ES_AUTH` | JSON object with `username` and `password` |
| `ES_OPTIONS` | JSON object with additional client options |
| `ES_CA` | CA certificate string |
## Usage
```bash
# Build
docker build -t es-test-client .
# Run
docker run -it -e ES_HOST=localhost:9200 es-test-client
```
## Kubernetes
```yaml
apiVersion: v1
kind: Pod
metadata:
name: es-test-client
spec:
containers:
- name: es-test-client
image: es-test-client
env:
- name: ES_HOST
value: "elasticsearch:9200"
restartPolicy: Never
```
## Connect to Pod
```bash
kubectl exec -it es-test-client -- sh
# Then run node scripts using the es client:
node --loader ts-node/esm -e "import { esClient } from './es.js'; await esClient.connect(); console.log(await esClient.client.cat.indices())"
```