apiVersion: apps/v1
kind: Deployment
metadata:
  name: app2-deployment
  labels:
    app: app2
spec:
  replicas: 3
  selector:
    matchLabels:
      app: app2
  template:
    metadata:
      labels:
        app: app2
    spec:
      containers:
      - name: app2
        image: nginx:1.14.2
        volumeMounts:
          - name: indexes 
            mountPath: /usr/share/nginx/html/index.html
            subPath: app2
      volumes:
        - name: indexes
          configMap:
            name: indexes
            items:
              - key: app2
                path: app2
---
apiVersion: v1
kind: Service
metadata:
  name: app2-service
spec:
  type: NodePort
  selector:
    app: app2
  ports:
    - port: 80
      targetPort: 80
