apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-first-app
  labels:
    app: my-first-app
spec:
  selector:
    matchLabels:
      app: my-first-app
  template:
    metadata:
      labels:
        app: my-first-app
    spec:
      containers:
        - name: my-first-app
          image: nginx:stable
          ports:
            - containerPort: 80
          volumeMounts:
            - name: index-html 
              mountPath: /usr/share/nginx/html/index.html
              subPath: index.html
            - name: default-conf
              mountPath: /etc/nginx/conf.d/default.conf
              subPath: default.conf
      volumes:
        - name: index-html
          configMap:
            name: my-first-app-configmap
        - name: default-conf
          configMap:
            name: my-first-app-configmap
      restartPolicy: Always

