From a83047f28ef0bf73db44394d20bdcfe23b645c13 Mon Sep 17 00:00:00 2001 From: buaa21376224 <1714334011@qq.com> Date: Tue, 7 May 2024 23:37:15 +0800 Subject: [PATCH] Update glassfish.yaml --- glassfish.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/glassfish.yaml b/glassfish.yaml index 2d5f429..239a3c6 100644 --- a/glassfish.yaml +++ b/glassfish.yaml @@ -1,10 +1,14 @@ -apiVersion: apps/v1 + apiVersion: apps/v1 kind: Deployment metadata: name: microservice-glassfish-deployment spec: # Pod 副本数量维持在 1 # 补全标签选择器 + replicas: 1 + selector: + matchLabels: + app: microservice-glassfish template: metadata: labels: @@ -14,6 +18,9 @@ spec: - image: yylonly/medshare_glassfish:latest name: microservice-glassfish # 暴露 8080 和 4848 端口 + ports: + - containerPort: 8080 + - containerPort: 4848 --- kind: Service apiVersion: v1 @@ -21,9 +28,18 @@ metadata: name: microservice-glassfish-service spec: # 补全标签选择器 + selector: + app: microservice-glassfish ports: - name: "web" # 以 TCP 协议在公网代理 8080 端口暴露至 30000 端口 + protocol: TCP + port: 30000 + targetPort: 8080 - name: "manage" # 以 TCP 协议在公网代理 4848 端口暴露至 31000 端口 + protocol: TCP + port: 31000 + targetPort: 4848 # 补全 type 属性 + type: LoadBalancer