From 54896edc60b2a89812d15b5d38d2672d8409101d Mon Sep 17 00:00:00 2001 From: chris-sun-star <85611200+chris-sun-star@users.noreply.github.com> Date: Wed, 27 Mar 2024 21:07:56 +0800 Subject: [PATCH] add example for deloy obconfigserver using mysql as backend (#268) --- example/webapp/configserver-mysql.yaml | 60 ++++++++++++++++++++++++++ example/webapp/mysql.yaml | 41 ++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 example/webapp/configserver-mysql.yaml create mode 100644 example/webapp/mysql.yaml diff --git a/example/webapp/configserver-mysql.yaml b/example/webapp/configserver-mysql.yaml new file mode 100644 index 000000000..7128c2888 --- /dev/null +++ b/example/webapp/configserver-mysql.yaml @@ -0,0 +1,60 @@ +apiVersion: v1 +kind: Service +metadata: + name: svc-ob-configserver + namespace: oceanbase +spec: + type: NodePort + selector: + app: ob-configserver + ports: + - name: "http" + port: 8080 + targetPort: 8080 + nodePort: 30080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ob-configserver + namespace: oceanbase +spec: + selector: + matchLabels: + app: ob-configserver + replicas: 1 + template: + metadata: + labels: + app: ob-configserver + spec: + containers: + - name: ob-configserver + image: oceanbase/ob-configserver:1.0.0-2 + ports: + - containerPort: 8080 + name: "http" + env: + - name: DATABASE_TYPE + value: mysql + - name: SVC_ADDRESS + value: $(SVC_OB_CONFIGSERVER_SERVICE_HOST) + - name: SVC_PORT + value: $(SVC_OB_CONFIGSERVER_SERVICE_PORT) + - name: META_HOST + value: $(SVC_MYSQL_SERVICE_HOST) + - name: META_PORT + value: $(SVC_MYSQL_SERVICE_PORT) + - name: META_USER + value: 'root' + - name: META_PASSWORD + value: '******' + - name: META_DATABASE + value: 'configserver' + resources: + limits: + memory: 2Gi + cpu: "1" + requests: + memory: 200Mi + cpu: 100m diff --git a/example/webapp/mysql.yaml b/example/webapp/mysql.yaml new file mode 100644 index 000000000..28b5407b6 --- /dev/null +++ b/example/webapp/mysql.yaml @@ -0,0 +1,41 @@ +apiVersion: v1 +kind: Service +metadata: + name: svc-mysql + namespace: oceanbase +spec: + selector: + app: mysql + ports: + - port: 3306 + protocol: TCP + targetPort: 3306 + type: ClusterIP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: mysql + name: mysql + namespace: oceanbase +spec: + selector: + matchLabels: + app: mysql + template: + metadata: + labels: + app: mysql + spec: + containers: + - env: + - name: MYSQL_ROOT_PASSWORD + value: '******' + image: mysql:5.7 + imagePullPolicy: IfNotPresent + name: mysql + ports: + - containerPort: 3306 + protocol: TCP + restartPolicy: Always