我一直在尝试将一个开放发行版的镜像推送到一个节点上。我已经把一个yaml脚本放在一起,它可以做到这一点,但在进入pod并试图卷曲localhost并访问elasticsearch API时,我得到了错误:
curl: (7) Failed to connect to ::1: Cannot assign request address下面是yaml脚本,也许我做错了什么
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在这一点上,我不知道缺少了什么
发布于 2020-04-15 07:31:44
运行Docker容器日志的日志:
请参阅:https://discuss.opendistrocommunity.dev/t/securityadmin-sh-is-not-work-welll/618
这解决了问题,以防任何人遇到它
缺少SSL导致容器无法接受流量
https://stackoverflow.com/questions/61198348
复制相似问题