我正在尝试安装kubernetes。检查在kubernetes上执行的容器时出现问题。我将服务类型设置为Nodeport,但是无法从运行容器的节点之外的其他节点访问。想要从其他计算机访问它,请告诉我它有何不同。我尝试了externalIP和LoadBarancer,但这是不可能的。
环保环境
网络
机器
kubectl描述svc nginx集群
Name: nginx-cluster
Namespace: default
Labels: app=nginx-demo
Annotations: <none>
Selector: app=nginx-demo
Type: ClusterIP
IP: 172.16.236.159
Port: <unset> 8090/TCP
TargetPort: 80/TCP
Endpoints: 192.168.24.2:80
Session Affinity: None
Events: <none>
Run Code Online (Sandbox Code Playgroud)
kubectl描述svc nginx服务
Name: nginx-service
Namespace: default
Labels: app=nginx-demo
Annotations: <none>
Selector: app=nginx-demo
Type: NodePort
IP: 172.16.199.69
Port: <unset> 8090/TCP
TargetPort: 80/TCP
NodePort: <unset> 31659/TCP
Endpoints: 192.168.24.2:80
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
Run Code Online (Sandbox Code Playgroud)
运行容器工作程序节点(10.1.1.27) …
kubernetes ×1