apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-nginx
spec:
  revisionHistoryLimit: 0
  selector:
    matchLabels:
      run: my-nginx
  replicas: 2
  template:
    metadata:
      labels:
        run: my-nginx
    spec:
      containers:
      - name: my-nginx
        image: nginx:1.16.0
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: my-nginx
  labels:
    run: my-nginx
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 80  
    protocol: TCP
  selector:
    run: my-nginx
