Cannot assign requested address ::1:

4/13/2020

I've been trying to push out an opendistro es image out to a node. I've put a yaml script together thats been able to do so, but upon entering the pod and trying to curl localhost and hit the elasticsearch API, I get the error:

curl: (7) Failed to connect to ::1: Cannot assign request address

Here's the yaml script below, maybe I've done something obviously wrong

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: es-opendistro
  labels:
    service: es-opendistro
spec:
  serviceName: es-opendisro
  replicas: 1
  selector:
    matchLabels:
      name: es-opendistro
  template:
    metadata:
      labels:
        service: es-opendistro
        name: es-opendistro
    spec:
      nodeSelector:
        name: es-opendistro
      initContainers:
      - name: init-sysctl
        image: busybox:1.30
        command: ["sysctl", "-w", "vm.max_map_count=262144"]
        securityContext:
          privileged: true
      containers:
      - name: es-opendistro
        image: CM-DEPLOYER:5000/elasticsearch-opendistro:0.10.0
        env:
        - name: ES_JAVA_OPTS
          value: -Xms1024m -Xmx1024m
        - name: discovery.type
          value: single-node
        - name: NETWORK_HOST
          value: "_site_,_lo_"
        ports:
        - containerPort: 9200
          name: http
          protocol: TCP
        - containerPort: 9300
          name: transport
          protocol: TCP
        volumeMounts:
        - name: internal-users
          mountPath: /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml
          subPath: internal_users.yml
        - name: elasticsearch-log
          mountPath: /var/log/elasticsearch
        - name: elasticsearch-data
          mountPath: /usr/share/elasticsearch/data
        - name: elasticsearch-config
          mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
          subPath: elasticsearch.yml
      volumes:
        - name: internal-users
          configMap:
            name: internal-users
        - name: elasticsearch-log
          hostPath:
            path: elasticsearch-log
        - name: elasticsearch-data
          hostPath:
            path: /mnt/esdata1
        - name: elasticsearch-config
          hostPath:
            path: /usr/share/elasticsearch
---
apiVersion: v1
kind: Service
metadata:
  name: es6
spec:
  type: NodePort
  ipFamily: IPv4
  selector:
    service: es-opendistro
  ports:
  - name: "9200"
    port: 9200
    targetPort: 9200
    nodePort: 30001
  - name: "9300"
    port: 9300
    targetPort: 9300
    nodePort: 30002

At this point I have no idea what's missing

-- Jan .Jedrasik
elasticsearch
kubernetes

1 Answer

4/14/2020

Ran logs for Docker Container logs:

See: https://discuss.opendistrocommunity.dev/t/securityadmin-sh-is-not-work-welll/618

This resolved the issue in case anyone comes across it

Lack of SSL caused the container to not accept traffic

-- Jan .Jedrasik
Source: StackOverflow