Access Methods

Alauda Database Service for MySQL provides entry points for accessing the database by client applications in several scenarios. In either way the cluster is exposed with regular Kubernetes Service objects , configured by the Operator.

TOC

Procedure

CLI
Web Console
  1. Access the instance using service DNS within the cluster

    mysql -u$username -p$password -h$name.$namespace
  2. Access the instance using NodePort from outside the cluster

  • Enable NodePort

    kubectl patch mysql -n $namespace $name --type merge -p '
    spec:
      pxc:
        proxysql:
          serviceType: NodePort
    '
  • Check NodePort

    kubectl get svc -n $namespace $name-proxysql -o jsonpath='{.spec.ports[0].nodePort}'
  • Access the instance using NodePort

    mysql -u$username -p$password -h$nodeip -P$nodeport
  1. Access the instance using LoadBalancer from outside the cluster
  • Enable LoadBalancer

    kubectl patch mysql -n $namespace $name --type merge -p '
    spec:
      pxc:
        proxysql:
          serviceType: LoadBalancer
    '