Skip to content

Commit

Permalink
Add logging for aws managed csi drivers (#1336)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwolfaws authored Jul 7, 2023
1 parent 2ae9f65 commit fdee26a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion log-collector-script/linux/eks-log-collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export LANG="C"
export LC_ALL="C"

# Global options
readonly PROGRAM_VERSION="0.7.5"
readonly PROGRAM_VERSION="0.7.6"
readonly PROGRAM_SOURCE="https://github.com/awslabs/amazon-eks-ami/blob/master/log-collector-script/"
readonly PROGRAM_NAME="$(basename "$0" .sh)"
readonly PROGRAM_DIR="/opt/log-collector"
Expand Down Expand Up @@ -50,6 +50,7 @@ REQUIRED_UTILS=(

COMMON_DIRECTORIES=(
kernel
modinfo
system
docker
containerd
Expand Down Expand Up @@ -263,6 +264,7 @@ collect() {
get_region
get_common_logs
get_kernel_info
get_modinfo
get_mounts_info
get_selinux_info
get_iptables_info
Expand Down Expand Up @@ -354,6 +356,7 @@ get_common_logs() {
cp --force --dereference --recursive /var/log/containers/ebs-csi* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/containers/efs-csi* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/containers/fsx-csi* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/containers/fsx-openzfs-csi* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/containers/file-cache-csi* "${COLLECT_DIR}"/var_log/ 2> /dev/null
continue
fi
Expand All @@ -364,6 +367,9 @@ get_common_logs() {
cp --force --dereference --recursive /var/log/pods/kube-system_kube-proxy* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/pods/kube-system_ebs-csi-* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/pods/kube-system_efs-csi-* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/pods/kube-system_fsx-csi-* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/pods/kube-system_fsx-openzfs-csi-* "${COLLECT_DIR}"/var_log/ 2> /dev/null
cp --force --dereference --recursive /var/log/pods/kube-system_file-cache-csi-* "${COLLECT_DIR}"/var_log/ 2> /dev/null
continue
fi
cp --force --recursive --dereference /var/log/"${entry}" "${COLLECT_DIR}"/var_log/ 2> /dev/null
Expand All @@ -386,6 +392,12 @@ get_kernel_info() {
ok
}

# collect modinfo on specific modules for debugging purposes
get_modinfo() {
try "collect modinfo"
modinfo lustre > "${COLLECT_DIR}/modinfo/lustre"
}

get_docker_logs() {
try "collect Docker daemon logs"

Expand Down

0 comments on commit fdee26a

Please sign in to comment.