-
Notifications
You must be signed in to change notification settings - Fork 162
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
Main changes for kube/cluster-init.sh for multi-node cluster handling #4385
base: master
Are you sure you want to change the base?
Main changes for kube/cluster-init.sh for multi-node cluster handling #4385
Conversation
naiming-zededa
commented
Oct 18, 2024
- create the cluster-utils.sh in pkg/kube for a number of functions
- get EdgeNodeClusterStatus from 'zedkube' for cluster status, cluster nodeip, cluster prefix, etc
- a background process to monitor the cluster mode changes
- implement cluster mode change logic and operations for change from single-node to cluster, or from cluster back to single-node
- save kube /var/lib at single-node first time setup for later use when the mode changes back from cluster mode to single node
- display eve-release string for get node OS-IMAGE field
- this patch tested still works in kubevirt single-node case.
- some of the external_boot_img changes in the patch is from Andrew's diff.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4385 +/- ##
=======================================
Coverage 20.93% 20.93%
=======================================
Files 13 13
Lines 2895 2895
=======================================
Hits 606 606
Misses 2163 2163
Partials 126 126 ☔ View full report in Codecov by Sentry. |
c030dfa
to
6871b98
Compare
pkg/kube/cluster-init.sh
Outdated
@@ -1,141 +1,109 @@ | |||
#!/bin/sh | |||
# | |||
# Copyright (c) 2023-2024 Zededa, Inc. | |||
# Copyright (c) 2024 Zededa, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't remove the old year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. not sure how this was modified.
pkg/kube/cluster-init.sh
Outdated
nohup /usr/bin/k3s server --config "$k3s_config_file" & | ||
|
||
# remember the k3s start time | ||
k3s_last_start_time=$(date +%s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to use this variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed, no need for this in the latest change.
6871b98
to
51911dd
Compare
51911dd
to
42a1e98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is including some changes from my PR, also yetus cleanup needed.
pkg/kube/cluster-init.sh
Outdated
|
||
logmsg "Successfully installed external-boot-image $import_tag as $eve_external_boot_img" | ||
rm -f /etc/external-boot-image.tar | ||
import_name_tag=$(tar -xOf /etc/external-boot-image.tar manifest.json | jq -r '.[0].RepoTags[0]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in my PR #4363
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, we need to coordinate to see which one merge in first, then modify accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naiming-zededa Can you remove my changes from your PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed with my latest patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more notes
pkg/kube/cluster-init.sh
Outdated
lhCfgPath=/var/lib/lh-cfg-${LONGHORN_VERSION}.yaml | ||
if [ ! -e $lhCfgPath ]; then | ||
curl -k https://raw.githubusercontent.com/longhorn/longhorn/${LONGHORN_VERSION}/deploy/longhorn.yaml > "$lhCfgPath" | ||
if [ ! -f /var/lib/longhorn_installing ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also from #4363
pkg/kube/cluster-init.sh
Outdated
fi | ||
if ! grep -q 'create-default-disk-labeled-nodes: true' "$lhCfgPath"; then | ||
sed -i '/ default-setting.yaml: |-/a\ create-default-disk-labeled-nodes: true' "$lhCfgPath" | ||
lhStatus=$(kubectl -n longhorn-system get daemonsets -o json | jq '.items[].status | .numberReady==.desiredNumberScheduled' | tr -d '\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also from #4363
b2d356c
to
a3b402e
Compare
- create the cluster-utils.sh in pkg/kube for a number of functions - get EdgeNodeClusterStatus from 'zedkube' for cluster status, cluster nodeip, cluster prefix, etc - a background process to monitor the cluster mode changes - implement cluster mode change logic and operations for change from single-node to cluster, or from cluster back to single-node - save kube /var/lib at single-node first time setup for later use when the mode changes back from cluster mode to single node - display eve-release string for get node OS-IMAGE field Signed-off-by: Naiming Shen <[email protected]>
a3b402e
to
8b3271c
Compare