apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app.kubernetes.io/component: rule-evaluation-engine
    app.kubernetes.io/instance: observatorium-xyz
    app.kubernetes.io/name: thanos-rule
    app.kubernetes.io/part-of: observatorium
    app.kubernetes.io/version: master-2020-08-12-70f89d83
  name: observatorium-xyz-thanos-rule
  namespace: observatorium
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: rule-evaluation-engine
      app.kubernetes.io/instance: observatorium-xyz
      app.kubernetes.io/name: thanos-rule
      app.kubernetes.io/part-of: observatorium
  serviceName: observatorium-xyz-thanos-rule
  template:
    metadata:
      labels:
        app.kubernetes.io/component: rule-evaluation-engine
        app.kubernetes.io/instance: observatorium-xyz
        app.kubernetes.io/name: thanos-rule
        app.kubernetes.io/part-of: observatorium
        app.kubernetes.io/version: master-2020-08-12-70f89d83
    spec:
      containers:
      - args:
        - rule
        - --log.level=info
        - --grpc-address=0.0.0.0:10901
        - --http-address=0.0.0.0:10902
        - --objstore.config=$(OBJSTORE_CONFIG)
        - --data-dir=/var/thanos/rule
        - --label=rule_replica="$(NAME)"
        - --alert.label-drop=rule_replica
        - --query=dnssrv+_http._tcp.observatorium-xyz-thanos-query.observatorium.svc.cluster.local
        env:
        - name: NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: OBJSTORE_CONFIG
          valueFrom:
            secretKeyRef:
              key: thanos.yaml
              name: thanos-objectstorage
        image: quay.io/thanos/thanos:master-2020-08-12-70f89d83
        livenessProbe:
          failureThreshold: 24
          httpGet:
            path: /-/healthy
            port: 10902
            scheme: HTTP
          periodSeconds: 5
        name: thanos-rule
        ports:
        - containerPort: 10901
          name: grpc
        - containerPort: 10902
          name: http
        readinessProbe:
          failureThreshold: 18
          httpGet:
            path: /-/ready
            port: 10902
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 5
        terminationMessagePolicy: FallbackToLogsOnError
        volumeMounts:
        - mountPath: /var/thanos/rule
          name: data
          readOnly: false
      volumes:
      - emptyDir: {}
        name: data
  volumeClaimTemplates: null
