Commit Graph

2255 Commits (bdb35433c59503de752640cec406cf2e882fa9fb)

Author SHA1 Message Date
Roberto Bonafiglia bdb35433c5 Added NodeIP autodect in case of dualstack connection
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-08-04 18:47:30 +02:00
Manuel Buil cab1822b31 Check if user has a correct cluster-cidr and service-cidr config
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-08-04 18:47:30 +02:00
Michal Rostecki d426f13034 agent(netpol): Explicitly enable IPv4 when necessary
Before this change, kube-router was always assuming that IPv4 is
enabled, which is not the case in IPv6-only clusters. To enable network
policies in IPv6-only, we need to explicitly let kube-router know when
to disable IPv4.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2022-08-04 18:47:30 +02:00
Brad Davidson e48a53ed44 Bump minio to v7.0.33
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 43508341c1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Vladimir Kochnev 4e72947f4a Save agent token to /var/lib/rancher/k3s/server/agent-token
Having separate tokens for server and agent nodes is a nice feature.

However, passing server's plain `K3S_AGENT_TOKEN` value
to `k3s agent --token` without CA hash is insecure when CA is
self-signed, and k3s warns about it in the logs:

```
Cluster CA certificate is not trusted by the host CA bundle, but the token does not include a CA hash.
Use the full token from the server's node-token file to enable Cluster CA validation.
```

Okay so I need CA hash but where should I get it?

This commit attempts to fix this issue by saving agent token value to
`agent-token` file with CA hash appended.

Signed-off-by: Vladimir Kochnev <hashtable@yandex.ru>
(cherry picked from commit 13af0b1d88)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Brad Davidson ac600f9d64 Bump dynamiclistener to fix issue with cert expiration
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 049004455a)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Brad Davidson b8ac2ea3b1 Replace getLocalhostIP with Loopback helper method
Requires tweaking existing method signature to allow specifying whether or not IPv6 addresses should be return URL-safe.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5eaa0a9422)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Brad Davidson ff8c0e9632 Add service-cluster-ip-range to controller-manager args
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 84fb8787f2)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Brad Davidson 07c436a643 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>
(cherry picked from commit bd5fdfce33)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Brad Davidson 8c12864880 Raise etcd connection test timeout to 30 seconds
Addressess issue where the compact may take more than 10 seconds on slower disks. These disks probably aren't really suitable for etcd, but apparently run fine otherwise.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 1674b9d640)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Dirk Müller 42c019ee01 update rootlesskit to 1.0.1
This avoids an issue with u-root 7.0.0 which has been retracted by the
author:

  $ go list -u -m all
  $ go list -m: github.com/u-root/u-root@v7.0.0+incompatible: retracted by module author: Published v7 too early (before migrating to go modules)

