apiVersion: apps/v1
kind: Deployment
metadata:
  name: nextcloud-exporter
  namespace: my-apps
  labels:
    app: nextcloud-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nextcloud-exporter
  template:
    metadata:
      labels:
        app: nextcloud-exporter
    spec:
      containers:
        - name: exporter
          image: xperimental/nextcloud-exporter
          ports:
            - containerPort: 9205
          env:
            - name: NEXTCLOUD_SERVER
              value: "https://nextcloud.dvirlabs.com"
            - name: NEXTCLOUD_USERNAME
              valueFrom:
                secretKeyRef:
                  name: nextcloud-exporter-secret
                  key: username
            - name: NEXTCLOUD_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: nextcloud-exporter-secret
                  key: password
