Kubernetes - services without selector

前端 未结 3 1830
忘掉有多难
忘掉有多难 2021-01-21 02:10

I\'m struggling with Kubernetes\' service without a selector. The cluster is installed on AWS with the kops. I have a deployment with 3 nginx pods exposing port 80:



        
3条回答
  •  星月不相逢
    2021-01-21 03:04

    correct the service definition as below

    apiVersion: v1
    kind: Service
    metadata:
      name: dummy-svc
      labels:
        app: nginx
    spec:
      ports:
      - protocol: TCP
        port: 80
        targetPort: 80
      selector:
       app: nginx
    

提交回复
热议问题