Signed-off-by: Dirk Müller <dirk@dmllr.de>
(cherry picked from commit 93ca992cdb)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-08-04 09:40:01 -07:00
Derek Nola adca91ddfe
[Release-1.22] Update etcd error to match correct url (#5950)
* Update etcd error to match correct url 
* Bump macos version used by GH actions

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-08-03 20:10:55 -07:00
Derek Nola 484085c525
Fix secrets reencryption for 8K+ secrets (#5938)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-08-03 09:10:14 -07:00
Nikolai Shields 17b9454cf0
Update to v1.22.12 (#5872)
Signed-off-by: Nikolai Shields <nikolai@nikolaishields.com>
2022-07-15 02:16:59 -05:00
Brad Davidson 4dfa077ff3 Address issues with etcd snapshots
* Increase the default snapshot timeout. The timeout is not currently
  configurable from Rancher, and larger clusters are frequently seeing
  uploads fail at 30 seconds.
* Enable compression for scheduled snapshots if enabled on the
  command-line. The CLI flag was not being passed into the etcd config.
* Only set the S3 content-type to application/zip if the file is zipped.
* Don't run more than one snapshot at once, to prevent misconfigured
  etcd snapshot cron schedules from stacking up.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-12 14:43:19 -07:00
Brad Davidson abd7770ce6 Bump runc version to v1.1.3
Includes fix for ENOSYS/EPERM issue on s390x.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-12 12:29:43 -07:00
Brad Davidson ea615fb033 Bump remotedialer
Includes fix for recently identified memory leak.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-12 12:29:43 -07:00
Brad Davidson e3cf461cca Remove legacy bidirectional datastore sync code
Since #4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-12 12:10:56 -07:00
Brad Davidson ab2b0a5a80 Fix fatal error when reconciling bootstrap data
Properly skip restoring bootstrap data for files that don't have a path
set because the feature that would set it isn't enabled.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-12 12:10:56 -07:00
Brad Davidson 688b180542 Handle empty entries in bootstrap path map
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 3cebde924b)
2022-07-12 12:10:56 -07:00
Brad Davidson 1c85a69e33 Bump kine to v0.9.3
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-01 11:17:31 -07:00
Brad Davidson 54305e2939 Don't crash when service IPFamiliyPolicy is not set
Service.Spec.IPFamilyPolicy may be a nil pointer on freshly upgraded clusters.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-01 11:17:31 -07:00
Brad Davidson 7c86b407a0 Fix egress selector proxy/bind-address support
Use same kubelet-preferred-address-types setting as RKE2 to improve reliability of the egress selector when using a HTTP proxy. Also, use BindAddressOrLoopback to ensure that the correct supervisor address is used when --bind-address is set.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-01 11:17:31 -07:00
Brad Davidson 6dcb01cde4 Add tests for down-level etcd join
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-30 11:57:58 -07:00
Brad Davidson f81efd83c9 Handle egress-selector-mode change during upgrade
Properly handle unset egress-selector-mode from existing servers during cluster upgrade.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-30 11:57:58 -07:00
Derek Nola 7be6633857
[Release-1.22] Remove k3s-io fork of containerd/continuity (#5776)
* Move to fixed version of continuity

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-06-30 08:56:30 -07:00
Derek Nola fd4910af07
Remove old powershell dependency (#5779)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-06-28 14:52:16 -07:00
Derek Nola a58d9f6a70
[Release-1.22] Testing Directory rework and cert rotation test (#5761)
* Testing directory rework
* New cert rotation test
* Remove unnecessary e2e go.mod
* Move cgroup and install tests out of the vagrant directory
* Remove unit test from Drone

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-06-28 10:37:41 -07:00
Nikolai Shields bb0cdd929a
Merge pull request #5752 from galal-hussein/v1.22.11-k3s1
Update to v1.22.11-k3s1
2022-06-22 13:03:21 -05:00
galal-hussein cb9143dfb1 Update to v1.22.11
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2022-06-22 00:15:13 +02:00
Brad Davidson 8e35299b41 Bump helm-controller
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-16 14:40:29 -07:00
Roberto Bonafiglia 6856e6f07b
Merge pull request #5722 from rbrtbnfgl/release1.22-flannelupdate
[Release 1.22] Flannel version update to 0.18.1 and added the ability to configure additional options for wireguard backend
2022-06-16 11:31:18 +02:00
Roberto Bonafiglia 6155a17f31 Update flannel to 0.18.1
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-06-16 10:02:57 +02:00
Sjoerd Simons 94dbfebfc2 Add ability to pass configuration options to flannel backend
Allow the flannel backend to be specified as
backend=option=val,option2=val2 to select a given backend with extra options.

In particular this adds the following options to wireguard-native
backend:
* Mode - flannel wireguard tunnel mode
* PersistentKeepaliveInterval- wireguard persistent keepalive interval

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-06-16 10:02:12 +02:00
Brad Davidson be4b14e501 Only listen on loopback when resetting
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-15 14:28:01 -07:00
Derek Nola c9a44790e1
Delay service readiness until after startuphooks have finished (#5724)
* Move startup hooks wg into a runtime pointer, check before notifying systemd
* Switch default systemd notification to server
* Add 1 sec delay to allow etcd to write to disk
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-06-15 13:45:26 -07:00
Brad Davidson edd2fb9535 Ensure that CONTAINERD_ variables are not shadowed by later entries
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-15 10:58:29 -07:00
Brad Davidson 71cb8994fd Sanitize filenames for use in configmap keys
If the user points S3 backups at a bucket containing other files, those
file names may not be valid configmap keys.

For example, RKE1 generates backup files with names like
`s3-c-zrjnb-rs-6hxpk_2022-05-05T12:05:15Z.zip`; the semicolons in the
timestamp portion of the name are not allowed for use in configmap keys.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-15 10:55:58 -07:00
Brad Davidson 952f068a70 Disable urfave markdown/man docs generation
From https://github.com/urfave/cli/pull/1383 :
> This removes the resulting binary dependency on cpuguy83/md2man and
> russross/blackfriday (and a few more packages imported by those),
> which saves more than 400 KB (more than 300 KB
> once stripped) from the resulting binary.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-15 10:54:01 -07:00
Manuel Buil bf272ab137
Merge pull request #5684 from manuelbuil/flannelCNIconf122
[Release 1.22] Add FlannelConfCNI flag
2022-06-15 10:18:39 +02:00
Manuel Buil 4045f026eb
Merge pull request #5679 from manuelbuil/ipvs0-if-remove-122
[Release 1.22] Remove kube-ipvs0 interface when cleaning up
2022-06-15 10:17:49 +02:00
Derek Nola 74c940ddc3
[Release-1.22] Integration and E2E test improvements (#5685)
* Integration Test: Startup (#5630)

* New startup integration test
* Add testing section to PR template
* Move helper functions to direct k8s client calls

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

* E2E Improvements and groundwork for test-pad tool (#5593)

* Add rancher install sript, taints to cp/etcd roles
* Revert back to generic/ubuntu2004, libvirt networking is unreliable on opensuse
* Added support for alpine
* Rancher deployment script
* Refactor installType into function
* Cleanup splitserver test
Signed-off-by: Derek Nola <derek.nola@suse.com>

* E2E: Dualstack test (#5617)

* E2E dualstack test
* Improve testing documentation

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

* Fix import

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-06-14 17:51:20 -07:00
Derek Nola dd3485c202
add support for pprof server (#5527) (#5691)
Signed-off-by: igor <igor@igor.io>
Signed-off-by: Derek Nola <derek.nola@suse.com>

Co-authored-by: Igor <igorwwwwwwwwwwwwwwwwwwww@users.noreply.github.com>
2022-06-14 17:50:21 -07:00
Manuel Buil 05592ad015 Add FlannelConfCNI flag
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-06-14 10:27:22 +02:00
Manuel Buil e6e2fdaf51 Remove kube-ipvs0 interface when cleaning up
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-06-14 10:18:43 +02:00
Brad Davidson b004f4d578 Set default egress-selector-mode to agent
... until QA flakes can be addressed.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-10 10:14:51 -07:00
Brad Davidson bc726e2cba Remove control-plane egress context and fix agent mode.
The control-plane context handles requests outside the cluster and
should not be sent to the proxy.

In agent mode, we don't watch pods and just direct-dial any request for
a non-node address, which is the original behavior.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-10 10:14:51 -07:00
Brad Davidson 28eb743905 Refactor egress-selector pods mode to watch pods
Watching pods appears to be the most reliable way to ensure that the
proxy routes and authorizes connections.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-08 09:35:56 -07:00
Brad Davidson 571e4812db Bump containerd and runc
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-06-07 13:40:28 -07:00
Hussein Galal 8dc262ead8
Update to v1.22.10 (#5612)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2022-05-26 01:34:23 +02:00