Jan*_*sik 5 elasticsearch kubernetes
我一直在尝试将 opendistro es 映像推出到节点。我已经将 yaml 脚本放在一起,可以做到这一点,但是在进入 pod 并尝试卷曲 localhost 并点击 elasticsearch API 时,我收到错误:
curl: (7) Failed to connect to ::1: Cannot assign request address
Run Code Online (Sandbox Code Playgroud)
这是下面的 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
Run Code Online (Sandbox Code Playgroud)
此时我不知道缺少什么
Jan*_*sik -3
Docker 容器日志的 Ran 日志:
请参阅:https ://discuss.opendistrocommunity.dev/t/securityadmin-sh-is-not-work-welll/618
这解决了问题,以防有人遇到它
缺少 SSL 导致容器不接受流量
| 归档时间: |
|
| 查看次数: |
8554 次 |
| 最近记录: |