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

feat: 集群巡检工具 TencentBlueKing#2367 #2831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wingyao666
Copy link
Collaborator

根据review优化:
组件配置一致性检查 check_master.sh
集群可用性监测 check_cluster.sh
系统应用检测(Pod状态/服务)check_system.sh

SELF_DIR=$(dirname "$(readlink -f "$0")")
ROOT_DIR="${SELF_DIR}/.."
CHECK_NAMESAPCE=kube-system
CRI_TYPE=$(kubectl get no -o wide| awk '{print $NF}'| grep -v CONTAINER-RUNTIME| awk -F ':' '{print $1}'| head -n 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

简洁一点,提取第二行最后一列,分隔符为冒号的左边元素。
kubectl get no -o wide | awk 'NR==2{split($NF, a, ":"); print a[1]}'

esac

# 检查应用是否存在
if [ -z "$pod_name" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

条件中用[[,而不是用[

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants