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