# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 3
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
---
# LoadBalancer 1
apiVersion: v1
kind: Service
metadata:
  name: loadbalancer-1
spec:
  selector:
    app: nginx
  type: LoadBalancer
  ports:
  - name: nginx 
    port: 8080
    targetPort: 80
---
# LoadBalancer 2
apiVersion: v1
kind: Service
metadata:
  name: loadbalancer-2
spec:
  selector:
    app: nginx
  type: LoadBalancer
  ports:
  - name: nginx 
    port: 8081
    protocol: TCP
---
# LoadBalancer 3
apiVersion: v1
kind: Service
metadata:
  name: loadbalancer-3
spec:
  selector:
    app: nginx
  type: LoadBalancer
  ports:
  - port: 8082
    nodePort: 32540
    protocol: TCP
---
# LoadBalancer 4
apiVersion: v1
kind: Service
metadata:
  name: loadbalancer-4
spec:
  selector:
    app: nginx
  type: LoadBalancer
  ports:
  - targetPort: 80
    port: 8083
    nodePort: 31110
