pires / kubernetes-elasticsearch-cluster

Elasticsearch cluster on top of Kubernetes made easy.
Apache License 2.0
1.51k stars 687 forks source link

could not access kibana #119

Closed iahmad-khan closed 7 years ago

iahmad-khan commented 7 years ago

I treid both the ways of acessing kibana , one documented in the readme file using the server_basepath directly , and other using Nodeport.

Can someone explain this:

One can also create an Ingress to expose the service publicly or simly use the service nodeport. In the case one proceeds to do so, one must change the environment variable SERVER_BASEPATH to the match their environment.

If we are going to create a NodePort by changing the kibana-svc.yml file , then what should be the value in SERVER_BASEPATH ? or should it be just removed?

poor-bob commented 7 years ago

I set up Elasticsearch and Kibana recently using the instructions, and with some Googling I was able to figure out kibana using LoadBalancer. Here are my kibana-svc.yaml and kibana-deployment.yaml files respectively:

apiVersion: v1
kind: Service
metadata:
  name: kibana
  namespace: default
  labels:
    component: kibana
spec:
  type: LoadBalancer
  selector:
    component: kibana
  ports:
  - port: 80
    protocol: "TCP"
    name: "http"
    targetPort: 5601
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: kibana
  namespace: default
  labels:
    component: kibana
spec:
  replicas: 2
  selector:
    matchLabels:
     component: kibana
  template:
    metadata:
      labels:
        component: kibana
    spec:
      containers:
      - name: kibana
        image: cfontes/kibana-xpack-less:5.5.0
        env:
        - name: "CLUSTER_NAME"
          value: "myesdb"
#        - name: SERVER_BASEPATH
#          value: /kibana:5601
        - name: XPACK_SECURITY_ENABLED
          value: 'false'
        - name: XPACK_GRAPH_ENABLED
          value: 'false'
        - name: XPACK_ML_ENABLED
          value: 'false'
        - name: XPACK_REPORTING_ENABLED
          value: 'false'
        resources:
          limits:
            cpu: 1000m
          requests:
            cpu: 100m
        ports:
        - containerPort: 5601
          name: kibana
          protocol: TCP

This exposes an external ip address for the kibana service, and I access kibana through http://{external-ip-address}:5601 listed next to the service.

Note: I commented out the SERVER_BASEPATH environment variable as this caused issues and would've required me to do extra work: https://github.com/elastic/kibana/issues/6665

iahmad-khan commented 7 years ago

hi

thanks , i ll try it. but i am using a test k8s deployment using vagrant and vbox. therefore im trying to make it work with nodeport.

cheers, ijaz

On 19 Aug 2017 22:30, "poor-bob" notifications@github.com wrote:

I set up Elasticsearch and Kibana recently using the instructions, and with some Googling I was able to figure out kibana using LoadBalancer. Here are my kibana-svc.yaml and kibana-deployment.yaml files respectively:

apiVersion: v1 kind: Service metadata: name: kibana namespace: default labels: component: kibana spec: type: LoadBalancer selector: component: kibana ports:

  • port: 80 protocol: "TCP" name: "http" targetPort: 5601

apiVersion: extensions/v1beta1 kind: Deployment metadata: name: kibana namespace: default labels: component: kibana spec: replicas: 2 selector: matchLabels: component: kibana template: metadata: labels: component: kibana spec: containers:

  • name: kibana image: cfontes/kibana-xpack-less:5.5.0 env:
    • name: "CLUSTER_NAME" value: "myesdb"

      - name: SERVER_BASEPATH

      value: /kibana:5601

    • name: XPACK_SECURITY_ENABLED value: 'false'
    • name: XPACK_GRAPH_ENABLED value: 'false'
    • name: XPACK_ML_ENABLED value: 'false'
    • name: XPACK_REPORTING_ENABLED value: 'false' resources: limits: cpu: 1000m requests: cpu: 100m ports:
    • containerPort: 5601 name: kibana protocol: TCP

This exposes an external ip address for the kibana service, and I access kibana through http://{external-ip-address}:5601 listed next to the service.

Note: I commented out the SERVER_BASEPATH environment variable as this caused issues and would've required me to do extra work: elastic/kibana#6665 https://github.com/elastic/kibana/issues/6665

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pires/kubernetes-elasticsearch-cluster/issues/119#issuecomment-323548836, or mute the thread https://github.com/notifications/unsubscribe-auth/AM2peKyMF2eRo98AavTNSQJ1sVMqANN-ks5sZ1PxgaJpZM4O5JRX .

poor-bob commented 7 years ago

It should work the same with nodeport. The real key is simply deleting/commenting-out the SERVER_BASEPATH environment.

sjdweb commented 7 years ago

Hi guys, I had issues accessing via

https://<API_SERVER_URL>/api/v1/proxy/namespaces/default/services/kibana/proxy

(I am using kubectl proxy and then using localhost:8001)

Simply remove spec.ports.name for this to work.

Fixed kubectl-svc.yaml file:

apiVersion: v1
kind: Service
metadata:
  name: kibana
  namespace: default
  labels:
    component: kibana
spec:
  selector:
    component: kibana
  ports:
  - port: 80
    targetPort: 5601
    protocol: TCP
pires commented 7 years ago

This is fixed by #123.