apiVersion: apps/v1
kind: Deployment
metadata:
name: eks-deploy
spec:
replicas: 1
selector:
matchLabels:
app: eks
template:
metadata:
labels:
app: eks
spec:
containers:
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.1
---
apiVersion: v1
kind: Service
metadata:
name: eks-srv
spec:
selector:
app: eks
ports:
- name: eks-db
protocol: TCP
port: 9200
targetPort: 9200
This specific code snippet is integral to deploying Elastic Search for my current project using skaffold. However, upon attempting to connect to the Elastic Search instance running on port 9200, I encounter an error stating that the connection has been rejected.
const client: NewTypes = new Client({
node: 'http://localhost:9200'
})
interface Source {
foo: string
}
const request: estypes.IndexRequest<Source> = {
index: 'test',
body: {
foo: 'bar'
}
}
await client.index(request);
I am unsure of what I may be doing incorrectly in this setup. Any insights or feedback would be greatly appreciated.