[root@k8smaster ~]# kubectl apply -f ingress-rule.yaml
[root@k8smaster ~]# kubectl get ing
NAME CLASS HOSTS ADDRESS PORTS AGE
ingress-host-bar nginx hello.xiaozhi.com,demo.xiaozhi.com 192.168.68.145 80 12m
[root@k8smaster ~]# kubectl get service -A
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default hello-server ClusterIP 10.96.179.231 <none> 8000/TCP 142m
default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 12d
default my-dep-01 NodePort 10.96.235.249 <none> 8000:30267/TCP 178m
default nginx-demo ClusterIP 10.96.221.252 <none> 8000/TCP 142m
ingress-nginx ingress-nginx-controller NodePort 10.96.183.241 <none> 80:32128/TCP,443:31148/TCP 160m
ingress-nginx ingress-nginx-controller-admission ClusterIP 10.96.31.69 <none> 443/TCP 160m
kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 12d
kubernetes-dashboard dashboard-metrics-scraper ClusterIP 10.96.219.52 <none> 8000/TCP 12d
kubernetes-dashboard kubernetes-dashboard NodePort 10.96.235.195 <none> 443:32476/TCP 12d
[root@k8smaster ~]#