Last active
December 5, 2022 17:21
-
-
Save jjdonson/488b00b59432eea22f1a21d9f2cbf1f4 to your computer and use it in GitHub Desktop.
Proposed automated bug report stub for k8s.....
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Automated K8s cluster provisioning bug report.... | |
DATE_STAMP=$(date +'%Y%m%d') | |
UTIME_STAMP=$(date +'%s') | |
K8S_BUG_REPORT_FILE="k8s-bug-report-${DATE_STAMP}.log" | |
CONTROLLER_HOST_PLATFORM=$( python3 -m platform || python -m platform ) # controller host platform => usually a desktop or laptop. | |
CONTROLLER_HOST_SSH_V=$(ssh --version ) | |
VAGRANT_VERSION=$(vagrant --version) # ... running on the controller host. | |
VBOX_VERSION=$(vboxmanage --version) # ... running on the controller host. | |
VBOX_BOX=$(vagrant box list) # ... ibid... But which boxes are running on which vms... host names could reflect.... | |
ANSIBLE_VERSION=$(ansible --version) # ... running on the controller host. | |
TERRAFORM_VERSION=$(terraform --version) # ... running on the controller host. | |
NODE_HOST_NAMES=$( vagrant status | grep virtualbox | awk '{print $1}' ) | |
NODE_COUNT=$(vagrant status | grep virtualbox | awk '{print $1}' | wc -l) # ... running on the controller host. | |
for NODE in "${NODE_HOST_NAMES[@]}"; do | |
NODE_DISTRO="$NODE [uname -a]: $( vagrant ssh $NODE -- uname -a )" | |
NODE_PLATFORM="$NODE [facter -y]: $( vagrant ssh $NODE -- facter -y)" | |
done | |
NODE_SPECS=$(facter -y) # ... running on any node vm. | |
K8S_VERSION_KADM=$(kubeadm --version ) # ... running on the master node. | |
K8S_VERSION_KCTL=$(kubectl --version ) | |
ETCD_VERSION=$(ETCDCTL_API=3 etcdctl -h ) | |
NODE_PROBLEM_BRANCHES_ARRAY=( hardware kernel runtime multi other ) | |
read -p 'What is your email address or github id?' ID | |
BUG_REPORT_MESSAGE="Bug Reporter: ${ID}\nDate: ${DATE_STAMP}\n\ | |
${K8S_VERSION_KADM}\n${K8S_VERSION_KCTL}\n${CONTROLLER_HOST_PLATFORM}\n${NODE_COUNT}\ | |
# ... | |
echo "${BUG_REPORT_MESSAGE}" > $K8S_BUG_REPORT_FILE | |
# Where to send | |
# Auto-request further details? | |
# How to aggregate reporting while confirming problems are reproducible? | |
# https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use/ | |
# Other sources of spread... | |
# Linux distro flavors and versions... | |
# Cloud Vendors.... | |
# Programming Languages... | |
# Data Engines ... | |
# Ubuntu with .NETCORE and SQL Server seem to target largest demographic.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment