apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: influxdb
  namespace: datacenter
spec:
  serviceName: "influxdb"
  selector:
    matchLabels:
      app: influxdb
  replicas: 2
  template:
    metadata:
      labels:
        app: influxdb
    spec:
      containers:
      - name: influxdb
        image: docker.io/influxdb:1.6.4
        imagePullPolicy: IfNotPresent
        envFrom:
        - secretRef:
            name: influxdb-creds
        volumeMounts:
        - mountPath: /var/lib/influxdb
          name: var-lib-influxdb
      volumes:
      - name: var-lib-influxdb
        persistentVolumeClaim:
          claimName: pvc-influxdb
