Cloud Native 8 min read

How to Deploy OceanBase OBProxy and Dashboard on Kubernetes: Step‑by‑Step Guide

This guide walks you through deploying OceanBase OBProxy and the OceanBase Dashboard on a Kubernetes cluster using yaml manifests, a setup script, and Helm, covering environment requirements, configuration details, verification steps, and access instructions.

Xiaolei Talks DB
Xiaolei Talks DB
Xiaolei Talks DB
How to Deploy OceanBase OBProxy and Dashboard on Kubernetes: Step‑by‑Step Guide

Deployment environment: Kubernetes v1.21, OBProxy version bproxy-ce:4.2.1.0-11, OceanBase Dashboard 0.3.1.

Component overview: OBProxy (OceanBase Database Proxy) routes client requests to the appropriate OBServer node in a distributed OceanBase cluster. OceanBase Dashboard (OCP) is a web UI for managing clusters, tenants, backups, monitoring, etc., running in K8s.

Deploy OBProxy – method 1: yaml + kubectl apply.

<code>apiVersion: v1
kind: Service
metadata:
  name: svc-obproxy
  namespace: oceanbase-test1
spec:
  type: ClusterIP
  clusterIP: None
  selector:
    app: obproxy
  ports:
  - name: "sql"
    port: 2883
    targetPort: 2883
  - name: "prometheus"
    port: 2884
    targetPort: 2884
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: obproxy
  namespace: oceanbase-test1
spec:
  selector:
    matchLabels:
      app: obproxy
  replicas: 2
  template:
    metadata:
      labels:
        app: obproxy
    spec:
      containers:
      - name: obproxy
        image: oceanbase/obproxy-ce:4.2.1.0-11
        ports:
        - containerPort: 2883
          name: "sql"
        - containerPort: 2884
          name: "prometheus"
        env:
        - name: APP_NAME
          value: ob_test1_obproxy
        - name: OB_CLUSTER
          value: obcluster
        - name: RS_LIST
          value: {ob-pod-ip1}:2881;{ob-pod-ip2}:2881;{ob-pod-ip3}:2881
        - name: PROXYRO_PASSWORD
          valueFrom:
            secretKeyRef:
              name: ob-proxyro-password
              key: password
        resources:
          limits:
            memory: 8Gi
            cpu: "8"
          requests:
            memory: 8Gi
            cpu: "8"</code>

Apply the manifest:

<code>kubectl apply -f oceanbase-obproxy.yaml -n oceanbase-test1</code>

Deploy OBProxy – method 2: setup‑obproxy.sh script.

<code>bash setup-obproxy.sh -n oceanbase-test1 --proxy-image oceanbase/obproxy-ce:4.2.1.0-11 -d obproxy-test obcluster</code>

Check OBProxy pods:

<code>kubectl get pods -n oceanbase-test1 -o wide</code>

Connect to OceanBase through OBProxy:

<code>mysql -h10.xxx.xxx.182 -P2883 -uroot@sys -p oceanbase -A -c</code>

Deploy OceanBase Dashboard using Helm (version 0.3.1):

<code>helm install ob-ocp ob-operator/oceanbase-dashboard --version=0.3.1 -n oceanbase-dashboard --create-namespace</code>

Expose the dashboard (NodePort 30502) and access it via http:// :30502 with default admin credentials (password must be reset on first login).

Summary: Both OBProxy and OceanBase Dashboard were successfully installed on a Kubernetes cluster, providing stateless SQL routing and a management UI. OBProxy is recommended for production traffic, while the dashboard offers cluster monitoring though some features are still under development.

cloud nativeKubernetesDashboardOceanBaseHelmDatabase ProxyOBproxy
Xiaolei Talks DB
Written by

Xiaolei Talks DB

Sharing daily database operations insights, from distributed databases to cloud migration. Author: Dai Xiaolei, with 10+ years of DB ops and development experience. Your support is appreciated.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.