apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/name: thanos-receive
    controller.receive.thanos.io: thanos-receive-controller
  name: thanos-receive-default
  namespace: observatorium
spec:
  replicas: 3
  selector:
    matchLabels:
      app.kubernetes.io/instance: default
      app.kubernetes.io/name: thanos-receive
  serviceName: thanos-receive-default
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: default
        app.kubernetes.io/name: thanos-receive
    spec:
      containers:
      - args:
        - receive
        - --grpc-address=0.0.0.0:10901
        - --http-address=0.0.0.0:10902
        - --remote-write.address=0.0.0.0:19291
        - --objstore.config=$(OBJSTORE_CONFIG)
        - --tsdb.path=/var/thanos/tsdb
        - --labels=replica="$(NAME)"
        - --labels=receive="true"
        - --tsdb.retention=6h
        - --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
        - --receive.local-endpoint=http://$(NAME).thanos-receive-default.$(NAMESPACE).svc.cluster.local:19291/api/v1/receive
        env:
        - name: NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: OBJSTORE_CONFIG
          valueFrom:
            secretKeyRef:
              key: thanos.yaml
              name: thanos-objectstorage
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: improbable/thanos:v0.6.0-rc.0
        name: thanos-receive
        ports:
        - containerPort: 10901
          name: grpc
        - containerPort: 10902
          name: http
        - containerPort: 19291
          name: remote-write
        volumeMounts:
        - mountPath: /var/thanos/tsdb
          name: data
          readOnly: false
        - mountPath: /var/lib/thanos-receive
          name: observatorium-tenants
      volumes:
      - emptyDir: {}
        name: data
      - configMap:
          name: observatorium-tenants-generated
        name: observatorium-tenants
