apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: thanos-store
spec:
  serviceName: "thanos-store"
  replicas: 1
  selector:
    matchLabels:
      app: thanos-store
      thanos-peer: "true"
  template:
    metadata:
      labels:
        app: thanos-store
        thanos-peer: "true"
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "10902"
    spec:
      containers:
      - name: thanos-store
        # Always use explicit image tags (release or master-<date>-sha) instead of ambigous `latest` or `master`.
        image: improbable/thanos:v0.1.0-rc.2
        args:
        - "store"
        - "--log.level=debug"
        - "--tsdb.path=/var/thanos/store"
        - "--cluster.peers=thanos-peers.monitoring.svc.cluster.local:10900"
        - --s3.endpoint=s3.us-west-2.amazonaws.com
        - --s3.bucket=zoox-thanos
        env:
        - name: S3_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: thanos-aws-creds
              key: aws_access_key_id
        - name: S3_SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: thanos-aws-creds
              key: aws_secret_access_key
        ports:
        - name: http
          containerPort: 10902
        - name: grpc
          containerPort: 10901
        - name: cluster
          containerPort: 10900
        volumeMounts:
        - name: data
          mountPath: /var/thanos/store
      volumes:
      - name: data
        emptyDir: {}
