---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: default
  labels:
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-deployment
  template:
    metadata:
      labels:
        app: nginx-deployment
        version: v1
      # avoid istio envoy auto-injection
      annotations:
        sidecar.istio.io/inject: "false"
        # do not set here, instead allow overlays to define
        #configmap.reloader.stakater.com/reload: nginx-cm
    spec:
      volumes:
      - name: nginx-homedir
        projected:
          sources:
          - configMap:
              name: nginx-cm
              items:
                 - key: cm-index.html
                   path: index.html
      containers:
      - name: nginx
        image: nginx:1.21.6-alpine
        volumeMounts:
        - name: nginx-homedir
          mountPath: "/usr/share/nginx/html"
          readOnly: true
        ports:
        - containerPort: 80
