OpenSearch Dashboard not working

Versions

Docker v20.10.23
Minikube v1.29.0
Kubernetes v1.26.1
OpenSearch - Operator v2.2.1


Describe the issue:

When I forward the OpenSearch dashboard to port 5601 and open http://localhost:5601 in my browser, the page loads (showing UI to enter user and password) but the console registers error - 401 Unauthorized.

(Screenshot by Lightshot)

Then, when I try to access the dashboard with admin / admin it just returns 500 - Internal Server Error.

(Screenshot by Lightshot)


IGNORE THIS PART, SOLVED: I tried recreating this error again but now the dashboards pod will not start properly. It gives the following error:

{"type":"log","@timestamp":"2023-03-15T10:04:16Z","tags":["error","savedobjects-service"],"pid":1,"message":"Unable to retrieve version information from OpenSearch nodes."}

I looked up this error and only found 1 article talking about this (https://forum.opensearch.org/t/unable-to-retrieve-version-information-from-opensearch-nodes/6946) which doesn’t really help me because I’m using a single .yaml to define my environment and I do not specify hosts / user / password there.
The article talks about a opensearch_dashboards.yml which I don’t use.


CONTINUE HERE: After waiting for about half an hour, the dashboards pod finally got configured (weird that it took that long) and then followed the coordinators / masters / nodes pods. Therefore, I can now recrate the 401 error for which I originally made the post for.

Current state of my pods:
https://prnt.sc/pnsCM06Q2FMV


Configuration:

This is the command order that I execute from scratch:

  1. minikube start --cpus=8 --memory=6017 (otherwise it has insufficient cpu / memory and the pods won’t load)

  2. helm repo add opensearch-operator https://opster.github.io/opensearch-k8s-operator/

  3. helm install my-opensearch-operator opensearch-operator/opensearch-operator --version 2.2.1

At this point, the controller manager pod is created correctly without errors:

Then, I navigate to the folder that contains the OpenSearch .yaml file to create the OpenSearch cluster. This is the opensearch-cluster.yaml file that I use:

apiVersion: opensearch.opster.io/v1
kind: OpenSearchCluster
metadata:
  name: my-cluster
  namespace: default
spec:
  general:
    version: 1.3.0
    httpPort: 9200
    vendor: opensearch
    serviceName: my-cluster
    pluginsList: ["repository-s3","https://github.com/aiven/prometheus-exporter-plugin-for-opensearch/releases/download/1.3.0.0/prometheus-exporter-1.3.0.0.zip"]
  dashboards:
    version: 1.3.0
    enable: true
    replicas: 1
    resources:
      requests:
         memory: "1Gi"
         cpu: "500m"
      limits:
         memory: "1Gi"
         cpu: "500m"
  confMgmt:
    smartScaler: true
  nodePools:
    - component: masters
      replicas: 1
      diskSize: "30Gi"
      nodeSelector:
      resources:
         requests:
            memory: "1Gi"
            cpu: "500m"
         limits:
            memory: "1Gi"
            cpu: "500m"
      roles:
        - "master"
        - "data"
    - component: nodes
      replicas: 1
      diskSize: "30Gi"
      nodeSelector:
      resources:
         requests:
            memory: "1Gi"
            cpu: "500m"
         limits:
            memory: "1Gi"
            cpu: "500m"
      roles:
        - "data"
    - component: coordinators
      replicas: 1
      diskSize: "30Gi"
      nodeSelector:
      resources:
         requests:
            memory: "1Gi"
            cpu: "500m"
         limits:
            memory: "1Gi"
            cpu: "500m"
      roles:
        - "ingest"
  1. kubectl apply -f opensearch-cluster.yaml

When the command is executed, all the pods start creating.

https://prnt.sc/os7hYK1SBtCN

However, the bootstrap pod won’t create properly because of a problem with not enough max virtual memory areas.

To solve this, a command to increase that needs to be run:

  1. wsl -d docker-desktop sysctl -w vm.max_map_count=262144

Here is a screenshot of all pods finally configured.

They take an hour and a half since they are created until they restart for the last time before finally being 1/1 Ready and Running.

https://prnt.sc/pnsCM06Q2FMV

Then after a short wait, they all eventually start running and become ready (Ready 1/1).

  1. kubectl port-forward svc/my-cluster-dashboards 5601

  2. Open in browser: http://localhost:5601

Now when I open developer tools, I get the 401 error.

https://prnt.sc/hjY4KaPMZiV8

  1. Enter credentials admin / admin

And after entering the credentials, I get 500 - Internal Server Error:

https://prnt.sc/vn5AV5L3_wHz