Skip to content

Commit

Permalink
chore(kubernetes): add thanos cache; more metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Dec 15, 2023
1 parent 3cd8290 commit 5d2995c
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
35 changes: 34 additions & 1 deletion kubernetes/apps/default/kromgo/app/configs/config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
---
metrics:
- name: node_cpu_usage
- name: cluster_cpu_usage
query: round(cluster:node_cpu:ratio_rate5m * 100, 0.1)
suffix: "%"
colors:
- { color: "green", min: 0, max: 35 }
- { color: "orange", min: 36, max: 75 }
- { color: "red", min: 76, max: 1000 }

- name: cluster_node_count
query: count(count by (node) (kube_node_info))

- name: cluster_network_transmit_usage
query: round(avg(instance:node_network_transmit_bytes_excluding_lo:rate5m / 1024 / 1024), 0.1)
suffix: "MB/s"
colors:
- { color: "green", min: 0, max: 50 }
- { color: "orange", min: 51, max: 75 }
- { color: "red", min: 76, max: 1000 }

- name: cluster_network_receive_usage
query: round(avg(instance:node_network_receive_bytes_excluding_lo:rate5m / 1024 / 1024), 0.1)
suffix: "MB/s"
colors:
- { color: "green", min: 0, max: 50 }
- { color: "orange", min: 51, max: 75 }
- { color: "red", min: 76, max: 1000 }

- name: cluster_pods_running
query: sum(kube_pod_status_phase{phase="Running"})

- name: cluster_power_watts
query: avg_over_time(upsAdvanceOutputPower[5m])
suffix: "w"
colors:
- { color: "green", min: 0, max: 400 }
- { color: "orange", min: 401, max: 750 }
- { color: "red", min: 751, max: 2000 }

- name: plex_streams
query: sum(tautulli_stream_count)
8 changes: 8 additions & 0 deletions kubernetes/apps/monitoring/thanos/app/configs/cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
type: REDIS
config:
addr: >-
redis-node-0.redis-headless.databases.svc.cluster.local:26379,
redis-node-1.redis-headless.databases.svc.cluster.local:26379,
redis-node-2.redis-headless.databases.svc.cluster.local:26379
master_name: redis-master
13 changes: 13 additions & 0 deletions kubernetes/apps/monitoring/thanos/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ spec:
queryFrontend:
enabled: true
replicaCount: 3
extraFlags:
- --query-range.response-cache-config-file=/etc/thanos/query-cache.yaml
extraVolumes:
- name: thanos-cache
configMap:
name: thanos-cache
extraVolumeMounts:
- name: thanos-cache
mountPath: /etc/thanos
subPath: query-cache.yaml
readOnly: true
podAnnotations:
configmap.reloader.stakater.com/reload: thanos-cache
ingress:
enabled: true
hostname: &host thanos.${PUBLIC_DOMAIN}
Expand Down
6 changes: 6 additions & 0 deletions kubernetes/apps/monitoring/thanos/app/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ kind: Kustomization
resources:
- ./objectbucketclaim.yaml
- ./helmrelease.yaml
configMapGenerator:
- name: thanos-cache
files:
- ./configs/cache.yaml
generatorOptions:
disableNameSuffixHash: true
1 change: 1 addition & 0 deletions kubernetes/apps/monitoring/thanos/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
spec:
targetNamespace: monitoring
dependsOn:
- name: cluster-apps-redis
- name: cluster-apps-rook-ceph-cluster
- name: cluster-apps-democratic-csi-local-hostpath
path: ./kubernetes/apps/monitoring/thanos/app
Expand Down

0 comments on commit 5d2995c

Please sign in to comment.