无法访问Kibana仪表板

时间:2018-08-22 17:43:00

标签: elasticsearch kubernetes kibana kubernetes-ingress

我正在尝试在AWS上的Kubernetes集群中部署Kibana。要访问Kibana仪表板,我创建了一个入口,该入口已映射到xyz.com。这是我的Kibana部署文件。

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: kibana
  labels:
    component: kibana
spec:
  replicas: 1
  selector:
    matchLabels:
     component: kibana
  template:
    metadata:
      labels:
        component: kibana
    spec:
      containers:
      - name: kibana
        image: docker.elastic.co/kibana/kibana-oss:6.3.2
        env:
        - name: CLUSTER_NAME
          value: myesdb
        - name: SERVER_BASEPATH
          value: /
        resources:
          limits:
            cpu: 1000m
          requests:
            cpu: 100m
        ports:
        - containerPort: 5601
          name: http
        readinessProbe:
          httpGet:
            path: /api/status
            port: http
          initialDelaySeconds: 20
          timeoutSeconds: 5
        volumeMounts:
          - name: config
            mountPath: /usr/share/kibana/config
            readOnly: true
      volumes:
        - name: config
          configMap:
            name: kibana-config

每当我部署它时,都会出现以下错误。为了使其正常工作,我的SERVER_BASEPATH应该是什么?我知道它默认为/ app / kibana。

FATAL { ValidationError: child "server" fails because [child "basePath" fails because ["basePath" with value "/" fails to match the start with a slash, don't end with one pattern]]
    at Object.exports.process (/usr/share/kibana/node_modules/joi/lib/errors.js:181:19)
    at internals.Object._validateWithOptions (/usr/share/kibana/node_modules/joi/lib/any.js:651:31)
    at module.exports.internals.Any.root.validate (/usr/share/kibana/node_modules/joi/lib/index.js:121:23)
    at Config._commit (/usr/share/kibana/src/server/config/config.js:119:35)
    at Config.set (/usr/share/kibana/src/server/config/config.js:89:10)
    at Config.extendSchema (/usr/share/kibana/src/server/config/config.js:62:10)
    at _lodash2.default.each.child (/usr/share/kibana/src/server/config/config.js:51:14)
    at arrayEach (/usr/share/kibana/node_modules/lodash/index.js:1289:13)
    at Function.<anonymous> (/usr/share/kibana/node_modules/lodash/index.js:3345:13)
    at Config.extendSchema (/usr/share/kibana/src/server/config/config.js:50:31)
    at new Config (/usr/share/kibana/src/server/config/config.js:41:10)
    at Function.withDefaultSchema (/usr/share/kibana/src/server/config/config.js:34:12)
    at KbnServer.exports.default (/usr/share/kibana/src/server/config/setup.js:9:37)
    at KbnServer.mixin (/usr/share/kibana/src/server/kbn_server.js:136:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  isJoi: true,
  name: 'ValidationError',
  details: 
   [ { message: '"basePath" with value "&#x2f;" fails to match the start with a slash, don\'t end with one pattern',
       path: 'server.basePath',
       type: 'string.regex.name',
       context: [Object] } ],
  _object: 
   { pkg: 
      { version: '6.3.2',
        branch: '6.3',
        buildNum: 17307,
        buildSha: '53d0c6758ac3fb38a3a1df198c1d4c87765e63f7' },
     dev: { basePathProxyTarget: 5603 },
     pid: { exclusive: false },
     cpu: { cgroup: [Object] },
     cpuacct: { cgroup: [Object] },
     server: { name: 'kibana', host: '0', basePath: '/' } },
  annotate: [Function] }

我遵循了本指南https://github.com/pires/kubernetes-elasticsearch-cluster

任何想法可能是什么问题?

1 个答案:

答案 0 :(得分:1)

我相信官方的kibana存储库中的example config会提示此问题的原因,这是server.basePath的设置:

# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath
# from requests it receives, and to prevent a deprecation warning at startup.
# This setting cannot end in a slash.
#server.basePath: ""

server.basePath不能以斜杠结尾的事实可能意味着kibana基本上将您的设置解释为以斜杠结尾。我还没有对此进行更深入的研究。

此错误消息很有趣:

message: '"basePath" with value "&#x2f;" fails to match the start with a slash, don\'t end with one pattern'

因此,此错误消息是对文档的补充:不要以斜杠结尾,也不要以斜杠开头。这样的事情。

我在minikube中使用您的Deployment清单复制了此文件,但最后删除了卷安装部分。将SERVER_BASEPATH更改为/<SOMETHING>很好,所以基本上我认为您只需要设置一个适当的基本路径即可。