Skip to content

Commit

Permalink
add example for deloy obconfigserver using mysql as backend (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-sun-star authored Mar 27, 2024
1 parent ea5467f commit 54896ed
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
60 changes: 60 additions & 0 deletions example/webapp/configserver-mysql.yaml
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions example/webapp/mysql.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 54896ed

Please sign in to comment.