Ai
1 Star 0 Fork 0

hacker007/kubernetes-demos

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
ingress.yaml 874 Bytes
Copy Edit Raw Blame History
yjl authored 2025-05-22 07:24 +08:00 . add: 1.ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-http
annotations: # 注意要开启这两行
kubernetes.io/ingress.class: "nginx"
spec:
# 上面的IngressClass名称
ingressClassName: "nginx"
rules:
# 域名,稍后要通过这个域名访问服务
- host: nginx.k8s.com
http:
paths:
# 路径,访问域名时后面添加的路径
- path: /
pathType: Prefix
backend:
# 要代理的服务和服务的端口
service:
name: nginx-service
port:
number: 80
- host: tomcat.k8s.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: tomcat-service
port:
number: 8080
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/hacker__007/kubernetes-demos.git
git@gitee.com:hacker__007/kubernetes-demos.git
hacker__007
kubernetes-demos
kubernetes-demos
master

Search