Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocking kube container logs to be sent and some minor changes #4412

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/debug/scripts/collect-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

VERSION=29
VERSION=30
# Add required packages here, it will be passed to "apk add".
# Once something added here don't forget to add the same package
# to the Dockerfile ('ENV PKGS' line) of the debug container,
Expand Down Expand Up @@ -453,6 +453,7 @@ fi

ln -s /persist/status "$DIR/persist-status"
ln -s /persist/log "$DIR/persist-log"
[ -d /persist/kubelog ] && ln -s /persist/kubelog "$DIR/persist-kubelog"
ln -s /persist/netdump "$DIR/persist-netdump"
ln -s /persist/kcrashes "$DIR/persist-kcrashes"
[ -d /persist/memory-monitor/output ] && ln -s /persist/memory-monitor/output "$DIR/persist-memory-monitor-output"
Expand Down
6 changes: 5 additions & 1 deletion pkg/kube/eve-bridge/eve-bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
)

const (
logfileDir = "/persist/newlog/kube/"
logfileDir = "/persist/kubelog/"
logfile = logfileDir + "eve-bridge.log"
logMaxSize = 100 // 100 Mbytes in size
logMaxBackups = 3 // old log files to retain
Expand Down Expand Up @@ -84,7 +84,11 @@ func parseArgs(args *skel.CmdArgs) (stdinArgs rawJSONStruct, cniVersion,
}
podName = string(envArgs.K8S_POD_NAME)
isVMI = strings.HasPrefix(podName, vmiPodNamePrefix)

isEveApp = string(envArgs.K8S_POD_NAMESPACE) == eveKubeNamespace
if !isVMI && strings.Contains(podName, "-pvc-") && strings.HasPrefix(podName, "cdi-upload-") {
isEveApp = false
}
if envArgs.MAC != "" {
mac, err = net.ParseMAC(string(envArgs.MAC))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kube/multus-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ data:
"capabilities": {
"portMappings": true
},
"logFile": "/persist/newlog/kube/multus.log",
"logFile": "/persist/kubelog/multus.log",
"logLevel": "debug",
"binDir": "/var/lib/cni/bin",
"kubeconfig": "/var/lib/rancher/k3s/agent/etc/cni/net.d/multus.d/multus.kubeconfig",
Expand Down
5 changes: 5 additions & 0 deletions pkg/newlog/cmd/newlogd.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ func getMemlogMsg(logChan chan inputEntry, panicFileChan chan []byte) {
pidStr = strconv.Itoa(logInfo.Pid)
}

// not to upload 'kube' container logs, one can find in /persist/kubelog for detail
if logInfo.Source == "kube" {
continue
}
eriknordmark marked this conversation as resolved.
Show resolved Hide resolved

entry := inputEntry{
source: logInfo.Source,
content: logInfo.Msg,
Expand Down
2 changes: 1 addition & 1 deletion pkg/pillar/scripts/onboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ free_space() {
# If there is less than 4Mbytes (MIN_DISKSPACE) then remove the content of the
# following directories in order until we have that amount of available space
# following sub directories:
PERSIST_CLEANUPS='log netdump kcrashes memory-monitor/output eve-info patchEnvelopesCache patchEnvelopesUsageCache newlog/keepSentQueue newlog/failedUpload newlog/appUpload newlog/devUpload containerd-system-root vault/downloader vault/verifier agentdebug'
PERSIST_CLEANUPS='log netdump kcrashes memory-monitor/output eve-info patchEnvelopesCache patchEnvelopesUsageCache newlog/keepSentQueue newlog/failedUpload newlog/appUpload newlog/devUpload kubelog containerd-system-root vault/downloader vault/verifier agentdebug'
# NOTE that we can not cleanup /persist/containerd and /persist/{vault,clear}/volumes since those are used by applications.
#
# Note that we need to free up some space before Linuxkit starts containerd,
Expand Down
1 change: 1 addition & 0 deletions pkg/pillar/types/diskmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var ReportDirPaths = []string{
PersistDir + "/etcd-storage",
PersistDir + "/kcrashes",
PersistDir + "/eve-info",
PersistDir + "/kubelog",
}

// AppPersistPaths Application-related files live here
Expand Down
Loading