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

chore: etcd powered by rsm #5272

Merged
merged 5 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
stop&start works, vscale, restart, hscale not yet
  • Loading branch information
free6om committed Sep 27, 2023
commit e045177899cfaba57c852ccf9828644e38763fab
29 changes: 0 additions & 29 deletions deploy/etcd/templates/clusterdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,6 @@ spec:
if [ "true" = "$IsLeader" ]; then echo -n "leader"; elif [ "true" = "$IsLearner" ]; then echo -n "learner"; else echo -n "follower"; fi
roleUpdateMechanism: DirectAPIServerEventUpdate
memberUpdateStrategy: BestEffortParallel
membershipReconfiguration:
switchoverAction:
image: quay.io/coreos/etcd:v3.5.6
command:
- /bin/bash
- -c
- |
echo "Prepare to promote $KB_RSM_TARGET_HOST" &&
follower_id=$(etcdctl --endpoints="http://$KB_RSM_LEADER_HOST:$KB_RSM_SERVICE_PORT" member list | grep "$KB_RSM_TARGET_HOST" | awk -F',' '{print $1}') &&
[[ -z $follower_id ]] && echo "No follower found. Exiting..." && exit 1 &&
echo "Promoting Follower: $follower_id" &&
etcdctl --endpoints=http://$KB_RSM_LEADER_HOST:$KB_RSM_SERVICE_PORT member promote $follower_id &&
new_leader=$(etcdctl --endpoints=http://$KB_RSM_TARGET_HOST:$KB_RSM_SERVICE_PORT endpoint status --cluster | awk '{print $2,$6}' | grep 'true' | awk -F',' '{print $1}') &&
[[ $new_leader != $follower_id ]] && echo "Switchover failed. New leader is not the same as expected." && exit 1 &&
echo "New Leader: $new_leader" &&
echo "Etcd Switchover completed successfully."
memberJoinAction:
command:
- /bin/bash
- -c
- |
etcdctl --endpoints=http://$KB_RSM_LEADER_HOST:$KB_RSM_SERVICE_PORT member add $KB_RSM_TARGET_HOST --peer-urls="http://$KB_RSM_TARGET_HOST:$KB_RSM_SERVICE_PORT"
memberLeaveAction:
command:
- /bin/bash
- -c
- |
member_id=$(etcdctl --endpoints=http://$KB_RSM_TARGET_HOST:$KB_RSM_SERVICE_PORT member list | grep "$KB_RSM_TARGET_HOST" | awk -F',' '{print $1}') &&
etcdctl member remove $member_id
service:
ports:
- name: client
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/testdata/smoketest/etcd/03_vscale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ spec:
type: VerticalScaling
verticalScaling:
- componentName: etcd
requests:
cpu: "500m"
memory: 500Mi
requests:
cpu: "500m"
memory: 500Mi