From 35f3df176c9f026995bbe1f7e9f3b1e86b0c5dbf Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 8 Nov 2023 09:33:10 +0100 Subject: [PATCH] Added thanos chart --- argocd/thanos/monitoring/Chart.yaml | 5 + .../templates/thanos-query-deployment.yaml | 102 ++++++++++++ .../templates/thanos-query-service.yaml | 22 +++ .../thanos-query-serviceAccount.yaml | 11 ++ .../thanos-query-serviceMonitor.yaml | 25 +++ ...anos-receive-ingestor-default-service.yaml | 28 ++++ ...-receive-ingestor-default-statefulSet.yaml | 153 ++++++++++++++++++ ...hanos-receive-ingestor-serviceAccount.yaml | 11 ++ ...hanos-receive-ingestor-serviceMonitor.yaml | 28 ++++ .../thanos-receive-router-configmap.yaml | 7 + .../thanos-receive-router-deployment.yaml | 106 ++++++++++++ .../thanos-receive-router-service.yaml | 26 +++ .../thanos-receive-router-serviceAccount.yaml | 11 ++ .../templates/thanos-store-service.yaml | 23 +++ .../thanos-store-serviceAccount.yaml | 11 ++ .../thanos-store-serviceMonitor.yaml | 25 +++ .../templates/thanos-store-statefulSet.yaml | 129 +++++++++++++++ 17 files changed, 723 insertions(+) create mode 100644 argocd/thanos/monitoring/Chart.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-query-deployment.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-query-service.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-query-serviceAccount.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-query-serviceMonitor.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-service.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-statefulSet.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceAccount.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceMonitor.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-router-configmap.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-router-deployment.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-router-service.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-receive-router-serviceAccount.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-store-service.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-store-serviceAccount.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-store-serviceMonitor.yaml create mode 100644 argocd/thanos/monitoring/templates/thanos-store-statefulSet.yaml diff --git a/argocd/thanos/monitoring/Chart.yaml b/argocd/thanos/monitoring/Chart.yaml new file mode 100644 index 0000000..a7bad88 --- /dev/null +++ b/argocd/thanos/monitoring/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: thanos +version: 0.1.0 +type: application +description: Helm chart to install Thanos manifests \ No newline at end of file diff --git a/argocd/thanos/monitoring/templates/thanos-query-deployment.yaml b/argocd/thanos/monitoring/templates/thanos-query-deployment.yaml new file mode 100644 index 0000000..9215460 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-query-deployment.yaml @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query + app.kubernetes.io/version: v0.31.0 + name: thanos-query + namespace: thanos +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query + template: + metadata: + labels: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query + app.kubernetes.io/version: v0.31.0 + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - thanos-query + namespaces: + - thanos + topologyKey: kubernetes.io/hostname + weight: 100 + containers: + - args: + - query + - --grpc-address=0.0.0.0:10901 + - --http-address=0.0.0.0:9090 + - --log.level=info + - --log.format=logfmt + - --query.replica-label=prometheus_replica + - --query.replica-label=rule_replica + - --endpoint=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local:10901 + - --endpoint=dnssrv+_grpc._tcp.thanos-receive-ingestor-default.thanos.svc.cluster.local:10901 + - --query.auto-downsampling + env: + - name: HOST_IP_ADDRESS + valueFrom: + fieldRef: + fieldPath: status.hostIP + image: quay.io/thanos/thanos:v0.31.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 4 + httpGet: + path: /-/healthy + port: 9090 + scheme: HTTP + periodSeconds: 30 + name: thanos-query + ports: + - containerPort: 10901 + name: grpc + - containerPort: 9090 + name: http + readinessProbe: + failureThreshold: 20 + httpGet: + path: /-/ready + port: 9090 + scheme: HTTP + periodSeconds: 5 + resources: {} + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65534 + seccompProfile: + type: RuntimeDefault + terminationMessagePolicy: FallbackToLogsOnError + nodeSelector: + kubernetes.io/os: linux + securityContext: + fsGroup: 65534 + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65534 + seccompProfile: + type: RuntimeDefault + serviceAccountName: thanos-query + terminationGracePeriodSeconds: 120 diff --git a/argocd/thanos/monitoring/templates/thanos-query-service.yaml b/argocd/thanos/monitoring/templates/thanos-query-service.yaml new file mode 100644 index 0000000..0dc4a48 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-query-service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query + app.kubernetes.io/version: v0.31.0 + name: thanos-query + namespace: thanos +spec: + ports: + - name: grpc + port: 10901 + targetPort: 10901 + - name: http + port: 9090 + targetPort: 9090 + selector: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query diff --git a/argocd/thanos/monitoring/templates/thanos-query-serviceAccount.yaml b/argocd/thanos/monitoring/templates/thanos-query-serviceAccount.yaml new file mode 100644 index 0000000..9a6d701 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-query-serviceAccount.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + annotations: {} + labels: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query + app.kubernetes.io/version: v0.31.0 + name: thanos-query + namespace: thanos diff --git a/argocd/thanos/monitoring/templates/thanos-query-serviceMonitor.yaml b/argocd/thanos/monitoring/templates/thanos-query-serviceMonitor.yaml new file mode 100644 index 0000000..4cffad7 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-query-serviceMonitor.yaml @@ -0,0 +1,25 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query + app.kubernetes.io/version: v0.31.0 + name: thanos-query + namespace: thanos +spec: + endpoints: + - port: http + relabelings: + - action: replace + separator: / + sourceLabels: + - namespace + - pod + targetLabel: instance + selector: + matchLabels: + app.kubernetes.io/component: query-layer + app.kubernetes.io/instance: thanos-query + app.kubernetes.io/name: thanos-query diff --git a/argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-service.yaml b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-service.yaml new file mode 100644 index 0000000..7cd8aca --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-service.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor-default + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + controller.receive.thanos.io/hashring: default + name: thanos-receive-ingestor-default + namespace: thanos +spec: + clusterIP: None + ports: + - name: grpc + port: 10901 + targetPort: 10901 + - name: http + port: 10902 + targetPort: 10902 + - name: remote-write + port: 19291 + targetPort: 19291 + selector: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor-default + app.kubernetes.io/name: thanos-receive + controller.receive.thanos.io/hashring: default diff --git a/argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-statefulSet.yaml b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-statefulSet.yaml new file mode 100644 index 0000000..c330e94 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-default-statefulSet.yaml @@ -0,0 +1,153 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor-default + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + controller.receive.thanos.io: thanos-receive-controller + controller.receive.thanos.io/hashring: default + name: thanos-receive-ingestor-default + namespace: thanos +spec: + minReadySeconds: 0 + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor-default + app.kubernetes.io/name: thanos-receive + controller.receive.thanos.io/hashring: default + serviceName: thanos-receive-ingestor-default + template: + metadata: + labels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor-default + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + controller.receive.thanos.io/hashring: default + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - thanos-receive + - key: app.kubernetes.io/instance + operator: In + values: + - thanos-receive-ingestor-default + namespaces: + - thanos + topologyKey: kubernetes.io/hostname + weight: 100 + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - thanos-receive + - key: app.kubernetes.io/instance + operator: In + values: + - thanos-receive-ingestor-default + namespaces: + - thanos + topologyKey: topology.kubernetes.io/zone + weight: 100 + containers: + - args: + - receive + - --log.level=info + - --log.format=logfmt + - --grpc-address=0.0.0.0:10901 + - --http-address=0.0.0.0:10902 + - --remote-write.address=0.0.0.0:19291 + - --receive.replication-factor=1 + - --tsdb.path=/var/thanos/receive + - --tsdb.retention=15d + - --label=replica="$(NAME)" + - --label=receive="true" + - --receive.local-endpoint=$(NAME).thanos-receive-ingestor-default.$(NAMESPACE).svc.cluster.local:10901 + - --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json + env: + - name: NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: HOST_IP_ADDRESS + valueFrom: + fieldRef: + fieldPath: status.hostIP + image: quay.io/thanos/thanos:v0.31.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 8 + httpGet: + path: /-/healthy + port: 10902 + scheme: HTTP + periodSeconds: 30 + name: thanos-receive + ports: + - containerPort: 10901 + name: grpc + - containerPort: 10902 + name: http + - containerPort: 19291 + name: remote-write + readinessProbe: + failureThreshold: 20 + httpGet: + path: /-/ready + port: 10902 + scheme: HTTP + periodSeconds: 5 + resources: {} + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /var/thanos/receive + name: data + readOnly: false + - mountPath: /var/lib/thanos-receive + name: hashring-config + nodeSelector: + kubernetes.io/os: linux + securityContext: + fsGroup: 65534 + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65534 + seccompProfile: + type: RuntimeDefault + serviceAccountName: thanos-receive-ingestor + terminationGracePeriodSeconds: 900 + volumes: + - configMap: + name: hashring-config + name: hashring-config + volumeClaimTemplates: + - metadata: + labels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor-default + app.kubernetes.io/name: thanos-receive + controller.receive.thanos.io/hashring: default + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceAccount.yaml b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceAccount.yaml new file mode 100644 index 0000000..d1589c5 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceAccount.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + annotations: {} + labels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + name: thanos-receive-ingestor + namespace: thanos diff --git a/argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceMonitor.yaml b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceMonitor.yaml new file mode 100644 index 0000000..f5d7297 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-ingestor-serviceMonitor.yaml @@ -0,0 +1,28 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/instance: thanos-receive-ingestor + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + name: thanos-receive-ingestor + namespace: thanos +spec: + endpoints: + - port: http + relabelings: + - action: replace + separator: / + sourceLabels: + - namespace + - pod + targetLabel: instance + - action: replace + sourceLabels: + - __meta_kubernetes_service_label_controller_receive_thanos_io_shard + targetLabel: hashring + selector: + matchLabels: + app.kubernetes.io/component: database-write-hashring + app.kubernetes.io/name: thanos-receive diff --git a/argocd/thanos/monitoring/templates/thanos-receive-router-configmap.yaml b/argocd/thanos/monitoring/templates/thanos-receive-router-configmap.yaml new file mode 100644 index 0000000..c0158a9 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-router-configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +data: + hashrings.json: '[{"endpoints": ["thanos-receive-ingestor-default-0.thanos-receive-ingestor-default.thanos.svc.cluster.local:10901"], "hashring": "default", "tenants": [ ]}]' +kind: ConfigMap +metadata: + name: hashring-config + namespace: thanos diff --git a/argocd/thanos/monitoring/templates/thanos-receive-router-deployment.yaml b/argocd/thanos/monitoring/templates/thanos-receive-router-deployment.yaml new file mode 100644 index 0000000..9d5d202 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-router-deployment.yaml @@ -0,0 +1,106 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: thanos-receive-router + app.kubernetes.io/instance: thanos-receive + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + name: thanos-receive-router + namespace: thanos +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: thanos-receive-router + app.kubernetes.io/instance: thanos-receive + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + template: + metadata: + labels: + app.kubernetes.io/component: thanos-receive-router + app.kubernetes.io/instance: thanos-receive + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + spec: + containers: + - args: + - receive + - --log.level=info + - --log.format=logfmt + - --grpc-address=0.0.0.0:10901 + - --http-address=0.0.0.0:10902 + - --remote-write.address=0.0.0.0:19291 + - --receive.replication-factor=1 + - --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json + - --label=replica="$(NAME)" + - --label=receive="true" + env: + - name: NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: HOST_IP_ADDRESS + valueFrom: + fieldRef: + fieldPath: status.hostIP + image: quay.io/thanos/thanos:v0.31.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 8 + httpGet: + path: /-/healthy + port: 10902 + scheme: HTTP + periodSeconds: 30 + name: thanos-receive + ports: + - containerPort: 10901 + name: grpc + - containerPort: 10902 + name: http + - containerPort: 19291 + name: remote-write + readinessProbe: + failureThreshold: 20 + httpGet: + path: /-/ready + port: 10902 + scheme: HTTP + periodSeconds: 5 + resources: {} + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65534 + seccompProfile: + type: RuntimeDefault + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /var/lib/thanos-receive + name: hashring-config + nodeSelector: + kubernetes.io/os: linux + securityContext: + fsGroup: 65534 + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65534 + seccompProfile: + type: RuntimeDefault + serviceAccountName: thanos-receive-router + terminationGracePeriodSeconds: 30 + volumes: + - configMap: + name: hashring-config + name: hashring-config diff --git a/argocd/thanos/monitoring/templates/thanos-receive-router-service.yaml b/argocd/thanos/monitoring/templates/thanos-receive-router-service.yaml new file mode 100644 index 0000000..46eb1ba --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-router-service.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: thanos-receive-router + app.kubernetes.io/instance: thanos-receive + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + name: thanos-receive-router + namespace: thanos +spec: + ports: + - name: grpc + port: 10901 + targetPort: 10901 + - name: http + port: 10902 + targetPort: 10902 + - name: remote-write + port: 19291 + targetPort: 19291 + selector: + app.kubernetes.io/component: thanos-receive-router + app.kubernetes.io/instance: thanos-receive + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 diff --git a/argocd/thanos/monitoring/templates/thanos-receive-router-serviceAccount.yaml b/argocd/thanos/monitoring/templates/thanos-receive-router-serviceAccount.yaml new file mode 100644 index 0000000..f9ad6ef --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-receive-router-serviceAccount.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + annotations: {} + labels: + app.kubernetes.io/component: thanos-receive-router + app.kubernetes.io/instance: thanos-receive + app.kubernetes.io/name: thanos-receive + app.kubernetes.io/version: v0.31.0 + name: thanos-receive-router + namespace: thanos diff --git a/argocd/thanos/monitoring/templates/thanos-store-service.yaml b/argocd/thanos/monitoring/templates/thanos-store-service.yaml new file mode 100644 index 0000000..2e17fb2 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-store-service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store + app.kubernetes.io/version: v0.31.0 + name: thanos-store + namespace: thanos +spec: + clusterIP: None + ports: + - name: grpc + port: 10901 + targetPort: 10901 + - name: http + port: 10902 + targetPort: 10902 + selector: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store diff --git a/argocd/thanos/monitoring/templates/thanos-store-serviceAccount.yaml b/argocd/thanos/monitoring/templates/thanos-store-serviceAccount.yaml new file mode 100644 index 0000000..e0b60cb --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-store-serviceAccount.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + annotations: {} + labels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store + app.kubernetes.io/version: v0.31.0 + name: thanos-store + namespace: thanos diff --git a/argocd/thanos/monitoring/templates/thanos-store-serviceMonitor.yaml b/argocd/thanos/monitoring/templates/thanos-store-serviceMonitor.yaml new file mode 100644 index 0000000..3c55f9e --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-store-serviceMonitor.yaml @@ -0,0 +1,25 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store + app.kubernetes.io/version: v0.31.0 + name: thanos-store + namespace: thanos +spec: + endpoints: + - port: http + relabelings: + - action: replace + separator: / + sourceLabels: + - namespace + - pod + targetLabel: instance + selector: + matchLabels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store diff --git a/argocd/thanos/monitoring/templates/thanos-store-statefulSet.yaml b/argocd/thanos/monitoring/templates/thanos-store-statefulSet.yaml new file mode 100644 index 0000000..a1146e9 --- /dev/null +++ b/argocd/thanos/monitoring/templates/thanos-store-statefulSet.yaml @@ -0,0 +1,129 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store + app.kubernetes.io/version: v0.31.0 + name: thanos-store + namespace: thanos +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store + serviceName: thanos-store + template: + metadata: + labels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store + app.kubernetes.io/version: v0.31.0 + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - thanos-store + - key: app.kubernetes.io/instance + operator: In + values: + - thanos-store + namespaces: + - thanos + topologyKey: kubernetes.io/hostname + weight: 100 + containers: + - args: + - store + - --log.level=info + - --log.format=logfmt + - --data-dir=/var/thanos/store + - --grpc-address=0.0.0.0:10901 + - --http-address=0.0.0.0:10902 + - --objstore.config=$(OBJSTORE_CONFIG) + - --ignore-deletion-marks-delay=24h + env: + - name: OBJSTORE_CONFIG + valueFrom: + secretKeyRef: + key: thanos.yaml + name: thanos-objectstorage + - name: HOST_IP_ADDRESS + valueFrom: + fieldRef: + fieldPath: status.hostIP + image: quay.io/thanos/thanos:v0.31.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 8 + httpGet: + path: /-/healthy + port: 10902 + scheme: HTTP + periodSeconds: 30 + timeoutSeconds: 1 + name: thanos-store + ports: + - containerPort: 10901 + name: grpc + - containerPort: 10902 + name: http + readinessProbe: + failureThreshold: 20 + httpGet: + path: /-/ready + port: 10902 + scheme: HTTP + periodSeconds: 5 + resources: {} + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65534 + seccompProfile: + type: RuntimeDefault + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /var/thanos/store + name: data + readOnly: false + nodeSelector: + kubernetes.io/os: linux + securityContext: + fsGroup: 65534 + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65534 + seccompProfile: + type: RuntimeDefault + serviceAccountName: thanos-store + terminationGracePeriodSeconds: 120 + volumes: [] + volumeClaimTemplates: + - metadata: + labels: + app.kubernetes.io/component: object-store-gateway + app.kubernetes.io/instance: thanos-store + app.kubernetes.io/name: thanos-store + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi