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

[Release-1.26] - [RFE] Mechanism to easily determine etcd node health/voter status #5045

Closed
brandond opened this issue Nov 16, 2023 · 1 comment
Assignees

Comments

@brandond
Copy link
Contributor

Backport fix for [RFE] Mechanism to easily determine etcd node health/voter status

@VestigeJ
Copy link
Contributor

##Environment Details
Validated using VERSION=v1.26.11+rke2r1

Infrastructure

  • Cloud

Node(s) CPU architecture, OS, and version:

Linux 5.14.21-150500.53-default x86_64 GNU/Linux
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP5"

Cluster Configuration:

NAME         STATUS   ROLES                       AGE   VERSION
ip-1-2-5-7   Ready    control-plane,etcd,master   10m   v1.26.11+rke2r1

Config.yaml:

write-kubeconfig-mode: 644
debug: true
token: YOUR_TOKEN_HERE
profile: cis
selinux: true
node-external-ip: 1.2.5.7

Validation Steps

$ curl https://get.rke2.io --output install-"rke2".sh
$ sudo chmod +x install-"rke2".sh
$ sudo groupadd --system etcd && sudo useradd -s /sbin/nologin --system -g etcd etcd
$ sudo modprobe ip_vs_rr
$ sudo modprobe ip_vs_wrr
$ sudo modprobe ip_vs_sh
$ sudo printf "on_oovm.panic_on_oom=0 \nvm.overcommit_memory=1 \nkernel.panic=10 \nkernel.panic_ps=1 \nkernel.panic_on_oops=1 \n" > ~/60-rke2-cis.conf
$ sudo cp 60-rke2-cis.conf /etc/sysctl.d/
$ sudo systemctl restart systemd-sysctl
$ sudo INSTALL_RKE2_VERSION=v1.26.11-rc1+rke2r1 INSTALL_RKE2_EXEC=server ./install-rke2.sh
$ go_rke2
$ set_kubefig
$ kgn
$ IP=$(kgn | awk 'NR>1{print $1}')
$ echo $IP
$ kubectl get node $IP -o=jsonpath='Node Name: {.metadata.name}{"\n"}Conditions:{"\n"}{range .status.conditions[*]}- Type: {.type}{"\n"}  Status: {.status}{"\n"}  LastHeartbeatTime: {.lastHeartbeatTime}{"\n"}  LastTransitionTime: {.lastTransitionTime}{"\n"}  Reason: {.reason}{"\n"}  Message: {.message}{"\n\n"}{end}'

Results:

$ IP=$(kgn | awk 'NR>1{print $1}') //kgn = kubectl get nodes
$ kubectl get node $IP -o=jsonpath='Node Name: {.metadata.name}{"\n"}Conditions:{"\n"}{range .status.conditions[*]}- Type: {.type}{"\n"} Status: {.status}{"\n"} LastHeartbeatTime: {.lastHeartbeatTime}{"\n"} LastTransitionTime: {.lastTransitionTime}{"\n"} Reason: {.reason}{"\n"} Message: {.message}{"\n\n"}{end}'

Node Name: ip-1-2-5-7
Conditions:
- Type: NetworkUnavailable
  Status: False
  LastHeartbeatTime: 2023-11-30T23:24:56Z
  LastTransitionTime: 2023-11-30T23:24:56Z
  Reason: FlannelIsUp
  Message: Flannel is running on this node

- Type: MemoryPressure
  Status: False
  LastHeartbeatTime: 2023-11-30T23:26:25Z
  LastTransitionTime: 2023-11-30T23:24:02Z
  Reason: KubeletHasSufficientMemory
  Message: kubelet has sufficient memory available

- Type: DiskPressure
  Status: False
  LastHeartbeatTime: 2023-11-30T23:26:25Z
  LastTransitionTime: 2023-11-30T23:24:02Z
  Reason: KubeletHasNoDiskPressure
  Message: kubelet has no disk pressure

- Type: PIDPressure
  Status: False
  LastHeartbeatTime: 2023-11-30T23:26:25Z
  LastTransitionTime: 2023-11-30T23:24:02Z
  Reason: KubeletHasSufficientPID
  Message: kubelet has sufficient PID available

- Type: Ready
  Status: True
  LastHeartbeatTime: 2023-11-30T23:26:25Z
  LastTransitionTime: 2023-11-30T23:24:49Z
  Reason: KubeletReady
  Message: kubelet is posting ready status. AppArmor enabled

- Type: EtcdIsVoter
  Status: True
  LastHeartbeatTime: 2023-11-30T23:24:34Z
  LastTransitionTime: 2023-11-30T23:24:34Z
  Reason: MemberNotLearner
  Message: Node is a voting member of the etcd cluster

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

No branches or pull requests

4 participants