4.1 Accessing the NDB Cluster

To provide access to the NDB Cluster by applications, NDB Operator creates two load balancer services on top of the pods running NDB Cluster nodes. These services are listed here:

  • Management server load balancer (ndb_cluster_name-mgmd-ext): Provides access to the NDB Cluster management servers

  • MySQL server (SQL node) load balancer (ndb_cluster_name-mysqld-ext): Provides access to the NDB Cluster SQL nodes

An application running either inside or outside the Kubernetes cluster can make use of one or both of these services to connect to an NDB Cluster.

Each MySQL server is set up with a root account and a random password. The password is base-64 encoded and stored in a Kubernetes secret whose name has the format ndb_cluster_name-mysqld-root-password. The password can be retrieved using a command like the one shown here:

> base64 -d <<< \
  $(kubectl get secret example-ndb-mysqld-root-password \
  -o jsonpath={.data.password})

You can also set a custom password. Create a Kubernetes secret containing the password.

After this, set the name of the secret to the value of the rootPasswordSecretName field of the mysqld spec (see Section 5.9, “NdbMysqldSpec Resource”).