【发布时间】:2018-07-29 03:39:37
【问题描述】:
我正在执行kubectl create -f nginx.yaml,它成功创建了 pod。但是我的实例的公共 IP 上没有暴露 PODS。以下是我使用的 YAML,服务类型为 nodeport:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
name: nginx
spec:
type: NodePort
ports:
- port: 80
nodePort: 30080
name: http
- port: 443
nodePort: 30443
name: https
selector:
name: nginx
在我的方法中或在 YAML 文件上方以将部署时的 pod 暴露给公共 IP 时可能有什么不正确的地方?
PS:防火墙和 ACL 在所有 TCP 上对 Internet 开放
【问题讨论】:
标签: kubernetes containers kubectl