3.3. Running the LOCKSS Installer
Section Summary
The next task is to run the LOCKSS Installer. The installation process goes through various phases -- checking system prerequisites, configuring firewall and DNS settings, installing the K3s Kubernetes distribution, and testing the K3s node. After the LOCKSS Installer succeeds, you can also optionally run the K3s Configuration Checker.
Note
Commands in this section are run as root
[1].
3.3.1. Invoking the LOCKSS Installer
To start the installation process, run this command as root
[1], relative to the LOCKSS Installer Directory:
scripts/install-lockss
The installer will run through its phases, each of which is described in its own section below from Checking K3s Prerequisites (Section 3.3.2) to Completion of the LOCKSS Installation Process (Section 3.3.10).
Tip
3.3.2. Checking K3s Prerequisites
During this phase, install-lockss will check that certain prerequisites to installing K3s are met. This phase begins with this heading:
Checking K3s prerequisites...
No user interaction is expected; if everything goes well, you will see this message:
[success] K3s prerequisites checked
and install-lockss will successfully proceed to the next phase, Checking the System User and Group (Section 3.3.3).
Error conditions and what to do about them
3.3.3. Checking the System User and Group
During this phase, install-lockss will check that the lockss
user and group exist on the host system. This phase begins with the heading:
Checking the system user and group...
No user interaction is expected; if everything goes well, you will see this message:
[success] System user and group present
and install-lockss will successfully proceed to the next phase, Configuring iptables for K3s (Section 3.3.4).
Error conditions and what to do about them
3.3.4. Configuring iptables for K3s
During this phase, install-lockss will configure iptables to work with K3s, if applicable. This phase begins with the heading:
Configuring iptables for K3s...
In many situations, no configuration of iptables is needed; you will see one of these messages:
[success] Skipping (iptables is not on the PATH nor run via Alternatives)
[success] Skipping (iptables version is older than 1.8.0)
[success] Skipping (iptables version is newer than 1.8.3)
[success] Skipping (iptables is in legacy mode)
[success] Skipping (iptables is not run via Alternatives)
and install-lockss will successfully proceed to the next phase, Configuring firewalld for K3s (Section 3.3.5).
Otherwise, you will receive the following prompt:
Switch iptables to legacy mode via Alternatives?
Enter Y to accept the proposed iptables configuration, or enter N to bypass, or hit Enter to accept the default in square brackets [2]. (You may be prompted for your sudo password.)
Caution
If you choose to bypass the proposed iptables configuration, you will see the warning:
[Warning] Leaving iptables unchanged; see manual for details
and install-lockss will keep going. But K3s may malfunction without further intervention; see Troubleshooting iptables for details.
Error conditions and what to do about them
3.3.5. Configuring firewalld for K3s
During this phase, install-lockss will configure firewalld to work with K3s, if applicable. This phase begins with the heading:
Configuring firewalld for K3s...
In many situations, no configuration of firewalld is needed; you will see one of these messages:
[success] Skipping (firewall-cmd is not on the PATH)
[success] Skipping (firewalld is not running)
and install-lockss will successfully proceed to the next phase, Configuring ufw for K3s (Section 3.3.6).
Otherwise, you will receive the following prompt:
Add 10.42.0.0/16 and 10.43.0.0/16 to firewalld's trusted zone?
Enter Y to accept the proposed firewalld configuration, or enter N to bypass, or hit Enter to accept the default in square brackets [2]. (You may be prompted for your sudo password.)
Caution
If you choose to bypass the proposed firewalld configuration, you will see the warning:
[Warning] Leaving firewalld unchanged; see manual for details
and install-lockss will keep going. But K3s may malfunction without further intervention; see Troubleshooting firewalld for details.
Error conditions and what to do about them
3.3.6. Configuring ufw for K3s
During this phase, install-lockss will configure ufw to work with K3s, if necessary. This phase begins with the heading:
Configuring ufw for K3s...
In many situations, no configuration of firewalld is needed; you will see one of these messages:
[success] Skipping (ufw is not on the PATH)
[success] Skipping (ufw is not active)
and install-lockss will successfully proceed to the next phase, Configuring CoreDNS for K3s (Section 3.3.7).
Otherwise, you will receive the following prompt:
Allow traffic from 10.42.0.0/16 and 10.43.0.0/16 via ufw?
Enter Y to accept the proposed ufw configuration, or enter N to bypass, or hit Enter to accept the default in square brackets [2]. (You may be prompted for your sudo password.)
Caution
If you choose to bypass the proposed ufw configuration, you will see the warning:
[Warning] Leaving ufw unchanged; see manual for details
and install-lockss will keep going. But K3s may malfunction without further intervention. See Troubleshooting ufw for details.
Error conditions and what to do about them
3.3.7. Configuring CoreDNS for K3s
During this phase, install-lockss will configure CoreDNS to work with K3s, if necessary. This phase begins with the heading:
Configuring CoreDNS for K3s...
In many situations, no configuration of firewalld is needed; you will see this message:
[success] Using system resolv.conf files
and install-lockss will successfully proceed to the next phase, Installing K3s (Section 3.3.8).
Otherwise [4], you will receive a message including CoreDNS does not allow a loopback address to be given to Kubernetes pods as an upstream DNS server
, and the following prompt:
IP address(es) of DNS resolvers, separated by ';'
Enter a semicolon-separated list of DNS server IP addresses that are not loopback addresses. A suggested value will be offered to you in square brackets, consisting of non-loopback IP addresses collected from your machine's DNS configuration; you can simply hit Enter to accept the suggested value [3].
Error conditions and what to do about them
3.3.8. Installing K3s
During this phase, install-lockss will install K3s 1.21.5+k3s1, if applicable. This phase begins with the heading:
Installing K3s...
This phase consists of these steps:
First, install-lockss will determine if K3s 1.21.5+k3s1 needs to be installed:
If K3s is not present, install-lockss will display
K3s is not present
, and will install K3s 1.21.5+k3s1 in the next step.If an older version of K3s is present, install-lockss will display
Detected K3s version <installed version of K3s> is older than expected version <target version of K3s>
, and you will receive the following prompt:Upgrade K3s from <installed version of K3s> to <target version of K3s>?
Enter Y and install-lockss will install K3s 1.21.5+k3s1 in the next step, or enter N and install-lockss will not install K3s 1.21.5+k3s1 in the next step, or hit Enter to accept the default in square brackets [2].
If the expected version of K3s is already present, install-lockss will display
K3s version <installed version of K3s> is already installed; skipping
, and will not install K3s 1.21.5+k3s1 in the next step.If a more recent version of K3s is present, install-lockss will display
Detected K3s version <installed version of K3s> is more recent than expected version <target version of K3s>
, and will not install K3s 1.21.5+k3s1 in the next step.If K3s is detected but the installed and expected version numbers cannot be compared automatically, install-lockss will display
[Warning] Detected K3s version <installed version of K3s>, expected version <target version of K3s>, comparison failure, skipping
, and install-lockss will not install K3s in the next step.
If install-lockss determined in the previous step that it will not install K3s 1.21.5+k3s1, you will see the confirmation
Not installing K3s
, and nothing will happen in this step.But if install-lockss determined in the previous step that it will install K3s 1.21.5+k3s1, you will see the confirmation
Installing K3s version <target version of K3s>
, and this step will proceed as follows:First, install-lockss will ask you to specify the K3s state data directory (the directory K3s uses to store state data), with this prompt:
K3s state data directory
By default, this is
/var/lib/rancher/k3s
. However, if/var
is space-limited, you should specify a different directory that has ample space, and is not backed by NFS or by XFS with legacyftype=0
.Enter a suitable directory path for the K3s state data directory, or hit Enter to accept the default in square brackets [3] [5].
Then install-lockss will attempt to determine the filesystem type of the specified K3s state data directory. In many situations, it will simply display the filesystem type in a message similar to this (for example,
<filesystem type>
might beext4
):Filesystem type of <path of K3s state data directory> (<mountpoint of K3s state data directory>) is <filesystem type>; proceeding
Error conditions and warnings, and what to do about them
Then install-lockss will download the K3s Installer from https://get.k3s.io/ and invoke it with suitable options. This may take several minutes, during which the output to the console will be from the K3s Installer, not from install-lockss.
Depending on your operating system and other factors, the K3s Installer may install additional software packages or configure system components, using sudo if necessary (which may prompt for the user's sudo password).
Error conditions and what to do about them
Finally, whether or not K3s was installed, install-lockss will store Kubernetes configuration data as the
lockss
user in the fileconfig/k8s.cfg
(relative to the LOCKSS Installer Directory).Error conditions and what to do about them
3.3.9. Testing the K3s Node
During this phase, install-lockss runs a series of tests to verify that the K3s node is operational. This phase begins with the heading:
Testing the K3s node...
No user interaction is expected. If all tests pass, you will see the message:
[success] Tested the K3s node
and install-lockss will successfully proceed to the next phase, Completion of the LOCKSS Installation Process (Section 3.3.10).
Otherwise, you will see an error message corresponding to the test that did not pass, and install-lockss will fail.
Error conditions and what to do about them
3.3.10. Completion of the LOCKSS Installation Process
If all phases completed successfully, you will see the message:
[success] Successful completion of the LOCKSS installation process
and install-lockss will terminate.
3.3.11. Checking the K3s Configuration
Tip
This section is optional.
K3s comes with k3s check-config, a configuration checker tool. The K3s configuration checker is capable of detecting complex underlying system situations that definitely require fixing (or applications running in the K3s cluster will not be able to function properly). On the other hand, the versions of the K3s configuration checker available at the time LOCKSS 2.0-beta1 was released contained bugs that reported spurious issues that are either inaccurate or moot. As a result, we have decided against running k3s check-config as part of install-lockss at this time, to avoid unnecessary interruptions in the installation of the LOCKSS system in many cases where there is no particular cause for concern.
That being said, we still recommend running k3s check-config and interpreting the results using the Troubleshooting the K3s Configuration Checker section of the manual:
Run this command:
k3s check-config
The following error messages in the output are indicative of system situations that require attention:
/usr/sbin iptables v1.8.2 (nf_tables): should be older than v1.8.0, newer than v1.8.3, or in legacy mode (fail)
RHEL7/CentOS7: User namespaces disabled; add 'user_namespace.enable=1' to boot command line (fail)
apparmor: enabled, but apparmor_parser missing (fail)
Troubleshooting
See Troubleshooting the K3s Configuration Checker for details.
The following error messages in the output can be ignored:
cgroup hierarchy: nonexistent?? (fail) (see https://github.com/tianon/cgroupfs-mount)
links: aux/ip6tables should link to iptables-detect.sh (fail) links: aux/ip6tables-restore should link to iptables-detect.sh (fail) links: aux/ip6tables-save should link to iptables-detect.sh (fail) links: aux/iptables should link to iptables-detect.sh (fail) links: aux/iptables-restore should link to iptables-detect.sh (fail) links: aux/iptables-save should link to iptables-detect.sh (fail)
swap: should be disabled
CONFIG_INET_XFRM_MODE_TRANSPORT: missing
Troubleshooting
See Troubleshooting the K3s Configuration Checker for details.
For other error messages, check the official K3s documentation, search for K3s issues database on GitHub or the Web for resources matching your error message or operating system, and/or contact us so we can help investigate and document for future reference.
Footnotes