[root@m1 8-ingress]# cat tcp-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: tcp-services
namespace: ingress-nginx
# 需要暴露的端口 和 服务,对外端口30000
data:
"30000": dev/web-demo:80
[root@m1 8-ingress]# kubectl apply -f tcp-config.yaml
configmap/tcp-services unchanged
[root@m1 8-ingress]# kubectl get cm -n ingress-nginx
NAME DATA AGE
ingress-controller-leader-nginx 0 6d18h
nginx-configuration 0 6d18h
[root@m1 8-ingress]# kubectl get cm -n ingress-nginx
NAME DATA AGE
ingress-controller-leader-nginx 0 6d18h
nginx-configuration 0 6d18h
tcp-services 1 3s
[root@s1 ~]# netstat -ntlp|grep 30000
[root@s1 ~]#
[root@s2 ~]# netstat -ntlp|grep 30000
[root@s2 ~]#
两个工作节点,都没有 30000 端口的呢?