Skip to content

Commit b871d8d

Browse files
andrewd-zededaeriknordmark
authored andcommitted
Misc kubevirt kube container changes
- Component version bumps for perf improvements: longhorn 1.6.3 cdi 1.57.1 - containerd config change required for cdi 1.57.1 https://github.com/kubevirt/containerized-data-importer/blob/main/doc/block_cri_ownership_config.md https://kubernetes.io/blog/2021/11/09/non-root-containers-and-devices/ - event-ttl bump to improve ability to debug system Extend saved time range of kubernetes events from 1hr to 72hr. - collect-info kubectl dumps for completeness to debug state Signed-off-by: Andrew Durbin <[email protected]>
1 parent 78d9acf commit b871d8d

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

pkg/debug/scripts/collect-info.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Script version, don't forget to bump up once something is changed
88

9-
VERSION=32
9+
VERSION=33
1010
# Add required packages here, it will be passed to "apk add".
1111
# Once something added here don't forget to add the same package
1212
# to the Dockerfile ('ENV PKGS' line) of the debug container,
@@ -328,6 +328,14 @@ collect_kube_info()
328328
echo "============"
329329
eve exec kube kubectl describe pods -A
330330
echo "============"
331+
echo "kubectl get rs -A"
332+
echo "============"
333+
eve exec kube kubectl get rs -A
334+
echo "============"
335+
echo "kubectl describe rs -A"
336+
echo "============"
337+
eve exec kube kubectl describe rs -A
338+
echo "============"
331339
echo "kubectl get pvc -A"
332340
echo "============"
333341
eve exec kube kubectl get pvc -A
@@ -344,6 +352,14 @@ collect_kube_info()
344352
echo "============"
345353
eve exec kube kubectl describe vmi -A
346354
echo "============"
355+
echo "kubectl get vmirs -A"
356+
echo "============"
357+
eve exec kube kubectl get vmirs -A
358+
echo "============"
359+
echo "kubectl describe vmirs -A"
360+
echo "============"
361+
eve exec kube kubectl describe vmirs -A
362+
echo "============"
347363
echo "kubectl get kubevirt -n kubevirt -o yaml"
348364
echo "============"
349365
eve exec kube kubectl get kubevirt -n kubevirt -o yaml

pkg/kube/cluster-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
KUBEVIRT_VERSION=v1.1.0
7-
CDI_VERSION=v1.54.0
7+
CDI_VERSION=v1.57.1
88
NODE_IP=""
99
RESTART_COUNT=0
1010
K3S_LOG_DIR="/persist/kubelog"

pkg/kube/config-k3s.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ root = "/persist/vault/containerd"
1313
enable_unprivileged_ports = true
1414
enable_unprivileged_icmp = true
1515
sandbox_image = "rancher/mirrored-pause:3.6"
16+
device_ownership_from_security_context = true
1617

1718
[plugins."io.containerd.grpc.v1.cri".containerd]
1819
snapshotter = "overlayfs"

pkg/kube/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ etcd-expose-metrics: true
1111
container-runtime-endpoint: "/run/containerd-user/containerd.sock"
1212
disable-network-policy: true
1313
disable-cloud-controller: true
14+
kube-apiserver-arg:
15+
- "event-ttl=72h"

pkg/kube/longhorn-utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2024 Zededa, Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
LONGHORN_VERSION=v1.6.2
6+
LONGHORN_VERSION=v1.6.3
77

88
longhorn_install() {
99
node_name=$1

pkg/kube/nsmounter

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
# mount RWX volumes for longhorn
1010
#
1111
target_pid=1
12-
kube_pid=$(pgrep -f "cluster-init.sh")
13-
if [ -n "$kube_pid" ]; then
14-
target_pid=$kube_pid
15-
fi
12+
starting_pid=$$
13+
while [ "$starting_pid" != "1" ]; do
14+
ppid=$(grep PPid "/proc/${starting_pid}/status" | cut -d ':' -f 2 | tr -d '\t')
15+
echo "proc:$starting_pid has ppid:$ppid"
16+
if grep -q containerd "/proc/${ppid}/cmdline"; then
17+
target_pid=$ppid
18+
break
19+
fi
20+
starting_pid=$ppid
21+
done
1622
nsenter -t "$target_pid" -m -n -u -- "$@"

0 commit comments

Comments
 (0)