From f637bfb800a588c5394879b706aba6e2ec09e1ca Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Fri, 15 Nov 2024 00:18:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20Ingress=20?= =?UTF-8?q?=E5=92=8C=20Service=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 ingress.yaml 文件,定义 Ingress 资源以实现网络访问控制 - 新增 service.yaml 文件,创建 Service 以暴露应用程序端口 --- ingress.yaml | 16 ++++++++++++++++ service.yaml | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 ingress.yaml create mode 100644 service.yaml diff --git a/ingress.yaml b/ingress.yaml new file mode 100644 index 0000000..d627be2 --- /dev/null +++ b/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: gatewayyy-ingress +spec: + rules: + - host: gatewayyy.example.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: gatewayyy-service + port: + number: 80 \ No newline at end of file diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..95e2da5 --- /dev/null +++ b/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: gatewayyy-service +spec: + selector: + app: gatewayyy + ports: + - protocol: TCP + port: 80 + targetPort: 80 \ No newline at end of file