Update mysql.yaml

master
buaa21376224 1 year ago
parent a83047f28e
commit 70826703df

@ -1,10 +1,14 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: microservice-mysql-deployment name: microservice-mysql-deployment
spec: spec:
# Pod 副本数量维持在 1 # Pod 副本数量维持在 1
# 补全标签选择器 # 补全标签选择器
replicas: 1
selector:
matchLabels:
app: medshare-mysql
template: template:
metadata: metadata:
labels: labels:
@ -20,6 +24,19 @@ spec:
# MYSQL_ROOT_HOST -> '%' # MYSQL_ROOT_HOST -> '%'
# MYSQL_ROOT_PASSWORD -> "123456" # MYSQL_ROOT_PASSWORD -> "123456"
# MYSQL_USER -> ehr # MYSQL_USER -> ehr
ports:
- containerPort: 3306
env:
- name: MYSQL_DATABASE
value: "ehr"
- name: MYSQL_PASSWORD
value: "ehr"
- name: MYSQL_ROOT_HOST
value: "%"
- name: MYSQL_ROOT_PASSWORD
value: "123456"
- name: MYSQL_USER
value: "ehr"
--- ---
kind: Service kind: Service
apiVersion: v1 apiVersion: v1
@ -28,3 +45,10 @@ metadata:
spec: spec:
# 补全标签选择器 # 补全标签选择器
# 以 TCP 协议代理 3306 端口 # 以 TCP 协议代理 3306 端口
selector:
app: medshare-mysql
ports:
- name: "mysql"
protocol: TCP
port: 3306
targetPort: 3306
Loading…
Cancel
Save