apiVersion : apps/v1 kind: Deployment metadata:

name: my-deploy
labels:
  app : my-first-deploy

spec:

replicas: 3
selector:
  matchLabels:
    project: test
template:
  metadata:
    labels:
      project: test   # Service will look for those PODS Labels!!!
  spec:
    containers:
      - name : my-web
        image: nginx:latest
        ports:
          - containerPort: 80

apiVersion: v1 kind: Service metadata:

name: my-service
labels:
  owner: km

spec:

selector:
  project: test    
ports:
  - name      : app-listener
    protocol  : TCP
    port      : 80  
    targetPort: 80  
type: LoadBalancer
DokuWiki Appliance - Powered by TurnKey Linux