apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloworld
  labels:
    app: helloworld
spec:
  selector:
    matchLabels:
      app: helloworld
  template:
    metadata:
      labels:
        app: helloworld
    spec:
      containers:
      - name: helloworld
        image: bgpat/helloworld-server:latest
        ports:
        - containerPort: 8080
      - name: nginx-proxy
        image: nginx:1.13.12-alpine
        ports:
        - containerPort: 80
        - containerPort: 8081
        volumeMounts:
        - name: nginx-proxy
          mountPath: /etc/nginx/conf.d
      - name: nginx-exporter
        image: fish/nginx-exporter:latest
        args:
        - -nginx.scrape_uri=http://127.0.0.1:8081/
        ports:
        - containerPort: 9113
      volumes:
      - name: nginx-proxy
        configMap:
          name: nginx-proxy
