Skip to content

Commit f26aa59

Browse files
committed
feat(stacks): add kube-state-metrics
1 parent 716f8c0 commit f26aa59

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

scripts/checker.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,13 @@
274274
"node_exporter": {
275275
"name": "node_exporter",
276276
"type": "github",
277-
"owner": "node_exporter",
277+
"owner": "prometheus",
278+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
279+
},
280+
"kube-state-metrics": {
281+
"name": "kube-state-metrics",
282+
"type": "github",
283+
"owner": "kubernetes",
278284
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
279285
},
280286
}

stacks/kube-state-metrics/build.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
generate-stack-path
9+
install-packages make
10+
install-stack go 1.19.3 && . init-stack
11+
12+
curl -sSL "https://github.com/kubernetes/kube-state-metrics/archive/refs/tags/v${STACK_VERSION}.tar.gz" | tar -xz \
13+
&& cd kube-state-metrics-${STACK_VERSION} \
14+
&& make build-local
15+
16+
BIN_DIR="${DATA_DIR}"/bin
17+
mkdir -p "${BIN_DIR}"
18+
mv ./kube-state-metrics "${BIN_DIR}"
19+
cd .. && rm -rf kube-state-metrics-${STACK_VERSION}
20+
#upx
21+
upx --lzma --best "${BIN_DIR}"/*
22+
}
23+
24+
# call build stack
25+
build-stack "${1}"
26+

0 commit comments

Comments
 (0)