# Can't able to connect opensearch and dashboards deployed in kuberneties through opensearch operator

**URL:** <https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761>\
**Category:** OpenSearch Dashboards\
**Tags:** troubleshoot, configure, install\
**Created:** [August 9, 2024, 8:10pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761 "2024-08-09T20:10:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![malyadri](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@malyadri](https://forum.opensearch.org/u/malyadri)\
**Post date:** [August 9, 2024, 8:10pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/1 "2024-08-09T20:10:53Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
opensearch 2.x  
**Describe the issue** :  
I have deployed open search in kuberneties as fer documentaion through opensearch operator

From your cloned OpenSearch Kubernetes Operator repo, navigate to the `opensearch-operator/examples` directory. There you’ll find the `opensearch-cluster.yaml` file, which can be customized to the needs of your cluster, including the `clusterName` that acts as the namespace in which your new OpenSearch cluster will reside.

With your cluster configured, run the `kubectl apply` command.

```auto
kubectl apply -f opensearch-cluster.yaml

```

Once I have deployed the opensearch and opnesearch dashboards those service running succesfully but while access the dashboard i couldn’t able to do .

I allow all ports in my azure kuberneties nsg

**Configuration** :

```auto
#Minimal configuration of a cluster with version 2.X of the operator.
#Note the replacement of 'master' role with 'cluster_manager' on line 49
apiVersion: opensearch.opster.io/v1
kind: OpenSearchCluster
metadata:
  name: my-first-cluster
  namespace: grafana
spec:
  security:
    config:
    tls:
      http:
        generate: true
      transport:
        generate: true
        perNode: true
  general:
    httpPort: 9200
    serviceName: my-first-cluster
    version: 2.14.0
    pluginsList: ["repository-s3"]
    drainDataNodes: true
  dashboards:
    tls:
      enable: true
      generate: true
    version: 2.14.0
    enable: true
    replicas: 1
    resources:
      requests:
        memory: "512Mi"
        cpu: "200m"
      limits:
        memory: "512Mi"
        cpu: "200m"
  nodePools:
    - component: masters
      replicas: 2
      resources:
        requests:
          memory: "2Gi"
          cpu: "1000m"
        limits:
          memory: "2Gi"
          cpu: "1000m"
      roles:
        - "data"
        - "cluster_manager"
      persistence:
        emptyDir: {}

```

**Relevant Logs or Screenshots** :

 ![Screenshot 2024-08-10 013353](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/4/4a6649ec74e39e98112a3a4adc5d67e8db4c304b.jpeg)

---

<div class="post-metadata">

**Author:** ![malyadri](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@malyadri](https://forum.opensearch.org/u/malyadri)\
**Post date:** [August 9, 2024, 8:15pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/2 "2024-08-09T20:15:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/c/cbb1b1a902504dd4db9e722161d680c81e6399fc.png)

I have shared logs of dashboard

please help me , how to the fix issue

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [August 9, 2024, 9:26pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/3 "2024-08-09T21:26:51Z")

</div>

@malyadri I understand that you’ve deployed the OpenSearch cluster and Dashboards in AKS.

Have you tried using Load Balancer as the OpenSearch Dashboards’ service type and Public IP service?

---

<div class="post-metadata">

**Author:** ![malyadri](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@malyadri](https://forum.opensearch.org/u/malyadri)\
**Post date:** [August 9, 2024, 9:59pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/4 "2024-08-09T21:59:05Z")

</div>

@pablo

Yes I changed cluster ip to load balancer but I couldn’t able to access and I couldn’t change cluster Ip to Load Balancer

I am using ingress below configiration but got error

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/d/d10f4899fca67fb0d9ba389b2054a289ccd11074.png)

---

<div class="post-metadata">

**Author:** ![stmx38](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/stmx38/32/4354_2.png) [@stmx38](https://forum.opensearch.org/u/stmx38)\
**Post date:** [August 11, 2024, 5:24pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/5 "2024-08-11T17:24:22Z")

</div>

Which protocol do you use in the browser?

Can you, please check Dashboard forwarded service with curl

```bash
curl localhost:5601

curl -k https://localhost:5601

```

---

<div class="post-metadata">

**Author:** ![malyadri](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@malyadri](https://forum.opensearch.org/u/malyadri)\
**Post date:** [August 11, 2024, 8:01pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/6 "2024-08-11T20:01:18Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/0/09d33a2a53973ab1ec1809691581388e7f83799b.png)

@stmx38

Port forwording result with curl

---

<div class="post-metadata">

**Author:** ![malyadri](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@malyadri](https://forum.opensearch.org/u/malyadri)\
**Post date:** [August 11, 2024, 8:02pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/7 "2024-08-11T20:02:38Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/b/b004827babf66a741fc9db6070a9cd1070d16ffd.png)

@stmx38  
please check port forword image

If i am using docker compose file in docker deployemnt its working fine in my local and I can able to access dashboards

* * *

version: ‘3’  
services:  
opensearch-node1:  
image: opensearchproject/opensearch:latest  
container\_name: opensearch-node1  
environment:  
- cluster.name=opensearch-cluster  
- node.name=opensearch-node1  
- discovery.seed\_hosts=opensearch-node1,opensearch-node2  
- cluster.initial\_cluster\_manager\_nodes=opensearch-node1,opensearch-node2  
- bootstrap.memory\_lock=true # along with the memlock settings below, disables swapping  
- OPENSEARCH\_JAVA\_OPTS=-Xms512m -Xmx512m # minimum and maximum Java heap size, recommend setting both to 50% of system RAM  
- OPENSEARCH\_INITIAL\_ADMIN\_PASSWORD=${OPENSEARCH\_INITIAL\_ADMIN\_PASSWORD} # Sets the demo admin user password when using demo configuration, required for OpenSearch 2.12 and higher  
ulimits:  
memlock:  
soft: -1  
hard: -1  
nofile:  
soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems  
hard: 65536  
volumes:  
- opensearch-data1:/usr/share/opensearch/data  
ports:  
- 9200:9200  
- 9600:9600 # required for Performance Analyzer  
networks:  
- opensearch-net  
opensearch-node2:  
image: opensearchproject/opensearch:latest  
container\_name: opensearch-node2  
environment:  
- cluster.name=opensearch-cluster  
- node.name=opensearch-node2  
- discovery.seed\_hosts=opensearch-node1,opensearch-node2  
- cluster.initial\_cluster\_manager\_nodes=opensearch-node1,opensearch-node2  
- bootstrap.memory\_lock=true  
- OPENSEARCH\_JAVA\_OPTS=-Xms512m -Xmx512m  
- OPENSEARCH\_INITIAL\_ADMIN\_PASSWORD=${OPENSEARCH\_INITIAL\_ADMIN\_PASSWORD}  
ulimits:  
memlock:  
soft: -1  
hard: -1  
nofile:  
soft: 65536  
hard: 65536  
volumes:  
- opensearch-data2:/usr/share/opensearch/data  
networks:  
- opensearch-net  
opensearch-dashboards:  
image: opensearchproject/opensearch-dashboards:latest  
container\_name: opensearch-dashboards  
ports:  
- 5601:5601  
expose:  
- ‘5601’  
environment:  
OPENSEARCH\_HOSTS: ‘[“[https://opensearch-node1:9200](https://opensearch-node1:9200)”,“[https://opensearch-node2:9200](https://opensearch-node2:9200)”]’  
networks:  
- opensearch-net

volumes:  
opensearch-data1:  
opensearch-data2:

networks:  
opensearch-net:

---

<div class="post-metadata">

**Author:** ![malyadri](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@malyadri](https://forum.opensearch.org/u/malyadri)\
**Post date:** [August 11, 2024, 8:08pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/8 "2024-08-11T20:08:50Z")

</div>

@stmx38  
@pablo  
please share opensearch deployment file with enable service load balancer or ingress controller configuration for azure kuberneties service

---

<div class="post-metadata">

**Author:** ![stmx38](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/stmx38/32/4354_2.png) [@stmx38](https://forum.opensearch.org/u/stmx38)\
**Post date:** [August 12, 2024, 3:57am UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/9 "2024-08-12T03:57:42Z")

</div>

I do not use OpenSearch in AKS, but we can find something in Google

1. [Deploy OpenSearch with OpenSearch-Dashboards in Azure Kubernetes Service (AKS)](https://blog.byte.builders/blog/post/deploy-opensearch-with-opensearch-dashboards-in-aks/)
2. [Creating an OpenSearch Ingress service on Azure Kubernetes](https://stackoverflow.com/questions/77483242/creating-an-opensearch-ingress-service-on-azure-kubernetes)

I just wanted to check why do you get `ERR_EMPTY_RESPONSE` in the browser.

Please check [https://localhost:5601](https://localhost:5601) in the browser and make sure that you are using **`HTTPS`**.

---

<div class="post-metadata">

**Author:** ![malyadri](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@malyadri](https://forum.opensearch.org/u/malyadri)\
**Post date:** [August 12, 2024, 6:26am UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/10 "2024-08-12T06:26:57Z")

</div>

@stmx38

I am using only https ,please check above screen shots for your reference tested in curl and broswer

---

<div class="post-metadata">

**Author:** ![stmx38](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/stmx38/32/4354_2.png) [@stmx38](https://forum.opensearch.org/u/stmx38)\
**Post date:** [August 12, 2024, 6:58am UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/11 "2024-08-12T06:58:58Z")

</div>

Yeah, with curl it is clear which protocol is used, but not in the browser

```yaml
curl: curl: (52) Empty reply from server
Chrome: ERR_EMPTY_RESPONSE

```

Type https manually, press a link directly - [https://localhost:5601](https://localhost:5601), use a private tab, check in a different browser.

Just did a check with Kibana in Google Chrome  
**HTTP - not working**

 ![Screenshot 2024-08-12 at 09.53.08](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/7/749ba1f23906bdd7902aa5469981d5536cea1e3d.png)

**HTTPS - working**

 ![Screenshot 2024-08-12 at 09.53.59](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/c/c5dffd185e46741ee6a87d61c2c646d073b61ba8.png)

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [August 12, 2024, 10:02pm UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/12 "2024-08-12T22:02:44Z")

</div>

@malyadri Docker has less complex networking than Kubernetes.  
If you’re using AKS then your ingress controller should pick the Public IP and Ingress redirect you to my-first-cluster-dashboards service and then to OpenSearch Dashboards UI.

Also, your path to OpenSearch Dashboards is /opensearch-dashboards.  
Did you configure opensearch\_dashboards.yml accordingly to support the new path?

---

<div class="post-metadata">

**Author:** ![huybn](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/huybn/32/9131_2.png) [@huybn](https://forum.opensearch.org/u/huybn)\
**Post date:** [May 13, 2025, 8:01am UTC](https://forum.opensearch.org/t/cant-able-to-connect-opensearch-and-dashboards-deployed-in-kuberneties-through-opensearch-operator/20761/13 "2025-05-13T08:01:00Z")

</div>

Same issue here, the solution was indeed using https instead of http to connect to dashboard.

In my case I using Ingress to access other services dashboard, to access OpenSearch’s dashboard, the “[nginx.ingress.kubernetes.io/backend-protocol:](http://nginx.ingress.kubernetes.io/backend-protocol:) HTTPS” configration is required.

Here is the full example.

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-longhorn
  namespace: opensearch
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: HTTPS # <-
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - some.domain
      secretName: domain-tls-secret
  rules:
    - host: prod-server-opensearch.some.domain
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: my-first-cluster-dashboards # <-
                port:
                  number: 5601 # <-

```
