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

Main changes for kube/cluster-init.sh for multi-node cluster handling #4385

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

Conversation

naiming-zededa
Copy link
Contributor

  • 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.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 20.93%. Comparing base (dd27fe1) to head (c030dfa).
Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@@ -1,141 +1,109 @@
#!/bin/sh
#
# Copyright (c) 2023-2024 Zededa, Inc.
# Copyright (c) 2024 Zededa, Inc.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

nohup /usr/bin/k3s server --config "$k3s_config_file" &

# remember the k3s start time
k3s_last_start_time=$(date +%s)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@eriknordmark eriknordmark changed the title Main chnages for kube/cluster-init.sh for multi-node cluster handling Main changes for kube/cluster-init.sh for multi-node cluster handling Oct 18, 2024
Copy link
Contributor

@andrewd-zededa andrewd-zededa left a 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.


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]')
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@andrewd-zededa andrewd-zededa left a 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

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
Copy link
Contributor

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

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')
Copy link
Contributor

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

@naiming-zededa naiming-zededa force-pushed the naiming-cluster-init-change branch 3 times, most recently from a3b402e to 8b3271c Compare October 24, 2024 20:42
@deitch
Copy link
Contributor

deitch commented Nov 7, 2024

Looks like it needs to be rebased.

- 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]>
@naiming-zededa
Copy link
Contributor Author

Looks like it needs to be rebased.

Hi @deitch rebased in the update.
hi @andrewd-zededa, i have resolved some conflicts, in particular this:

        if ! external_boot_image_import; then
                continue
        fi

please check to see if this is in the intended place.

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.

4 participants