Commit Graph

1162 Commits

Author SHA1 Message Date
Simon Kirsten
dc12bf1a1f Add support for {{ template "base" . }} in etc/containerd/config.toml.tmpl (#7991)
Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc247a0)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-08-04 16:09:40 -07:00
Derek Nola
60bd5c5b3f [Release-1.26] August Test Backports (#8126)
* Unit test for MustFindString (#8013)
* Consolidate CopyFile functions (#8079)
* Remove unnecessary E2E envs
* Cleanup unnecessary "sudo" in commands
* Add additonal s3 coverage clause

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-08-04 11:39:01 -07:00
Vitor
2b42d881ed Fixed the etcd retention to delete orphaned snapshots
Signed-off-by: Vitor <vitor.savian@suse.com>
2023-08-04 10:31:46 -03:00
Manuel Buil
a1ff4612e8 Fix tailscale bug with ip modes
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-08-02 11:43:08 +02:00
Derek Nola
f46b378422 Adjust default kubeconfig file permissions (#7983)
* Adjust default kubeconfig permissions

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-07-15 10:51:05 -07:00
Derek Nola
6c6745b15e Generation of certificates and keys for etcd gated if etcd is disabled. (#7944)
Problem:
When support for etcd was added in 3957142, generation of certificates and keys for etcd was not gated behind use of managed etcd.
Keys are generated and distributed across servers even if managed etcd is not enabled.

Solution:
Allow generation of certificates and keys only if managed etc is enabled. Check config.DisableETCD flag.

Signed-off-by: Bartossh <lenartconsulting@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Bartosz Lenart <lenart.consulting@gmail.com>
2023-07-11 14:43:25 -07:00
Vitor Savian
e200425876 Adding cli to custom klipper helm image (#7682)
Adding cli to custom klipper helm image

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
(cherry picked from commit 0809187cff)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-07-07 16:28:01 -07:00
Brad Davidson
49b549e270 Fall back to basic/bearer auth when node identity auth is rejected
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7f50b40cfe)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-07-07 13:18:45 -07:00
LeiLei
a704a12e23 Add --data-dir to the k3s certificate rotate-ca cli (#7791)
Need to add a cli flag for this. Also, should probably have config file loading support for the certificate commands.

Signed-off-by: leilei.zhai <leilei.zhai@qingteng.cn>
(cherry picked from commit 72d50b1f7c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-07-07 13:18:45 -07:00
Derek Nola
87cb16e618 Fix rootless node password (#7901)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-07-07 13:13:00 -07:00
Denys Smirnov
729ce73fca Support setting control server URL for Tailscale.
This change enables the use of Headscale - open source implementation of the Tailscale control server.

Signed-off-by: Denys Smirnov <dennwc@pm.me>
2023-07-07 12:30:43 +02:00
Manuel Buil
3ee5c0c39d Check if we are on ipv4, ipv6 or dualStack when doing tailscale
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-07-06 11:12:30 +02:00
Derek Nola
6afe691c62 Allow k3s to customize apiServerPort on helm-controller (#7874)
Signed-off-by: Daishan Peng <daishan@acorn.io>
Co-authored-by: Daishan Peng <daishan@acorn.io>
2023-07-05 14:50:06 -07:00
Manuel Buil
e62e7bce77 Merge pull request #7859 from manuelbuil/fixSpell126
[Release 1.26] Fix code spell check
2023-07-05 10:37:42 +02:00
Manuel Buil
d4b1768457 Fix code spell check
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-07-04 15:53:03 +02:00
Manuel Buil
5eef543d65 Remove file_windows.go
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-07-04 12:46:27 +02:00
Manuel Buil
f3b08c3863 [Release 1.26] Fix logging and cleanup in Tailscale (#7782) 2023-06-14 13:23:30 -07:00
Brad Davidson
86ce8e3586 Enable containerd aufs/devmapper/zfs snapshotter plugins
These were unintentionally dropped when moving containerd back into the main multicall binary

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e5e1a674ce)
2023-06-12 10:53:09 -07:00
Brad Davidson
3592729e03 Improve error response logging
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5170bc5a04)
2023-06-12 10:53:09 -07:00
Brad Davidson
725aaa94e7 Soft-fail on node password verification if the secret cannot be created
Allows nodes to join the cluster during a webhook outage. This also
enhances auditability by creating Kubernetes events for the deferred
verification.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 45d8c1a1a2)
2023-06-12 10:53:09 -07:00
Yuxing Deng
a11bd346db Make LB image configurable when compiling k3s
It is no way we can configure the lb image because it is a const value.
It would be better that we make it variable value and we can override
the value like the `helm-controller` job image when compiling k3s/rke2

Signed-off-by: Yuxing Deng <jxfa0043379@hotmail.com>
(cherry picked from commit b64a226ebd)
2023-06-12 10:53:09 -07:00
Brad Davidson
1853afe124 Create new kubeconfig for supervisor use
Only actual admin actions should use the admin kubeconfig; everything done by the supervisor/deploy/helm controllers will now use a distinct account for audit purposes.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 64a5f58f1e)
2023-06-12 10:53:09 -07:00
Brad Davidson
46631ef963 Use distinct clients for supervisor, deploy, and helm controllers
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8748813a61)
2023-06-12 10:53:09 -07:00
Brad Davidson
926d8d9122 Bump metrics-server to v0.6.3 and update tls-cipher-suites
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e9958cf070)
2023-06-12 10:53:09 -07:00
Brad Davidson
cbf8535302 Bump klipper-lb to v0.4.4
Fixes issue with localhost access to ServiceLB when
ExternalTrafficPolicy=Local

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 93279d2f59)
2023-06-12 10:53:09 -07:00
Andrew Roffey
250a9e0035 allow coredns override extensions
Signed-off-by: Andrew Roffey <andrew@roffey.au>
(cherry picked from commit 0485a56f33)
2023-06-12 10:53:09 -07:00
Manuel Buil
ab07b36ccd VPN PoC
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-06-09 19:11:36 +02:00
Derek Nola
8988439e52 [Release-1.26] E2E and Dep Backports - June (#7693)
* Bump docker go.mod (#7681)
* Shortcircuit commands with version or help flags (#7683)
* Fix for longhorn integration test
* Add Rotation certification Check (#7097)
* Add Certification Test to Validate Cluster
* Fix to stop/start for k3s certificate rotation
* E2E: Use sudo for all RunCmdOnNode
* Remove unnecessary daemonset addition/deletion

Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: est-suse <esteban.esquivel@suse.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Co-authored-by: Esteban Esquivel Alvarado <esteban.alvarado@suse.com>
Co-authored-by: est-suse <esteban.esquivel@suse.com>
Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2023-06-08 15:05:30 -07:00
Manuel Buil
2b838e695d Wrap error stating that it is coming from netpol
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-05-15 09:43:49 +02:00
Brad Davidson
8312c171b2 Bump helm-controller version for repo auth/ca support
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-05-10 17:37:14 -07:00
Brad Davidson
03a3470193 Consistently use constant-time comparison of password hashes
As per https://github.com/golang/go/issues/47001 even subtle.ConstantTimeCompare should never be used with variable-length inputs, as it will return 0 if the lengths do not match. Switch to consistently using constant-time comparisons of hashes for password checks to avoid any possible side-channel leaks that could be combined with other vectors to discover password lengths.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 239021e759)
2023-05-10 17:37:14 -07:00
Brad Davidson
f14d33c471 Fail to validate server tokens that use bootstrap id/secret format
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit cf9ebb3259)
2023-05-10 17:37:14 -07:00
Brad Davidson
8159076d7e Bump cni plugins to v1.2.0-k3s1
Also add bandwidth and firewall plugins. The bandwidth plugin is
automatically registered with the appropriate capability, but the
firewall plugin must be configured by the user if they want to use it.

Ref: https://www.cni.dev/plugins/current/meta/firewall/

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit cedefeff24)
2023-05-10 17:37:14 -07:00
Brad Davidson
173a5b9131 Fix MemberList error handling and incorrect etcd-arg passthrough
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e61fde93c1)
2023-05-10 17:37:14 -07:00
Brad Davidson
705adedd1b Retry cluster join on "too many learners" error
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 91afb38799)
2023-05-10 17:37:14 -07:00
Brad Davidson
82a403a0c2 Fix stack log on panic
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f1b6a3549c)
2023-05-10 17:37:14 -07:00
Brad Davidson
bdd210e785 Fix race condition in tunnel server startup
Several places in the code used a 5-second retry loop to wait on
Runtime.Core to be set. This caused a race condition where OnChange
handlers could be added after the Wrangler shared informers were already
started. When this happened, the handlers were never called because the
shared informers they relied upon were not started.

Fix that by requiring anything that waits on Runtime.Core to run from a
cluster controller startup hook that is guaranteed to be called before
the shared informers are started, instead of just firing it off in a
goroutine that retries until it is set.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c44d33d29b)
2023-05-10 17:37:14 -07:00
Brad Davidson
14ebfa814f Improve egress selector handling on agentless servers
Don't set up the agent tunnel authorizer on agentless servers, and warn when agentless servers won't have a way to reach in-cluster endpoints.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 31a6386994)
2023-05-10 17:37:14 -07:00
Brad Davidson
fd77c076a1 go generate
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0247794aa9)
2023-05-10 17:37:14 -07:00
Brad Davidson
0861ce2d97 Create CRDs with schema
Fixes an issue where CRDs were being created without schema, allowing
resources with invalid content to be created, later stalling the
controller ListWatch event channel when the invalid resources could not
be deserialized.

