<p>I am trying to access the Kibana dashboard while trying to set up fluentd-elasticsearch on premises. This is the <a href="https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch" rel="nofollow noreferrer">link</a> which I followed. I checked the logs of Kibana's pod. It shows the following error:</p>

<pre><code>{"type":"log","@timestamp":"2018-09-19T21:45:42Z","tags":["warning","config","deprecation"],"pid":1,"message":"You should set server.basePath along with server.rewriteBasePath. Starting in 7.0, Kibana will expect that all requests start with server.basePath rather than expecting you to rewrite the requests in your reverse proxy. Set server.rewriteBasePath to false to preserve the current behavior and silence this warning."}
root@mTrainer3:/logging# kubectl logs kibana-logging-66d577d965-mbbg5 -n kube-system
{"type":"log","@timestamp":"2018-09-19T21:45:42Z","tags":["warning","config","deprecation"],"pid":1,"message":"You should set server.basePath along with server.rewriteBasePath. Starting in 7.0, Kibana will expect that all requests start with server.basePath rather than expecting you to rewrite the requests in your reverse proxy. Set server.rewriteBasePath to false to preserve the current behavior and silence this warning."}
{"type":"log","@timestamp":"2018-09-19T21:46:08Z","tags":["status","plugin:kibana@6.4.1","info"],"pid":1,"state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
</code></pre>

<p>Could anybody suggest how I can resolve this issue?</p>

<p><em>After a discussion it was more clear what seems to be wrong.</em></p>

<p>You are using a local cluster with no load balancer. You have to set either an ingress or use NodePort as the service type. I am going to describe the solution with NodePort. Two steps to take:</p>

<ol>
<li>Modify the <code>kibana-deployment.yaml</code> and remove the following under <code>env</code>:</li>
</ol>

<pre><code>- name: SERVER_BASEPATH
  value: /api/v1/namespaces/kube-system/services/kibana-logging/proxy
</code></pre>



<p>so that you <code>kibana-deployment.yaml</code> looks like:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: kibana-logging
  namespace: kube-system
  labels:
    k8s-app: kibana-logging
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: Reconcile
spec:
  replicas: 1
  selector:
  matchLabels:
    k8s-app: kibana-logging
  template:
    metadata:
      labels:
        k8s-app: kibana-logging
      annotations:
        seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
    spec:
      containers:
      - name: kibana-logging
        image: docker.elastic.co/kibana/kibana-oss:6.3.2
        resources:
          # need more cpu upon initialization, therefore burstable class
          limits:
            cpu: 1000m
          requests:
            cpu: 100m
        env:
          - name: ELASTICSEARCH_URL
            value: http://elasticsearch-logging:9200
        ports:
        - containerPort: 5601
          name: ui
          protocol: TCP
</code></pre>

<ol start="2">
<li>Modify <code>kibana-service.yaml</code> to set the service type to NodePort:</li>
</ol>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: kibana-logging
  namespace: kube-system
  labels:
    k8s-app: kibana-logging
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: Reconcile
    kubernetes.io/name: "Kibana"
spec:
  type: NodePort
  ports:
  - port: 5601
    protocol: TCP
    targetPort: ui
    nodePort: 30601
  selector:
    k8s-app: kibana-logging
</code></pre>



<p>Then execute</p>

<pre><code>kubectl apply -f kibana-deployment.yaml
kubectl apply -f kibana-service.yaml
</code></pre>

<p>Kibana should be accessible at <code>http://&lt;clusterip&gt;:30601</code></p>

<p><strong>Background</strong></p>

<p>You will directly access <code>http://clusterip:30601</code> without the given base path. So this must be removed, so that kibana is using <code>/</code> as base path. Otherwise it will try to append the base path /api/v1/[...] to your url. You can try it if you want to test it.</p>

<p><a href="https://discuss.elastic.co/t/plugin-installation-failure/63422/4" rel="nofollow noreferrer">This comment from an elastic search guy mentions</a>, that you have to remove the base_path completely if you want to use <code>/</code>.</p>

<p>Modifying the service to NodePort is neccessary as K8s does not publish ports by default. I just answered a similar issue on <a href="https://stackoverflow.com/questions/52413160/connect-connection-refused-when-connecting-prometheus-to-kubernetes/52414776#52414776">this question</a>. </p>

<p><strong>Original answer (wrong)</strong></p>

<p>In the repo you were linking I can see that the kibana-deployment.yaml has to environment variables to set:</p>

<pre><code>env:
  - name: ELASTICSEARCH_URL
    value: http://elasticsearch-logging:9200
  - name: SERVER_BASEPATH
    value: /api/v1/namespaces/kube-system/services/kibana-logging/proxy
</code></pre>

<p>Did you set them accordingly?</p>

<p>Let's assume you have an ingress, loadbalancer or NodePort directly to the kibana instance so that you want to reach it directly with <a href="http://yourserver:9200/" rel="nofollow noreferrer">http://yourserver:9200/</a>. Then the <code>SERVER_BASEPATH</code> is <code>/</code></p>
