我试图在kubernetes上部署nginx, kubernetes版本是v1.5.2, 我已经部署了nginx的3个副本,YAML文件如下,
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: deployment-example
spec:
replicas: 3
revisionHistoryLimit: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.10
ports:
- containerPort: 80
现在我想在节点的30062端口上公开它的80端口,为此我在下面创建了一个服务,
kind: Service
apiVersion: v1
metadata:
name: nginx-ils-service
spec:
ports:
- name: http
port: 80
nodePort: 30062
selector:
app: nginx
type: LoadBalancer
这项服务工作得很好,但它不仅在kubernetes仪表板上也在终端上显示为待定。