###############创建service服务对外提供访问并测试
apiVersion: v1
kind: Service
metadata:
  name: nginx-svcping
  labels:
    app: nginx
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 80 #相当于dockerfile中的expose
  selector:
#此处定义的selector要与deployment所定义的selector相同
#service依靠标签选择器来检索提供服务的nodes
    app: nginx