Skip to content

Commit 51d92e2

Browse files
committed
Add htop and nvtop functionality
1 parent e5e208c commit 51d92e2

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
help(){
4+
echo ""
5+
echo "This command runs a htop container on a specified node in your cluster"
6+
echo ""
7+
echo "Usage: $0 <node_name>"
8+
echo ""
9+
}
10+
11+
if [ "$1" == "" ]; then
12+
help
13+
else
14+
node_name=$1
15+
CMD="kubectl run -it --rm htop --image iankoulski/do-htop:latest --overrides='{\"apiVersion\": \"v1\", \"spec\": {\"nodeSelector\": { \"kubernetes.io/hostname\": \"$node_name\" }}}' --command -- htop"
16+
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
17+
eval "$CMD"
18+
fi
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
help(){
4+
echo ""
5+
echo "This command runs an nvtop container on a specified node in your cluster"
6+
echo ""
7+
echo "Usage: $0 <node_name>"
8+
echo ""
9+
}
10+
11+
if [ "$1" == "" ]; then
12+
help
13+
else
14+
node_name=$1
15+
CMD="kubectl run -it --rm nvtop --image iankoulski/do-nvtop:latest --overrides='{\"apiVersion\": \"v1\", \"spec\": {\"nodeSelector\": { \"kubernetes.io/hostname\": \"$node_name\" }}}' --command -- nvtop"
16+
if [ ! "$VERBOSE" == "false" ]; then echo -e "\n${CMD}\n"; fi
17+
eval "$CMD"
18+
fi
19+

0 commit comments

Comments
 (0)