apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: influxdb
  name: influxdb
  namespace: grafana-dashboard
spec:
  replicas: 1
  selector:
    matchLabels:
      app: influxdb
  template:
    metadata:
      labels:
        app: influxdb
    spec:
      containers:
        - envFrom:
            - secretRef:
                name: influxdb-creds
          ports:
            - containerPort: 8086
              name: http
          image: docker.io/influxdb:1.8.4
          imagePullPolicy: IfNotPresent
          name: influxdb
          volumeMounts:
            - mountPath: /var/lib/influxdb
              name: var-lib-influxdb
            - mountPath: /docker-entrypoint-initdb.d
              readOnly: true
              name: init-scripts
      restartPolicy: Always
      volumes:
        - name: var-lib-influxdb
          persistentVolumeClaim:
            claimName: influxdb
        - configMap:
            name: init-scripts
          name: init-scripts
