Compare commits

...

2 Commits

Author SHA1 Message Date
f637bfb800
feat: 添加 Ingress 和 Service 配置文件
- 新增 ingress.yaml 文件,定义 Ingress 资源以实现网络访问控制
- 新增 service.yaml 文件,创建 Service 以暴露应用程序端口
2024-11-15 00:18:19 +08:00
f1a3f3269d
build(deployment): 添加 http-bin 应用的 Deployment 配置
- 新增 deployment-2.yaml 文件
- 定义了一个名为 http-bin 的 Deployment
- 设置 replicas 为 1
- 使用 kennethreitz/httpbin 镜像创建容器
2024-11-15 00:17:56 +08:00
3 changed files with 51 additions and 0 deletions

24
deployment-2.yaml Normal file
View File

@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: http-bin
name: http-bin
spec:
replicas: 1
selector:
matchLabels:
app: http-bin
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: http-bin
spec:
containers:
- image: kennethreitz/httpbin
name: httpbin
resources: {}
status: {}

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