Less than 1 minute
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hellok8s-ingress
spec:
ingressClassName: nginx # 指定ingress控制器
defaultBackend: # 【默认后端】接收那些 没有被任何规则匹配的流量
service:
name: service-hellok8s-clusterip
port:
number: 3000
rules:
- http:
paths:
- path: /hello
pathType: Prefix
backend:
service:
name: service-hellok8s-clusterip
port:
number: 3000