Compare commits

...

2 Commits

@ -5,6 +5,10 @@ metadata:
spec: spec:
# Pod 副本数量维持在 1 # Pod 副本数量维持在 1
# 补全标签选择器 # 补全标签选择器
replicas: 1
selector:
matchLabels:
app: microservice-glassfish
template: template:
metadata: metadata:
labels: labels:
@ -14,6 +18,9 @@ spec:
- image: yylonly/medshare_glassfish:latest - image: yylonly/medshare_glassfish:latest
name: microservice-glassfish name: microservice-glassfish
# 暴露 8080 和 4848 端口 # 暴露 8080 和 4848 端口
ports:
- containerPort: 8080
- containerPort: 4848
--- ---
kind: Service kind: Service
apiVersion: v1 apiVersion: v1
@ -21,9 +28,18 @@ metadata:
name: microservice-glassfish-service name: microservice-glassfish-service
spec: spec:
# 补全标签选择器 # 补全标签选择器
selector:
app: microservice-glassfish
ports: ports:
- name: "web" - name: "web"
# 以 TCP 协议在公网代理 8080 端口暴露至 30000 端口 # 以 TCP 协议在公网代理 8080 端口暴露至 30000 端口
protocol: TCP
port: 30000
targetPort: 8080
- name: "manage" - name: "manage"
# 以 TCP 协议在公网代理 4848 端口暴露至 31000 端口 # 以 TCP 协议在公网代理 4848 端口暴露至 31000 端口
protocol: TCP
port: 31000
targetPort: 4848
# 补全 type 属性 # 补全 type 属性
type: LoadBalancer

@ -5,6 +5,10 @@ metadata:
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