Commit Graph

144 Commits

Author SHA1 Message Date
Felix Niederwanger
7e59376bb9
Fix check for (open)SUSE version (#6791)
Fix the check, if we're running SUSE or openSUSE in the installer
script.

Signed-off-by: phoenix <felix.niederwanger@suse.com>
2023-02-06 11:27:12 -08:00
Alexey Vazhnov
870d9c32b0
Fix OpenRC init script error 'openrc-run.sh: source: not found' (#6614)
To avoid error message:

user@server ~ % /etc/init.d/k3s status
/lib/rc/sh/openrc-run.sh: 28: /etc/init.d/k3s: source: not found
/lib/rc/sh/openrc-run.sh: 29: /etc/init.d/k3s: source: not found
 * status: stopped

I've replaced `source` with `sourcex`, defined in https://github.com/OpenRC/openrc/blob/master/sh/openrc-run.sh.in#L30
Classic shell `.` also works.
Tested in Devuan 5 Daedalus (based on Debian 12 bookworm / testing), package `openrc` version 0.45.2-2.

Signed-off-by: Alexey Vazhnov <vazhnov@boot-keys.org>
2023-01-03 14:00:22 -05:00
Derek Nola
d723775792
Remove deprecated flags in v1.26 (#6574)
* Remove NoFlannel
* Remove cluster-secret
* Remove no-deploy
* Remove disable-selinux
* Convert wireguard to fatal error
* Remove reference to no-op K3S_CLUSTER_SECRET

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-12-05 14:01:01 -08:00
Klaas Demter
457e5e7379 Update install.sh to recommend current version of k3s-selinux
Signed-off-by: Klaas Demter <re4il07t@duck.com>
2022-12-05 11:52:33 -08:00
Sakala Venkata Krishna Rohit
4e2e91e089
Switch from Google Buckets to AWS S3 Buckets (#6497)
* Add python pip pakacge to install aws cli

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Upload build artifacts to aws s3 instead of gcp bucket

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Upload logs to aws s3 instead of google buckets

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Replace gcloud auth with aws credentials for artifact uploading to buckets

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Replace usage of google bucket with aws s3 buckets

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>
2022-11-28 19:27:43 +02:00
Roberto Bonafiglia
87c7ea81f0 Updated flannel version to 0.20.1
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-11-03 17:49:26 +01:00
Derek Nola
1deccc9524 remove quotest to match style
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-09-13 11:30:04 -07:00
Derek Nola
71b7e9f763 Add binary skip option
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-09-13 11:12:41 -07:00
Derek Nola
e31e6d6d8e Restore original skip_download behavior
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-09-13 11:05:03 -07:00
Manuel Buil
a6f5a4d3a5 Remove wireguard interfaces when deleting the cluster
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-08-30 14:30:45 +02:00
Derek Nola
2b35f89664
Convert install tests to run PR build of k3s (#6003)
* Convert install tests to run PR version of k3s

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-08-26 09:36:50 -07:00
Brad Davidson
bd5fdfce33 Fix server systemd detection
* Use INVOCATION_ID to detect execution under systemd, since as of a9b5a1933f NOTIFY_SOCKET is now cleared by the server code.
* Set the unit type to notify by default for both server and agent, which is what Rancher-managed installs have done for a while.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-21 13:42:20 -07:00
Manuel Buil
699ae80de0 Remove kube-ipvs0 interface when cleaning up
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-06-06 12:14:06 +02:00
Sakala Venkata Krishna Rohit
3e3549e45c
Add s390x arch support for k3s (#5018)
* Update docs to include s390x arch

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Add s390x drone pipeline

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Install trivy linux arch only for amd64

This is done so that trivy is not installed for s390x arch

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Add s390x arch if condition for Dockerfile.test

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Add s390x arch in install script

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Add s390x GOARCH in build script

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Add SUFFIX s390x in scripts

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Skip image scan for s390x arch

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Update klipper-lb to version v0.3.5

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Update traefik version to v2.6.2

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Update registry to v2.8.1 in tests which supports s390x

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>

* Skip compact tests for s390x arch

This is done because compact test require a previous k3s version which supports s390x and it is not available

Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>
2022-04-15 09:41:40 -07:00
Manuel Buil
def9c99679 Remove the iptables rules from ipmasq flannel
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-02-08 18:55:25 +01:00
Manuel Buil
66780cc665 Remove ip6table rules when cleaning up k3s
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-01-18 08:36:00 +01:00
Jacob Blain Christen
559c8ad94b
install: /usr/sbin/transactional-update (#4403)
- also updated k3s-uninstall.sh on zypper and TU systems
- fix #4409 for Fedora CoreOS

new installer tests via github actions:
- fedora-coreos
- opensuse-microos

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
2021-11-08 16:26:21 -07:00
Adam Majer
f1d6e9bc4b
install.sh: fix path detection for sle-micro (#4398)
transactional-update was always under /usr/sbin.

Signed-off-by: Adam Majer <amajer@suse.de>
2021-11-05 08:39:45 -07:00
Jacob Blain Christen
52eb6cac1c
install.sh: initial support for sle-micro (#4331)
Support invoking install.sh on SLE Micro with or without SELinux
enabled. Same deal for SLES.

Additionally, easy-to-invoke assertions, via Vagrant, that the local
install.sh works correctly:
- tests/install/centos-7 (stand-in for rhel 7)
- tests/install/centos-8 (stand-in for rhel 8)
- tests/install/opensuse-leap (stand-in for sles)
- tests/install/opensuse-microos (stand-in for sle-micro)
- tests/install/ubuntu-focal

Addresses #3188
Addresses #3917

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
2021-10-29 09:47:37 -07:00
Jacob Blain Christen
72a1925a34
install.sh: capture quoted environment variables (#4275)
Leverage posix builtins + grep (with regex matching) to emit quoted
environment variables to K3S_FILE_ENV, e.g.:

```shell
$ export CONTAINERD_TEST_1='one!1' K3S_TEST_2=two K3S_TEST_3='thr ee' TEST_4='!@#$%^&*()_+four!'
$ sh -c export | while read x v; do echo $v; done | grep -E '^(K3S|CONTAINERD)_'
CONTAINERD_TEST_1='one!1'
K3S_TEST_2='two'
K3S_TEST_3='thr ee'
```

Fixes #3395
Addresses rancher/k3os#708

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
2021-10-22 10:45:39 -07:00
Manuel Buil
60cd86bc42
Merge pull request #3906 from manuelbuil/dual-stack
Add dual-stack support on flannel
2021-09-15 18:48:10 +02:00
Nicolas Brechet
e732517712 Retrieve "CONTAINERD_" environment variables
Signed-off-by: Nicolas Brechet <nicolas.brechet@swisscom.com>
2021-09-15 09:37:34 -07:00
Manuel Buil
681058bb40 Add dual-stack support
Signed-off-by: Manuel Buil <mbuil@suse.com>
2021-09-15 11:44:48 +02:00
Brad Davidson
3d27804c77 Anything not EL7 is EL8
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-09-10 12:37:04 -07:00
Jordi Prats
74196acaea
added raspberry installation hint (#2379)
Signed-off-by: Jordi Prats <jordi.prats@gmail.com>
2021-09-01 12:28:15 -07:00
Brad Davidson
84155ee313 Make consistent use of os-release vars
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-08-27 10:30:15 -07:00
Richard Brown
f94d8d76a8 Check /etc/os-release exists before sourcing it
Signed-off-by: Richard Brown <rbrownccb@opensuse.org>
2021-08-26 11:55:27 -07:00
Richard Brown
51b7451709 install.sh: Inform user of current k3s+SELinux support status for SUSE/openSUSE systems
Signed-off-by: Richard Brown <rbrownccb@opensuse.org>
2021-08-26 11:55:27 -07:00
Joakim Roubert
80a15bebc0 install.sh: Use built-in shell functionality instead of awk
If install.sh relies on awk, install.sh malfunctions when run on a
device with a limited environment where awk is not available. This patch
replaces the use of awk with built-in shell script functionality.

Fixes: #3737
Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2021-08-04 12:06:53 -07:00
Manuel Buil
a629db023c Fail to start k3s if nm-cloud-setup is enabled
Signed-off-by: Manuel Buil <mbuil@suse.com>
2021-06-17 12:24:53 +02:00
Brad Davidson
25c2888d28 Fix shell expansion and file permission issues install.sh
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-05-19 19:00:31 -07:00
Brad Davidson
c824c3bcc1 Add support for multiple env files for systemd unit
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-05-17 14:18:40 -07:00
Vegetto
64577a070d fixes #3264 - unmount CSI plugins on uninstall
Signed-off-by: angelnu <git@angelnucom>
2021-05-03 20:05:26 -07:00
Chris Kim
7a10a9971f
Add install script option to force a restart of the K3s service (#3235)
Signed-off-by: Chris Kim <oats87g@gmail.com>
2021-04-27 08:49:03 -07:00
Frederic Crozat
e856ee0e4e Replace which with command -v (#3125)
Remove dependency on which binary, use shell internal equivalent.

Signed-off-by: Frederic Crozat <fcrozat@suse.com>
2021-03-31 14:16:32 -07:00
Martin Norrsken
989b21a0da Remove unit files after disabling, instead of before
Signed-off-by: Martin Norrsken <martin.norrsken@gmail.com>
2021-03-17 10:08:50 -07:00
David Nuzik
c171d4bb07 Update GITHUB_URL
Signed-off-by: David Nuzik <david.nuzik@rancher.com>
2021-03-05 09:34:18 -07:00
JenTing Hsiao
57041f0239
Add codespell CI test and fix codespell error (#2740)
* Add codespell CI test
* Fix codespell error
2020-12-22 12:35:58 -08:00
Brad Davidson
15d03c5930 Fix alternate bindir logic for #2551
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2020-12-04 21:56:22 -08:00
Brian Downs
a7bf00bb9d
Update uninstall script to remove mount point path after umount (#2542)
* update uninstall script to remove mount point path after umount
2020-12-04 20:17:10 -07:00
Vincent Batts
eb3e4c154c
install.sh: support install on Flatcar with no args (#2551)
* install.sh: test if BIN_DIR is readonly, else use /opt

On flatcar /usr is a readonly partition, while /opt is allowed for
writing.

Signed-off-by: Vincent Batts <vbatts@kinvolk.io>

* install.sh: only warn on Flatcar about selinux

This check is a bit more explicit, but only warn about finding the rpm
installed policy when on Flatcar Container Linux

Signed-off-by: Vincent Batts <vbatts@kinvolk.io>

* Update install.sh

Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: Vincent Batts <vbatts@kinvolk.io>

Co-authored-by: Brad Davidson <brad@oatmail.org>
2020-12-04 18:19:01 -08:00
Chris Kim
25d2ce435b
Update install.sh
Change from file check to yum check for uninstall script

Co-authored-by: Jacob Blain Christen <dweomer5@gmail.com>
2020-11-17 09:08:38 -08:00
Chris Kim
66d87698fd Enhance install.sh to help with k3s upgrade and uninstall scenarios for k3s-selinux
Signed-off-by: Chris Kim <oats87g@gmail.com>
2020-11-16 13:57:07 -08:00
Chris Kim
a8275838d5 Add additional conditional logic to install.sh to prevent errors on Fedora or systems when run as non-root
Signed-off-by: Chris Kim <oats87g@gmail.com>
2020-10-29 07:30:03 -07:00
Ranjib Dey
dcff6e7047 remove duplicate systemd directives
Signed-off-by: Ranjib Dey ranjib@linux.com
2020-10-28 14:53:01 -07:00
Chris Kim
38109e6c9d Add auto-install capability to install.sh for k3s-selinux
Signed-off-by: Chris Kim <oats87g@gmail.com>
2020-10-27 14:22:14 -04:00
Kevin Messer
6c9f3d528a
feat(install): replace rpm by yum for setup_selinux (#1829)
It's a bad practice to install packages via rpm directly. It's better to install all packages with Yum/Dnf. It's also possible to install packages directly via an URL, which is the purpose of this PR.
2020-09-26 01:45:33 -07:00
Adam Farden
86d2e2a5f8
[systemd] really wait for network to come online (#1665)
Wants= is required to actually set the dependency on network-online.service
After= is required or k3s.service will be started at the same time as network-online.service

In network environments with slow DHCP, both are required to ensure valid network configuration for k3s

Signed-off-by: Adam Farden <adam@farden.cz>
2020-09-26 01:44:06 -07:00
Matthew Clive
fc55904d82
Add network dependency to installed service file (#2210)
Adds the line `After=network-online.target` to the k3s systemd service
file. This applies the fix mentioned in
[this GH comment](https://github.com/rancher/k3s/issues/1626#issuecomment-642253812)
which I can confirm makes k3s networking survive reboot in Raspbian
Buster.

[It appears, in some docs I found](https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files)
that this is a recommended and usual way of specifying that we need the
target to be _completed_ before starting k3s. Using just the `Wants=`
directive doesn't work for this task, you have to add both directives
at once to do this. Quote:

> `Wants=`: This directive is similar to `Requires=`, but less strict.
> `Systemd` will attempt to start any units listed here when this unit
> is activated. If these units are not found or fail to start, the
> current unit will continue to function. This is the recommended way to
> configure most dependency relationships. **Again, this implies a
> parallel activation unless modified by other directives**

> [...]

> `After=`: The units listed in this directive will be started before
> starting the current unit. This does not imply a dependency
> relationship and **one must be established through the above
> directives if this is required.**

- _(Emphasis mine)_

Signed-off-by: Matthew Clive <arcticlight@arcticlight.me>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2020-09-26 01:42:17 -07:00
Brad Davidson
5ad76043ac Replace unmount read loop with awk
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2020-09-11 10:33:37 -07:00