File tree 1 file changed +17
-17
lines changed
hack/ostests/modules/k0sctl
1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -28,26 +28,26 @@ kubectl() {
28
28
" $@ "
29
29
}
30
30
31
- countSeenControllers () {
32
- kubectl -n kube-system logs " $1 " \
33
- | grep -F ' "Start serving"' \
34
- | sed -E ' s/.+serverID="([0-9a-f]+)".+/\1/g' \
35
- | sort -u \
36
- | wc -l
37
- }
38
-
39
31
testKonnectivityPods () {
40
- pods=" $( kubectl -n kube-system get po -l k8s-app=konnectivity-agent --field-selector=status.phase=Running -oname) "
41
-
42
- seenPods=0
43
- for pod in $pods ; do
44
- seenControllers=" $( countSeenControllers " $pod " ) "
45
- echo Pod: " $pod " , seen controllers: " $seenControllers " >&2
46
- [ " $seenControllers " -ne " $expectedControllers " ] || seenPods=$(( seenPods + 1 ))
32
+ nodeIPs=$( kubectl get nodes -o jsonpath=' {range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address}{"\n"}{end}' )
33
+
34
+ goodNodes=0
35
+ for ip in $nodeIPs ; do
36
+ openServerConnections=$( curl -sSf " http://$ip :8093/metrics" | {
37
+ while read -r metric value; do
38
+ if [ " $metric " = konnectivity_network_proxy_agent_open_server_connections ]; then
39
+ echo " $value "
40
+ break
41
+ fi
42
+ done
43
+ })
44
+
45
+ echo Node IP: " $ip " , open konnectivity server connections: " $openServerConnections " >&2
46
+ [ " $openServerConnections " -ne " $expectedControllers " ] || goodNodes=$(( goodNodes + 1 ))
47
47
done
48
48
49
- echo Seen pods with expected amount of controller connections: $seenPods >&2
50
- [ $seenPods -eq " $expectedWorkers " ]
49
+ echo Nodes with expected number of open konnectivity server connections: $goodNodes >&2
50
+ [ $goodNodes -eq " $expectedWorkers " ]
51
51
}
52
52
53
53
testCoreDnsDeployment () {
You can’t perform that action at this time.
0 commit comments