[root@k8s-master tf-serving]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 3d5h v1.18.0
worker-node1 Ready <none> 3d4h v1.18.0
worker-node2 Ready <none> 3d4h v1.18.0
[root@k8s-master tf-serving]# kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
apps-hpt ClusterIP 10.98.26.5 <none> 8501/TCP 13m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 60m
[root@k8s-master tf-serving]# kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
apps-hpt 2/2 2 2 13m
[root@k8s-master tf-serving]# kubectl get pods
NAME READY STATUS RESTARTS AGE
apps-hpt-5759d78544-dqftn 1/1 Running 0 12m
apps-hpt-5759d78544-gtthn 1/1 Running 0 13m
[root@k8s-master tf-serving]# kubectl get all -n ingress-nginx
NAME READY STATUS RESTARTS AGE
pod/nginx-ingress-controller-77db54fc46-wdfsc 1/1 Running 0 51m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/ingress-nginx NodePort 10.103.23.194 <none> 80:31443/TCP,443:30858/TCP 4h51m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nginx-ingress-controller 1/1 1 1 4h55m
NAME DESIRED CURRENT READY AGE
replicaset.apps/nginx-ingress-controller-5bb8fb4bb6 0 0 0 4h55m
replicaset.apps/nginx-ingress-controller-77db54fc46 1 1 1 51m
[root@k8s-master tf-serving]# netstat -ntlp|grep 80
tcp 0 0 172.31.10.88:2380 0.0.0.0:* LISTEN 1749/etcd
我有1主2从的集群,上面部署了一个app-hpt的API集群,我想通过ingress-nginx让外网可以访问app-hpt。然后我按照视频,
kubectl label node k8s-master app=ingress
serviceAccountName: nginx-ingress-serviceaccount
hostNetwork: true
nodeSelector:
app: ingress
并执行(试了好多次,所以除了最后一个是configured,其他都是unchanged)
[root@k8s-master tf-serving]# kubectl apply -f mandatory.yaml
namespace/ingress-nginx unchanged
configmap/nginx-configuration unchanged
configmap/tcp-services unchanged
configmap/udp-services unchanged
serviceaccount/nginx-ingress-serviceaccount unchanged
clusterrole.rbac.authorization.k8s.io/nginx-ingress-clusterrole unchanged
role.rbac.authorization.k8s.io/nginx-ingress-role unchanged
rolebinding.rbac.authorization.k8s.io/nginx-ingress-role-nisa-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/nginx-ingress-clusterrole-nisa-binding unchanged
deployment.apps/nginx-ingress-controller unchanged
limitrange/ingress-nginx configured
但是80端口并没有nginx在使用,我该如何一步一步检查配置,以便让ingress-nginx可用,求指导!