---
# Source: influxdb/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: influxdb
  labels:
    helm.sh/chart: influxdb-4.4.1
    app.kubernetes.io/name: influxdb
    app.kubernetes.io/instance: influxdb
    app.kubernetes.io/version: "1.7.10"
    app.kubernetes.io/managed-by: Helm
---
# Source: influxdb/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: influxdb
  labels:
    helm.sh/chart: influxdb-4.4.1
    app.kubernetes.io/name: influxdb
    app.kubernetes.io/instance: influxdb
    app.kubernetes.io/version: "1.7.10"
    app.kubernetes.io/managed-by: Helm
data:
  influxdb.conf: |+
    reporting-disabled = true
    bind-address = ":8088"

    [meta]
      dir = "/var/lib/influxdb/meta"

    [data]
      dir = "/var/lib/influxdb/data"
      wal-dir = "/var/lib/influxdb/wal"

    [coordinator]

    [retention]

    [shard-precreation]

    [monitor]

    [subscriber]

    [http]

    # TODO: allow multiple graphite listeners

    [[graphite]]

    # TODO: allow multiple collectd listeners with templates

    [[collectd]]

    # TODO: allow multiple opentsdb listeners with templates

    [[opentsdb]]

    # TODO: allow multiple udp listeners with templates

    [[udp]]

    [continuous_queries]

    [logging]
---
# Source: influxdb/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: influxdb
  labels:
    helm.sh/chart: influxdb-4.4.1
    app.kubernetes.io/name: influxdb
    app.kubernetes.io/instance: influxdb
    app.kubernetes.io/version: "1.7.10"
    app.kubernetes.io/managed-by: Helm
spec:
  type: ClusterIP
  ports:
  - name: api
    port: 8086
    targetPort: api
  - name: rpc
    port: 8088
    targetPort: rpc
  selector:
    app.kubernetes.io/name: influxdb
    app.kubernetes.io/instance: influxdb
---
# Source: influxdb/templates/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: influxdb
  labels:
    helm.sh/chart: influxdb-4.4.1
    app.kubernetes.io/name: influxdb
    app.kubernetes.io/instance: influxdb
    app.kubernetes.io/version: "1.7.10"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: influxdb
      app.kubernetes.io/instance: influxdb
  serviceName: "influxdb"
  template:
    metadata:
      labels:
        app.kubernetes.io/name: influxdb
        app.kubernetes.io/instance: influxdb
    spec:
      serviceAccountName: influxdb
      containers:
      - name: influxdb
        image: "influxdb:1.8.4-alpine"
        imagePullPolicy: "IfNotPresent"
        resources:
          {}
        ports:
        - name: api
          containerPort: 8086
        - name: rpc
          containerPort: 8088
        livenessProbe:
          httpGet:
            path: /ping
            port: api
          initialDelaySeconds: 30
          timeoutSeconds: 5
        readinessProbe:
          httpGet:
            path: /ping
            port: api
          initialDelaySeconds: 5
          timeoutSeconds: 1
        volumeMounts:
        - name: influxdb-data
          mountPath: /var/lib/influxdb
        - name: config
          mountPath: /etc/influxdb
      volumes:
      - name: config
        configMap:
          name: influxdb
      # Cannot use existing claim in enterprise mode
      - name: influxdb-data
        persistentVolumeClaim:
          claimName: influxdb-data-influxdb-0
  # Must use volume claim template in enterprise mode
---
# Source: influxdb/templates/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: influxdb
  labels:
    helm.sh/chart: influxdb-4.4.1
    app.kubernetes.io/name: influxdb
    app.kubernetes.io/instance: influxdb
    app.kubernetes.io/version: "1.7.10"
    app.kubernetes.io/managed-by: Helm
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  tls:
    - hosts:
      - "influx.tbrnt.ch"
      secretName: influx-tbrnt-ch-cert
  rules:
  - host: influx.tbrnt.ch
    http:
      paths:
      - path: /
        backend:
          serviceName: influxdb
          servicePort: 8086
