diff --git a/manifests/thanos/prometheus-self.yaml b/manifests/thanos/prometheus-self.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e778905a2062224dd8f66d47cdb412c1ea760461 --- /dev/null +++ b/manifests/thanos/prometheus-self.yaml @@ -0,0 +1,73 @@ +apiVersion: monitoring.coreos.com/v1 +kind: Prometheus +metadata: + name: self + labels: + prometheus: self +spec: + podMetadata: + labels: + thanos-peer: 'true' + replicas: 2 + version: v2.2.1 + serviceAccountName: prometheus-k8s + serviceMonitorSelector: + matchLabels: + app: prometheus + ruleSelector: + matchLabels: + role: prometheus-rulefiles + prometheus: k8s + resources: + requests: + # 2Gi is default, but won't schedule if you don't have a node with >2Gi + # memory. Modify based on your target and time-series count for + # production use. This value is mainly meant for demonstration/testing + # purposes. + memory: 400Mi + containers: + - name: thanos + image: improbable/thanos:latest + args: + - "sidecar" + - "--log.level=debug" + - "--cluster.peers=thanos-peers.default.svc:10900" + ports: + - name: http + containerPort: 10902 + - name: grpc + containerPort: 10901 + - name: cluster + containerPort: 10900 +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: prometheus + labels: + app: prometheus +spec: + selector: + matchLabels: + app: prometheus + endpoints: + - port: web + interval: 30s +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: prometheus + prometheus: self + name: prometheus-self +spec: + type: NodePort + ports: + - name: web + nodePort: 30900 + port: 9090 + protocol: TCP + targetPort: web + selector: + prometheus: self diff --git a/manifests/thanos/query.yaml b/manifests/thanos/query.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eb1d99ba2515b6e5efa20a51d43c3232aecd72b7 --- /dev/null +++ b/manifests/thanos/query.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: thanos-query + labels: + app: thanos-query + thanos-peer: "true" +spec: + replicas: 2 + selector: + matchLabels: + app: thanos-query + thanos-peer: "true" + template: + metadata: + labels: + app: thanos-query + thanos-peer: "true" + spec: + containers: + - name: thanos-query + image: improbable/thanos:latest + args: + - "query" + - "--log.level=debug" + - "--query.replica-label=prometheus_replica" + - "--cluster.peers=thanos-peers.default.svc:10900" + ports: + - name: http + containerPort: 10902 + - name: grpc + containerPort: 10901 + - name: cluster + containerPort: 10900 +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: thanos-query + name: thanos-query +spec: + type: NodePort + selector: + app: thanos-query + ports: + - port: 9090 + protocol: TCP + targetPort: http + name: http-query + nodePort: 31111 \ No newline at end of file diff --git a/manifests/thanos/thanos-peers-svc.yaml b/manifests/thanos/thanos-peers-svc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..afcfcfe43575b82541acb4c6c500dc95afdda5a1 --- /dev/null +++ b/manifests/thanos/thanos-peers-svc.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: thanos-peers +spec: + type: ClusterIP + clusterIP: None + ports: + - name: cluster + port: 10900 + targetPort: cluster + selector: + # Useful endpoint for gathering all thanos components for common gossip cluster. + thanos-peer: "true" \ No newline at end of file