feat: 添加 Ingress 和 Service 配置文件

- 新增 ingress.yaml 文件,定义 Ingress 资源以实现网络访问控制
- 新增 service.yaml 文件,创建 Service 以暴露应用程序端口
This commit is contained in:
suyiiyii 2024-11-15 00:18:19 +08:00
parent f1a3f3269d
commit f637bfb800
Signed by: suyiiyii
GPG Key ID: 044704CB29B8AD85
2 changed files with 27 additions and 0 deletions

16
ingress.yaml Normal file
View File

@ -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

11
service.yaml Normal file
View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: gatewayyy-service
spec:
selector:
app: gatewayyy
ports:
- protocol: TCP
port: 80
targetPort: 80