<p>I am trying to deploy Kibana in my Kubernetes cluster which is on AWS. To access the Kibana dashboard I have created an ingress which is mapped to xyz.com. Here is my Kibana deployment file.</p>

<pre><code>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
</code></pre>

<p>Whenever I deploy it, it gives me the following error. What should my SERVER_BASEPATH be in order for it to work? I know it defaults to /app/kibana.</p>

<pre><code>FATAL { ValidationError: child "server" fails because [child "basePath" fails because ["basePath" with value "&amp;#x2f;" 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.&lt;anonymous&gt; (/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 &lt;anonymous&gt;
    at process._tickCallback (internal/process/next_tick.js:188:7)
  isJoi: true,
  name: 'ValidationError',
  details: 
   [ { message: '"basePath" with value "&amp;#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] }
</code></pre>

<p>I followed this guide <a href="https://github.com/pires/kubernetes-elasticsearch-cluster" rel="nofollow noreferrer">https://github.com/pires/kubernetes-elasticsearch-cluster</a></p>

<p>Any idea what might be the issue ?</p>

Anshul Tripathi
<p>I believe that the <a href="https://github.com/elastic/kibana/blob/master/config/kibana.yml" rel="nofollow noreferrer">example config</a> in the official kibana repository gives a hint on the cause of this problem, here's the <code>server.basePath</code> setting:</p>

<pre><code># 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: ""
</code></pre>

<p>The fact that the <code>server.basePath</code> cannot end in a slash could mean that kibana interprets your setting as ending in a slash basically. I've not dug deeper into this though. </p>

<p>This error message is interesting:</p>

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

<p>So this error message are a complement to the documentation: don't end in a slash and don't start with a slash. Something like that.</p>

<p>I reproduced this in <code>minikube</code> using your Deployment manifest but i removed the volume mount parts at the end. Changing <code>SERVER_BASEPATH</code> to <code>/&lt;SOMETHING&gt;</code> works fine, so basically i think you just need to set a proper basepath.</p>
