apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      name: nginx
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:latest
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: default-conf
              mountPath: /etc/nginx/conf.d/
        - name: nginx-prometheus-exporter
          image: nginx/nginx-prometheus-exporter:latest
          args: ['-nginx.scrape-uri', 'http://127.0.0.1:8080/basic_status']        
      restartPolicy: Always
      volumes:
        - name: default-conf
          configMap:
            name: nginx-cm
            items:
              - key: "default.conf"
                path: "default.conf"