Giter Club home page Giter Club logo

Comments (6)

adrecord avatar adrecord commented on June 12, 2024

For comparison here's output of me manually running k3s installer, with the testing channel, on that fcos node..

[root@coreos01 ~]# curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=testing sh -
[INFO]  Finding release for channel testing
[INFO]  Using v1.27.2-rc3+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.27.2-rc3+k3s1/sha256sum-amd64.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.27.2-rc3+k3s1/k3s
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Finding available k3s-selinux versions
Checking out tree e7109be... done
Enabled rpm-md repositories: fedora-cisco-openh264 fedora-modular updates-modular updates fedora rancher-k3s-common-testing updates-archive
Updating metadata for 'rancher-k3s-common-testing'... done
Updating metadata for 'updates-archive'... done
Importing rpm-md... done
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2023-03-14T10:56:46Z solvables: 4
rpm-md repo 'fedora-modular' (cached); generated: 2023-04-13T20:30:47Z solvables: 1082
rpm-md repo 'updates-modular' (cached); generated: 2018-02-20T19:18:14Z solvables: 0
rpm-md repo 'updates' (cached); generated: 2023-05-30T01:55:50Z solvables: 13522
rpm-md repo 'fedora' (cached); generated: 2023-04-13T20:37:10Z solvables: 69222
rpm-md repo 'rancher-k3s-common-testing'; generated: 2023-05-25T20:15:06Z solvables: 8
rpm-md repo 'updates-archive'; generated: 2023-05-30T02:11:55Z solvables: 13778
Resolving dependencies... done
Will download: 1 package (21.2 kB)
Downloading from 'rancher-k3s-common-testing'... done
Importing packages... done
Checking out packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Freed: 2.1 MB (pkgcache branches: 0)
Added:
  k3s-selinux-1.3-10.coreos.noarch
Changes queued for next boot. Run "systemctl reboot" to start a reboot
[WARN]  Failed to find the k3s-selinux policy, please install:
    rpm-ostree install -y container-selinux
    rpm-ostree install -y https://rpm-testing.rancher.io/k3s/testing/common/coreos/noarch/

