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

fix: update must-gather script #338

Merged
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
6 changes: 3 additions & 3 deletions must-gather/common
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

set -eu -o pipefail

export KEPLER_NS="openshift-kepler-operator"
export KEPLER_NS="kepler-operator"
export LOGFILE_NAME="gather-debug.log"

get_timestamp() {
Expand All @@ -42,8 +42,8 @@ log() {

run() {
length=$(($# - 1))
cmd=${@:1:$length}
gather_file="${@: -1}"
cmd=${*:1:$length}
gather_file="${*: -1}"

log_file "$cmd"
$cmd >>"$gather_file" 2>>"$LOGFILE_PATH" || true
Expand Down
12 changes: 4 additions & 8 deletions must-gather/gather
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,23 @@ get_kepler_events() {
}

get_kepler_daemon_set() {
KEPLER_EXPORTER_DS="kepler-exporter-ds"
log "getting kepler exporter daemonset"
run oc -n "$KEPLER_NS" get ds $KEPLER_EXPORTER_DS -oyaml "$BASE_COLLECTION_PATH/$KEPLER_EXPORTER_DS"".yaml"
run oc -n "$KEPLER_NS" get ds kepler -oyaml "$BASE_COLLECTION_PATH/kepler-ds.yaml"
}

get_kepler_config_map() {
KEPLER_EXPORTER_CM="kepler-exporter-cm"
log "getting kepler exporter config map"
run oc -n "$KEPLER_NS" get cm $KEPLER_EXPORTER_CM -oyaml "$BASE_COLLECTION_PATH/$KEPLER_EXPORTER_CM"".yaml"
run oc -n "$KEPLER_NS" get cm kepler -oyaml "$BASE_COLLECTION_PATH/kepler-cm.yaml"
}

get_kepler_sa() {
KEPLER_EXPORTER_SA="kepler-exporter-sa"
log "getting kepler exporter service account"
run oc -n "$KEPLER_NS" get serviceaccount $KEPLER_EXPORTER_SA -oyaml "$BASE_COLLECTION_PATH/$KEPLER_EXPORTER_SA"".yaml"
run oc -n "$KEPLER_NS" get serviceaccount kepler -oyaml "$BASE_COLLECTION_PATH/kepler-sa.yaml"
}

get_kepler_scc() {
KEPLER_EXPORTER_SCC="kepler-exporter-scc"
log "getting kepler exporter scc"
run oc get scc "$KEPLER_EXPORTER_SCC" -oyaml "$BASE_COLLECTION_PATH/$KEPLER_EXPORTER_SCC"".yaml"
run oc get scc kepler -oyaml "$BASE_COLLECTION_PATH/kepler-scc.yaml"
}

gather_kepler_exporter_info() {
Expand Down
12 changes: 6 additions & 6 deletions must-gather/gather-kepler-exporter-info
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,35 @@ get_kepler_pod() {

get_kepler_cpuid() {
log "getting information from \"cpuid\" from kepler pod: $KEPLER_POD"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler-exporter -- cpuid -1 "$KEPLER_POD_INFO_DIR/node-cpuid-info"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler -- cpuid -1 "$KEPLER_POD_INFO_DIR/node-cpuid-info"
}

get_kepler_env_var() {
log "getting environment variables from kepler pod: $KEPLER_POD"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler-exporter -- env "$KEPLER_POD_INFO_DIR/env-variables"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler -- env "$KEPLER_POD_INFO_DIR/env-variables"
}

get_kepler_kernel_info() {
log "getting kernel version from kepler pod: $KEPLER_POD"
echo "kernel version:" >>"$KEPLER_POD_INFO_DIR/kernel-info"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler-exporter -- uname -a "$KEPLER_POD_INFO_DIR/kernel-info"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler -- uname -a "$KEPLER_POD_INFO_DIR/kernel-info"
}

get_kepler_ebpf_info() {
log "getting ebpf information from kepler pod: $KEPLER_POD"
echo "## kprobes list only applicable for bcc" >>"$KEPLER_POD_INFO_DIR/ebpf-info"
echo "kprobes list:" >>"$KEPLER_POD_INFO_DIR/ebpf-info"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler-exporter -- cat /sys/kernel/debug/kprobes/list "$KEPLER_POD_INFO_DIR/ebpf-info"
run oc -n "$KEPLER_NS" exec "$KEPLER_POD" -c kepler -- cat /sys/kernel/debug/kprobes/list "$KEPLER_POD_INFO_DIR/ebpf-info"
}

get_kepler_logs() {
log "getting logs from kepler pod: $KEPLER_POD"
run oc -n "$KEPLER_NS" logs "$KEPLER_POD" -c kepler-exporter "$KEPLER_POD_INFO_DIR/kepler.log"
run oc -n "$KEPLER_NS" logs "$KEPLER_POD" -c kepler "$KEPLER_POD_INFO_DIR/kepler.log"
}

main() {

KEPLER_POD_INFO_DIR="$BASE_COLLECTION_PATH/kepler-exporter-info/$KEPLER_POD"
KEPLER_POD_INFO_DIR="$BASE_COLLECTION_PATH/kepler-info/$KEPLER_POD"
mkdir -p "$KEPLER_POD_INFO_DIR"

get_kepler_pod
Expand Down
Loading