这是我的部署:
apiVersion: v1
kind: Service
metadata:
name: httpd-service-cloudops
namespace: httpd-namespace-cloudops
labels:
app: apache_app
spec:
type: NodePort
selector:
app: apache_app
ports:
- port: 80
targetPort: 80
nodePort: 30004
externalIPs:
- 192.168.101.72
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpd-deployment-cloudops
namespace: httpd-namespace-cloudops
spec:
replicas: 2
selector:
matchLabels:
app: apache_app
template:
metadata:
labels:
app: apache_app
spec:
containers:
- name: httpd-container-cloudops
image: httpd:latest
imagePullPolicy: Always
ports:
- containerPort: 80而输出,如果我试图访问低度卷曲,我得到连接拒绝错误:
卷曲192.168.101.72
curl:(7)未能连接到192.168.101.72端口80:连接被拒绝
我怎么才能解决这个问题?
发布于 2022-11-30 19:54:42
从外部打开的端口是30004 ( nodeport)。
curl http://192.168.101.72:30004应该行得通。
https://stackoverflow.com/questions/74632518
复制相似问题