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

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.

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:

#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:

I have shared logs of dashboard

please help me , how to the fix issue

@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?

@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

Which protocol do you use in the browser?

Can you, please check Dashboard forwarded service with curl

curl localhost:5601

curl -k https://localhost:5601

@stmx38

Port forwording result with curl

@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-node2:9200”]’
networks:
- opensearch-net

volumes:
opensearch-data1:
opensearch-data2:

networks:
opensearch-net:

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

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)
  2. 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 in the browser and make sure that you are using HTTPS.

@stmx38

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

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

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

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

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

HTTPS - working

1 Like

@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?