This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl localhost:9090/api/v1/targets | jq '.data.activeTargets[] | . + {"targets": [.labels.instance]} | del(.scrapeUrl, .lastError, .lastScrape, .health, .discoveredLabels)' | jq --slurp '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
claims_depth | |
etcd_helper_cache_hit_count | |
replicationmanager_adds | |
deployment_adds | |
serviceaccount_tokens_secret_work_duration_sum | |
disruption_work_duration_sum | |
garbage_collector_operation_extensions_v1beta1_rate_limiter_use | |
resourcequota_primary_retries | |
serviceaccount_tokens_service_queue_latency_count | |
service_queue_latency_sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"net/url" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
) | |
func main() { | |
flag.Parse() | |
flag.Lookup("logtostderr").Value.Set("true") | |
flag.Lookup("v").Value.Set("10") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
grafanaapi="http://localhost:8001/api/v1/proxy/namespaces/tectonic-system/services/grafana:3000/api" | |
dir="./assets/grafana/" | |
dashboards=`curl $grafanaapi/search | jq -r ".[] .uri"` | |
while read -r d; do | |
name=`echo $d | cut -c 3-` | |
curl "$grafanaapi/dashboards/$d" | jq -r ".dashboard" | jq -r '. + {"__inputs":[{"name": "DS_PROMETHEUS","label": "prometheus","description": "","type": "datasource","pluginId": "prometheus","pluginName": "Prometheus"}]}' > "./assets/grafana/$name-dashboard.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local cm = { | |
binPack(data, maxSize, nameTemplate):: | |
self.innerBinPack(data, maxSize, nameTemplate, std.objectFields(data), maxSize, 0), | |
innerBinPack(data, maxSize, nameTemplate, items, remainingSize, count):: | |
if std.length(items) == 0 then | |
{} | |
else | |
local curName = items[0]; | |
local cur = { [curName]: data[curName] }; | |
// Size is the sum of the length of the key + length of the content plus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: ordinal-test | |
labels: | |
name: ordinal-test | |
spec: | |
clusterIP: None | |
ports: | |
- name: http-metrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get --insecure-skip-tls-verify --server https://192.168.99.100:10250 --raw /pods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scrape_configs: | |
- job_name: "node" | |
scrape_interval: "1s" | |
static_configs: | |
- targets: ["localhost:9100"] | |
remote_write: | |
- url: "http://localhost:1234/receive" | |
write_relabel_configs: | |
- source_labels: ["job"] | |
action: "hashmod" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(sum by(role) (kube_pod_container_resource_requests_cpu_cores * on(node) group_left(role) kube_node_role)) / (sum by(role) (kube_node_status_allocatable_cpu_cores * on(node) group_left(role) kube_node_role)) |