apiVersion: apps/v1
kind: StatefulSet
metadata:
  namespace: data
  name: kapacitor
  labels:
    name: kapacitor
    namespace: data
spec:
  serviceName: kapacitor
  replicas: 1
  revisionHistoryLimit: 1
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: kapacitor
  template:
    metadata:
      labels:
        app: kapacitor
        name: kapacitor
        namespace: data
    spec:
      containers:
        - name: kapacitor
          image: 'kapacitor:1.3-alpine'
          env:
            - name: KAPACITOR_INFLUXDB_0_URLS_0
              value: 'http://influxdb:8086'
          ports:
            - name: http
              containerPort: 9092
              protocol: TCP
          resources:
            requests:
              memory: 50Mi
              cpu: 100m
            limits:
              memory: 200Mi
              cpu: 200m
          volumeMounts:
            - name: kapacitor-data
              mountPath: /var/lib/kapacitor
  volumeClaimTemplates:
    - metadata:
        name: kapacitor-data
        namespace: data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
