feat: 添加 Ingress 和 Service 配置文件
- 新增 ingress.yaml 文件,定义 Ingress 资源以实现网络访问控制 - 新增 service.yaml 文件,创建 Service 以暴露应用程序端口
This commit is contained in:
parent
f1a3f3269d
commit
f637bfb800
16
ingress.yaml
Normal file
16
ingress.yaml
Normal 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
11
service.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: gatewayyy-service
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: gatewayyy
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 80
|
Loading…
x
Reference in New Issue
Block a user