[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[root@coreos01 ~]# echo $?
0

from k3sup.

alexellis avatar alexellis commented on June 12, 2024

Hi @adrecord

I've unfortunately not heard of fcos, can you please give us a link to the project you are referring to? I assume that's a shortened version of some other project?

What makes you believe that K3s should work on fcos?

This does seem like an issue for the k3s project and not k3sup, since k3sup just installs k3s over SSH.

If K3s fails to install, it implies a compatibility issue that must be solved upstream K3s itself.

Thoughts?

If you think that bash is working, but the k3sup installation may run with different parameters, you could also try adding --print-command to the command, such as:

k3sup install --print-command

Alex

from k3sup.

adrecord avatar adrecord commented on June 12, 2024

Thanks for your response, and thanks for this great project. I appreciate both.

I've unfortunately not heard of fcos, can you please give us a link to the project you are referring to? I assume that's a shortened version of some other project?

Sorry for the shorthand. By fcos I meant Fedora CoreOS.

This does seem like an issue for the k3s project and not k3sup, since k3sup just installs k3s over SSH.

So the text in the body of this issue included the snippet of output of trying to run k3sup. The first comment in this issue was me running k3s installer directly on the fcos host, for comparison. That did work, which is why I thought this was a k3sup issue.

If you think that bash is working, but the k3sup installation may run with different parameters, you could also try adding --print-command to the command, such as:

Thanks for this great advice. Seeing the commands led me to figure out what's going on. I can see that the k3s install line looks great and k3s installs fine. The error occurs after trying to sudo cat /etc/rancher/k3s/k3s.yaml. Sshing to that host, that file doesn't exist. It looks like k3s installed but didn't automatically start the service.

[root@coreos01 ~]# systemctl status k3s
○ k3s.service - Lightweight Kubernetes
     Loaded: loaded (/etc/systemd/system/k3s.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
       Docs: https://k3s.io

I did not set INSTALL_K3S_SKIP_START to true, so I'm not sure why k3s didn't start automatically. Had k3s started automatically that file would have existed, allowing k3sup to continue. Here's the full output of the k3sup install with --print-command

$ ./k3sup install --host coreos01.adr.net --user root --k3s-channel testing --ssh-key ~/.ssh/id_ecdsa --print-command
Running: k3sup install
2023/05/31 21:36:48 coreos01.adr.net
Public IP: coreos01.adr.net
ssh: curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='server --tls-san coreos01.adr.net' INSTALL_K3S_CHANNEL='testing' sh -

[INFO]  Finding release for channel testing
[INFO]  Using v1.27.2-rc3+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.27.2-rc3+k3s1/sha256sum-amd64.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.27.2-rc3+k3s1/k3s
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Finding available k3s-selinux versions
Checking out tree e7109be...done
Enabled rpm-md repositories: fedora-cisco-openh264 fedora-modular updates-modular updates fedora rancher-k3s-common-testing updates-archive
Updating metadata for 'fedora-cisco-openh264'...done
Updating metadata for 'fedora-modular'...done
Updating metadata for 'updates-modular'...done
Updating metadata for 'updates'...done
Updating metadata for 'fedora'...done
Updating metadata for 'rancher-k3s-common-testing'...done
Updating metadata for 'updates-archive'...done
Importing rpm-md...done
rpm-md repo 'fedora-cisco-openh264'; generated: 2023-03-14T10:56:46Z solvables: 4
rpm-md repo 'fedora-modular'; generated: 2023-04-13T20:30:47Z solvables: 1082
rpm-md repo 'updates-modular'; generated: 2018-02-20T19:18:14Z solvables: 0
rpm-md repo 'updates'; generated: 2023-05-31T17:25:42Z solvables: 13915
rpm-md repo 'fedora'; generated: 2023-04-13T20:37:10Z solvables: 69222
rpm-md repo 'rancher-k3s-common-testing'; generated: 2023-05-25T20:15:06Z solvables: 8
rpm-md repo 'updates-archive'; generated: 2023-05-31T18:06:06Z solvables: 14547
Resolving dependencies...done
Will download: 1 package (21.2 kB)
Downloading from 'rancher-k3s-common-testing'...done
Importing packages...done
Checking out packages...done
Running pre scripts...done
Running post scripts...done
Running posttrans scripts...done
Writing rpmdb...done
Writing OSTree commit...done
Staging deployment...done
Freed: 2.1 MB (pkgcache branches: 0)
Added:
  k3s-selinux-1.3-10.coreos.noarch
Changes queued for next boot. Run "systemctl reboot" to start a reboot
[WARN]  Please reboot your machine to activate the changes and avoid data loss.
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
Result: [INFO]  Finding release for channel testing
[INFO]  Using v1.27.2-rc3+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.27.2-rc3+k3s1/sha256sum-amd64.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.27.2-rc3+k3s1/k3s
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Finding available k3s-selinux versions
Checking out tree e7109be...done
Enabled rpm-md repositories: fedora-cisco-openh264 fedora-modular updates-modular updates fedora rancher-k3s-common-testing updates-archive
Updating metadata for 'fedora-cisco-openh264'...done
Updating metadata for 'fedora-modular'...done
Updating metadata for 'updates-modular'...done
Updating metadata for 'updates'...done
Updating metadata for 'fedora'...done
Updating metadata for 'rancher-k3s-common-testing'...done
Updating metadata for 'updates-archive'...done
Importing rpm-md...done
rpm-md repo 'fedora-cisco-openh264'; generated: 2023-03-14T10:56:46Z solvables: 4
rpm-md repo 'fedora-modular'; generated: 2023-04-13T20:30:47Z solvables: 1082
rpm-md repo 'updates-modular'; generated: 2018-02-20T19:18:14Z solvables: 0
rpm-md repo 'updates'; generated: 2023-05-31T17:25:42Z solvables: 13915
rpm-md repo 'fedora'; generated: 2023-04-13T20:37:10Z solvables: 69222
rpm-md repo 'rancher-k3s-common-testing'; generated: 2023-05-25T20:15:06Z solvables: 8
rpm-md repo 'updates-archive'; generated: 2023-05-31T18:06:06Z solvables: 14547
Resolving dependencies...done
Will download: 1 package (21.2 kB)
Downloading from 'rancher-k3s-common-testing'...done
Importing packages...done
Checking out packages...done
Running pre scripts...done
Running post scripts...done
Running posttrans scripts...done
Writing rpmdb...done
Writing OSTree commit...done
Staging deployment...done
Freed: 2.1 MB (pkgcache branches: 0)
Added:
  k3s-selinux-1.3-10.coreos.noarch
Changes queued for next boot. Run "systemctl reboot" to start a reboot
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
 [WARN]  Please reboot your machine to activate the changes and avoid data loss.
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.

ssh: sudo cat /etc/rancher/k3s/k3s.yaml

Error: error received processing command: Process exited with status 1

from k3sup.

adrecord avatar adrecord commented on June 12, 2024

found it.. the k3s install script is defaulting INSTALL_K3S_SKIP_START to true if it's not explicitly set.

        coreos)
            rpm_installer="rpm-ostree"
            # rpm_install_extra_args="--apply-live"
            : "${INSTALL_K3S_SKIP_START:=true}"
            ;;

edit: I looked at the k3sup options, and I'm not seeing how to get k3sup to set that env variable on the install of k3s. Is that possible?

Where k3sup was calling..

ssh: curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='server --tls-san coreos01.adr.net' INSTALL_K3S_CHANNEL='testing' sh -

it should look like..

ssh: curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START='false' INSTALL_K3S_EXEC='server --tls-san coreos01.adr.net' INSTALL_K3S_CHANNEL='testing' sh -

is there any way to call k3sup to make that happen?

Thanks!

from k3sup.

alexellis avatar alexellis commented on June 12, 2024

I think they have INSTALL_K3S_SKIP_START set to true because the logs say that you have to reboot your machine after installing K3s. Is that correct?

Freed: 2.1 MB (pkgcache branches: 0)
Added:
  k3s-selinux-1.3-10.coreos.noarch
Changes queued for next boot. Run "systemctl reboot" to start a reboot
[WARN]  Please reboot your machine to activate the changes and avoid data loss.

If that's the case, you'd still want INSTALL_K3S_SKIP_START to remain as true, because it would fail without the reboot.

from k3sup.

adrecord avatar adrecord commented on June 12, 2024

Perhaps having the node reboot to let systemctl start k3s the way it will on every subsequent reboot is cleaner, but it seems to work just fine without reboot. It also immediately creates the /etc/rancher/k3s/k3s.yaml file that k3sup is looking for to move back to the calling host, which would allow k3sup to complete successfully.

I guess this question is now just a generic question of... is there a way to pass environment variables thru k3sup such that they'll be seen in the environment of the k3s installer?

from k3sup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.