apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    component: web
  name: web
spec:
  selector:
    matchLabels:
      component: web
  replicas: 1
  template:
    metadata:
      labels:
        component: web
    spec:
      containers:
        - image: nginx:alpine
          name: web
          volumeMounts:
            - mountPath: /etc/nginx/nginx.conf
              subPath: nginx.conf
              name: conf-nginx
            - mountPath: /var/www/html
              name: app-persistent-storage
              readOnly: yes
      restartPolicy: Always
      volumes:
      - name: conf-nginx
        configMap:
          name: conf-nginx
      - name: app-persistent-storage
        persistentVolumeClaim:
          claimName: app-pvc
