apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-helloworld
  labels:
    app: nginx-helloworld
spec:
  selector:
    matchLabels:
      app: nginx-helloworld
  replicas: 2 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: nginx-helloworld
    spec:
      containers:
        - name: nginx-helloworld
          image: nginx:1.20-alpine
          ports:
            - containerPort: 80
          volumeMounts:
            - mountPath: /usr/share/nginx/html/index.html
              name: index
              subPath: index.html
            - mountPath: /usr/share/nginx/html/fred.html
              name: cfg-html3 #name of configmap below
              subPath: html3.html #match filename of configmap
      volumes:
        - name: index
          configMap:
            name: index-simplehtml
        - name: cfg-html3
          configMap:
            name: html3 #from configmapgenerator name