This also requires moving Addon GVK tracking from a status field to
an annotation, as the GroupVersionKind type has special handling
internal to Kubernetes that prevents it from being serialized to the CRD
when schema validation is enabled.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit ad41fb8c96)
2023-05-10 17:37:14 -07:00
Brad Davidson
7ece0d9599 Bump containerd to v1.7.0 and move back into multicall binary
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-05-10 14:57:53 -07:00
Derek Nola
c206088d20 local-storage: Fix permission (#7217) (#7474)
* local-storage: Fix permission

/var/lib/rancher/k3s/storage/ should be 700
/var/lib/rancher/k3s/storage/* should be 777

Fixes #2348



* Fix pod command field type

* Fix to int test



---------

Signed-off-by: Boleyn Su <boleyn.su@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Boleyn Su <boleyn.su@gmail.com>
Co-authored-by: Brad Davidson <brad@oatmail.org>
2023-05-10 11:08:38 -07:00
thomasferrandiz
ef0b820ef2 Merge pull request #7360 from thomasferrandiz/backport-1.26-netpol-log-level
[release-1.26] ensure that klog verbosity is set to the same level as logrus
2023-05-10 15:01:32 +02:00
Manuel Buil
b8619527a2 Migrate netutil methods into /utils/net.go
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-05-05 07:23:41 +02:00
Derek Nola
5ddb3ccaff [Release-1.26] CLI + Config Enhancement (#7403)
* Handle multiple arguments with StringSlice flags (#7380)
* Cleanup server setup with util function

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Enable FindString to search dotD config files (#7323)
* Address multiple arg cases

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-05-02 15:09:35 -07:00
Thomas Ferrandiz
0b256f08d9 ensure that klog verbosity is set to the same level as logrus
by repeatedly settting it every second during k3s startup

Signed-off-by: Thomas Ferrandiz <thomas.ferrandiz@suse.com>
2023-04-27 08:11:38 +00:00
Hussein Galal
30638072c9 Update klipper lb to v0.4.2 (#7210)
* Update klipper lb to v0.4.2

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Update klipper lb to v0.4.3

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Update klipper lb to v0.4.3 in airgap list

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2023-04-06 19:02:00 +02:00
Roberto Bonafiglia
3e3512bdae Updated kube-route version to move the iptables ACCEPT default rule at the end of the chain
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2023-04-06 09:55:34 +02:00
Brad Davidson
d95980bba3 Lock bootstrap data with empty key to prevent conflicts
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-04-05 10:56:57 -07:00
Brad Davidson
2992477c4b Debounce kubernetes service endpoint updates
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-04-04 12:02:22 -07:00