apiVersion: apps/v1
kind: Deployment
metadata:
  name: app1
spec:
  selector:
    matchLabels:
      environment: dev
      app: app1
  replicas: 2
  template:
    metadata:
      labels:
        environment: dev
        app: app1
    spec:
      containers:
      - name: container-nginx
        image: nginx

---

apiVersion: v1
kind: Service
metadata:
  name: app1-svc
spec:
  selector:
    environment: dev
    app: app1
  type: ClusterIP
  ports:
  - port: 8080
    targetPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: app1-svc
spec:
  selector:
    environment: dev
    app: app1
  type: NodePort
  ports:
  - port: 8080
    targetPort: 80
