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

Merged

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.

@naiming-zededa naiming-zededa force-pushed the naiming-cluster-init-change branch from c030dfa to 6871b98 Compare October 18, 2024 18:43
@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
@naiming-zededa naiming-zededa force-pushed the naiming-cluster-init-change branch from 6871b98 to 51911dd Compare October 18, 2024 19:17
@github-actions github-actions bot requested a review from eriknordmark October 18, 2024 19:17
@naiming-zededa naiming-zededa force-pushed the naiming-cluster-init-change branch from 51911dd to 42a1e98 Compare October 18, 2024 19:33
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.

pkg/kube/cluster-init.sh Outdated Show resolved Hide resolved
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

Copy link
Contributor

Choose a reason for hiding this comment

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

this looks resolved

pkg/kube/cluster-init.sh Outdated Show resolved Hide resolved
@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
@eriknordmark eriknordmark requested a review from deitch November 5, 2024 20:53
@deitch
Copy link
Contributor

deitch commented Nov 7, 2024

Looks like it needs to be rebased.

@naiming-zededa naiming-zededa force-pushed the naiming-cluster-init-change branch from 8b3271c to 26158ac Compare November 7, 2024 19:38
- 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 <naiming@zededa.com>
@naiming-zededa naiming-zededa force-pushed the naiming-cluster-init-change branch from 26158ac to f176b77 Compare November 7, 2024 20:03
@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.

@eriknordmark
Copy link
Contributor

hi @andrewd-zededa, i have resolved some conflicts, in particular this:

@andrewd-zededa can you respond to this and take another look?

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.

I think the original conflicts/overlap are resolved, just a small fix for a function not yet defined.

return 1
fi
logmsg "Done applying Multus"
ln -s /var/lib/cni/bin/multus /var/lib/rancher/k3s/data/current/bin/multus
link_multus_into_k3s
Copy link
Contributor

Choose a reason for hiding this comment

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

link_multus_into_k3s is not defined yet, its in an upcoming PR for pkg/kube/cluster-update.sh

Copy link
Contributor

Choose a reason for hiding this comment

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

I can submit a quick PR to add a skeleton cluster-update.sh with just this defined to get this moving again.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why shellcheck didn't find this

Copy link
Contributor

Choose a reason for hiding this comment

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

I created #4445 to define the missing function

Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

LGTM

@eriknordmark eriknordmark merged commit 3896403 into lf-edge:master Nov 27, 2024
65 checks passed
@naiming-zededa naiming-zededa deleted the naiming-cluster-init-change branch December 3, 2024 19:17
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