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

Impossible to create managed cluster in the airgapped environment #702

Open
a13x5 opened this issue Dec 2, 2024 · 0 comments · May be fixed by #791
Open

Impossible to create managed cluster in the airgapped environment #702

a13x5 opened this issue Dec 2, 2024 · 0 comments · May be fixed by #791
Assignees
Labels
bug Something isn't working

Comments

@a13x5
Copy link
Contributor

a13x5 commented Dec 2, 2024

The issue

Currently when creating cluster in the airgapped environment there is no mechanism to define where k0s artifacts will be downloaded from. Thus by default cloud-init runcmd section will look something like this:

runcmd:
  - chown ubuntu /home/ubuntu/.ssh/authorized_keys
  - sed -i 's/"externalAddress":"172.16.1.50",//' /etc/k0s.yaml
  - curl -sSfL https://get.k0s.sh | K0S_VERSION=v1.31.1+k0s.1 sh
  - (command -v systemctl > /dev/null 2>&1 && (cp /k0s/k0sleave.service /etc/systemd/system/k0sleave.service && systemctl daemon-reload && systemctl enable k0sleave.service && systemctl start k0sleave.service) || true)
  - (command -v rc-service > /dev/null 2>&1 && (cp /k0s/k0sleave-openrc /etc/init.d/k0sleave && rc-update add k0sleave shutdown) || true)
  - k0s install controller --force --enable-dynamic-config --env AUTOPILOT_HOSTNAME=tt-1-cp-0 --labels=k0smotron.io/machine-name=tt-1-cp-0 --enable-worker --disable-components=konnectivity-server --config /etc/k0s.yaml --kubelet-extra-args="--hostname-override=tt-1-cp-0"
  - k0s start
  - mkdir -p /run/cluster-api && touch /run/cluster-api/bootstrap-success.complete

This is failing obviously because:

  1. It tries download k0s from URL https://get.k0s.sh.
  2. There is no airgap bundle being passed to the node, so even if k0s binary will be on the node rest of the images will be absent.

The solution

For the airgapped deployment downloadURL parameter should be used to define where download k0s executable from. Aslo modifications to the preStartCommands will be needed properly place k0s airgap bundle on the node.

Additionally the http endpoint with the artifacts could be deployed directly on the management cluster.

@a13x5 a13x5 added the bug Something isn't working label Dec 2, 2024
@a13x5 a13x5 self-assigned this Dec 2, 2024
@a13x5 a13x5 moved this from Todo to In Progress in Project 2A Dec 3, 2024
@a13x5 a13x5 linked a pull request Dec 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant