Skip to content

feat(gcp): install k0s with k0sctl before Codesphere - #602

Open
NautiluX wants to merge 2 commits into
mainfrom
bootstrap-k0sctl
Open

feat(gcp): install k0s with k0sctl before Codesphere#602
NautiluX wants to merge 2 commits into
mainfrom
bootstrap-k0sctl

Conversation

@NautiluX

Copy link
Copy Markdown
Member

Use k0sctl installation integrated in OMS to bootstrap on GCP

  • Installs k0s using k0sctl and configures it so Codesphere can be installed
  • Skips the kubernetes installation of the TS installer
  • Sets the default k0s version to current lowest supported Kubernetes version

@NautiluX
NautiluX force-pushed the bootstrap-k0sctl branch 4 times, most recently from 7bc321e to 0c9cdf2 Compare July 23, 2026 13:50
@NautiluX
NautiluX requested a review from joka134 July 23, 2026 13:51
Comment thread internal/bootstrap/gcp/gcp.go Outdated
func (b *GCPBootstrapper) InstallK0s() error {
// Reuse matching cached binaries and let k0sctl reconcile normally. Without
// --force, an unchanged cluster remains untouched on bootstrap retries.
installCmd := fmt.Sprintf("oms install k0s --install-config /etc/codesphere/config.yaml --vault %s --vault-priv-key %s/age_key.txt",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When rerunning this, it fails with:

Using latest k0s version: v1.36.2+k0s.0
Downloading k0s version v1.36.2+k0s.0
Error: failed to download k0s: k0s binary already exists at /root/.cache/oms/k0s. Use --force to overwrite

So we are not using the version we defined before and we should force it (or remove this behaviour in oms when the binary already exists)

host := createK0sctlHost(cp, "controller", nil, sshKeyPath, k0sBinaryPath)
var installFlags []string
if workerIPs[cp.IPAddress] {
installFlags = []string{"--enable-worker", "--no-taints=true"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried setting up a single node cluster on gcp with this branch and the cp was not showing up as worker node. Need some further investigation why.

Signed-off-by: NautiluX <2600004+NautiluX@users.noreply.github.com>
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.

2 participants