apiVersion: apps/v1
kind: Deployment
metadata:
  name: influxdb
spec:
  selector:
    matchLabels:
      app: influxdb
  strategy:
    type: Recreate
  replicas: 1
  template:
    metadata:
      labels:
        app: influxdb
    spec:
      containers:
      - name: influxdb
        image: my_influxdb
        imagePullPolicy: Never
        ports:
        - name: idb-port
          containerPort: 8086
        volumeMounts:
        - name: influxdb-persistent-storage
          mountPath: /var/lib/influxdb
        livenessProbe:
          exec:
            command:
              - sh
              - -c
              - "service telegraf status && service influxdb status"
          initialDelaySeconds: 5
          periodSeconds: 5
      volumes:
      - name: influxdb-persistent-storage
        persistentVolumeClaim:
          claimName: influxdb-volume
