创建hostnetwork-ingress.yaml文件;
apiVersion: networking.k8s.io/v1kind: Ingress
metadata:
name: nodeport-ingress
namespace: default
spec:
rules:
- host: aa.bb.cc
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: nginx-service
port:
number: 80
创建ingress资源;
#创建ingresskubectl apply -f hostnetwork-ingress.yaml
#检查ingress资源
kubectl get ingress
检查资源的访问;
curl -v -H 'host: aa.bb.cc'image.png 结束
欢迎大家点点关注,点点赞!