【发布时间】:2019-10-21 02:47:34
【问题描述】:
默认情况下是否有任何额外的安全设置不允许对 IBM Cloud 上的 Kubernetes 集群进行公共访问?
我使用NodePort 服务公开了应用程序,但它无法通过 80 端口访问,甚至我尝试了其他端口。
但它是在 pod 中工作的,例如使用 curl 命令访问这个公共 LoadBalancer。即使我可以 ping 这个LoadBalancer 的公共 IP 地址,Ingress 也会发生这种情况。
Ingress subdomain 也已启用。
这是我的 Kubernetes 集群中 External LoadBalancer 的示例:
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: hello-world
spec:
containers:
- image: us.icr.io/my-space/hello-world
imagePullPolicy: IfNotPresent
name: hello-world
ports:
- containerPort: 8080
name: http
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
labels:
app: hello-world
name: hello-world-service
spec:
ports:
- nodePort: 31190
port: 80
protocol: TCP
targetPort: 8080
selector:
app: hello-world
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer: {}
【问题讨论】:
-
我对 IBM 不是 100% 肯定,但我知道在亚马逊等其他云提供商的情况下,默认情况下,网络安全策略和防火墙会阻止大多数端口上的公共访问。尝试通过 IBM 内部的网络安全开放端口。
-
这听起来像 LoadBalancer 和 NodePort 工作 - 但 Ingress 不工作。您是否创建了 Ingress 资源?如果是这样,您可以使用该信息更新您的帖子吗?这是一个链接,其中包含有关创建入口资源的更多信息:cloud.ibm.com/docs/…
-
我试过ingress,还是一样。
标签: kubernetes ibm-cloud ibm-cloud-kubernetes iks