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 # Selecting PODS with those Labels ports: - name : app-listener protocol : TCP port : 80 # Port on Load Balancer targetPort: 80 # Port on POD type: LoadBalancer