apiVersion: apps/v1
kind: Deployment
metadata:
  name: powermeter-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: powermeter-exporter
  template:
    metadata:
      labels:
        app: powermeter-exporter
      annotations:
        prometheus.io/scrape: "true"
    spec:
      containers:
        - name: exporter
          image: reg:5000/powermeter_exporter_image
          workingDir: /opt
          command:
            - pdm
            - run
            - python
            - powermeter_exporter.py
          ports:
            - containerPort: 8005
---
apiVersion: v1
kind: Service
metadata:
  name: powermeter-exporter
spec:
  ports:
    - { port: 80, targetPort: 8005 }
  selector:
    app: powermeter-exporter
