apiVersion: v1
kind: Service
metadata:
  name: elasticsearch-nodeport
spec:
  type: NodePort
  selector:
    app: elasticsearch-master # label of the pod
  ports:
    - name: elastic
      protocol: TCP
      port: 9200
      targetPort: 9200
      nodePort: 30031