Skip to content

Commit 3b371a1

Browse files
committed
wrong file, delete
1 parent e618047 commit 3b371a1

File tree

4 files changed

+128
-5
lines changed

4 files changed

+128
-5
lines changed

3dprinting/STL/thingiverse_4077336_breville_smart_grinder_impeller/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
kind_cluster_name=promtorture
4+
5+
if ! grep -q "${kind_cluster_name} " <<< $(kind get clusters); then
6+
kind create cluster --name "${kind_cluster_name}"
7+
fi
8+
9+
mkdir -p .cache
10+
if [ ! -f .cache/kube-prometheus.yaml ]; then
11+
kustomize build https://github.com/prometheus-operator/kube-prometheus -o .cache/kube-prometheus.yaml
12+
fi
13+
14+
# because kubectl apply still doesn't know how to wait for CRDs
15+
# before applying the rest...
16+
yq '[.items[] | select(.kind == "CustomResourceDefinition")]' .cache/kube-prometheus.yaml | kubectl apply -f -
17+
18+
# Sleeps suck, but we need to wait for the CRDs to be created and don't want to
19+
# overcomplicate this script by looping through kubectl api-resources and checking
20+
# for the CRDs we need.
21+
sleep 1
22+
23+
# this'll re-apply the CRDs but that's harmless
24+
kubectl apply -f .cache/kube-prometheus.yaml
25+
26+
# vim: et ts=2 sw=2 sts=2 ft=bash ai
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/bash
2+
3+
kind_cluster_name=promtorture
4+
5+
targets=1
6+
info_metrics_labels=0
7+
gauge_metrics=1
8+
while getopts "t:i:g:" opt; do
9+
case ${opt} in
10+
t )
11+
targets=$OPTARG
12+
;;
13+
i )
14+
info_metrics_labels=$OPTARG
15+
;;
16+
g )
17+
gauge_metrics=$OPTARG
18+
;;
19+
\? )
20+
echo "Usage: kind-deploy.sh -t <targets> -i <info_metrics_labels> -g <gauge_metrics>"
21+
echo "e.g."
22+
echo " kind-deploy.sh -t 2,2 -i 4 -g 10"
23+
exit 1
24+
;;
25+
esac
26+
done
27+
28+
docker buildx build -t promtorture .
29+
30+
kind load docker-image promtorture --name promtorture
31+
32+
kubectl=("kubectl", "--context", "kind-${kind_cluster_name}")
33+
34+
"${kubectl[@]}" apply -f /dev/stdin <<__END__
35+
apiVersion: apps/v1
36+
kind: Deployment
37+
metadata:
38+
name: promtorture
39+
labels:
40+
app: promtorture
41+
spec:
42+
replicas: 1
43+
selector:
44+
matchLabels:
45+
app: promtorture
46+
template:
47+
metadata:
48+
labels:
49+
app: promtorture
50+
spec:
51+
containers:
52+
- name: promtorture
53+
image: promtorture
54+
imagePullPolicy: Never
55+
ports:
56+
- containerPort: 8080
57+
name: metrics
58+
args:
59+
- "--port=8080"
60+
- "--targets=${targets}"
61+
- "--info-metrics-labels=${info_metrics_labels}"
62+
- "--gauge-metrics=${gauge_metrics}"
63+
__END__
64+
65+
"${kubectl[@]}" apply -f /dev/stdin <<__END__
66+
apiVersion: v1
67+
kind: Service
68+
metadata:
69+
name: promtorture
70+
spec:
71+
selector:
72+
app: promtorture
73+
ports:
74+
- protocol: TCP
75+
port: 8080
76+
targetPort: metrics
77+
name: metrics
78+
__END__
79+
80+
"${kubectl[@]}" apply -f /dev/stdin <<__END__
81+
kind: PodMonitor
82+
apiVersion: monitoring.coreos.com/v1
83+
metadata:
84+
name: promtorture
85+
labels:
86+
app: promtorture
87+
spec:
88+
selector:
89+
matchLabels:
90+
app: promtorture
91+
namespaceSelector:
92+
matchNames:
93+
- default
94+
podMetricsEndpoints:
95+
- port: metrics
96+
__END__
97+
98+
"${kubectl[@]}" wait --for=condition=available --timeout=60s deployment/promtorture
99+
100+
echo 1>&2 "Promtorture is running on service 'promtorture' on port 'metrics' (TCP/8080)"
101+
102+
# vim: et ts=2 sw=2 sts=2 ft=bash ai

0 commit comments

Comments
 (0)