Commit Graph

1028 Commits

Author SHA1 Message Date
Derek Nola
8784eab7a6 Add new prefer-bundled-bin experimental flag (#6420)
* initial prefer-bundled-bin ci change
* Add startup testlet
* Convert parsing to pflag library
* Fix code validation
* go mod tidy

Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit 0f52088cd3)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-12-02 00:21:01 -08:00
Derek Nola
a64dd933d6 Change secrets-encryption to GA (#6592)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-12-01 12:40:29 -08:00
Manuel Buil
30903ccb5b Fix log for flannelExternalIP use case
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-11-22 16:56:20 +01:00
Manuel Buil
07dc375c82 Remove stuff which belongs in the windows executor implementation
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-11-18 09:46:35 +01:00
Brad Davidson
96bfe8b397 Bump traefik chart to 19.0.4 to fix kubernetes version check
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-14 14:52:08 -08:00
Derek Nola
2ac863c36b Add Secrets Encryption to CriticalArgs
* Add EncryptSecrets to Critical Control Args
* use deep comparison to extract differences

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-11-04 14:22:52 -07:00
Manuel Buil
98d5013b09 Merge pull request #6435 from manuelbuil/addrTypes123
[Release 1.23] Change the priority of address types depending on flannel-external-ip
2022-11-04 16:43:17 +01:00
thomasferrandiz
f927bc0c1b Merge pull request #6438 from thomasferrandiz/log-kube-router-1.23
[Release 1.23] log kube-router version when starting netpol controller
2022-11-04 15:21:35 +01:00
Thomas Ferrandiz
441311ed43 log kube-router version when starting netpol controller
Signed-off-by: Thomas Ferrandiz <thomas.ferrandiz@suse.com>
2022-11-04 11:02:05 +01:00
Manuel Buil
1401b35b96 Change the priority of address types depending on flannel-external-ip
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-11-04 09:10:52 +01:00
Manuel Buil
90800f16a4 Add some helping logs to avoid wrong configs
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-11-04 09:06:55 +01:00
Brad Davidson
8d95fad453 go generate
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
iyear
68821334b0 Fix incorrect defer usage
Problem:
Using defer inside a loop can lead to resource leaks

Solution:
Judge newer file in the separate function

Signed-off-by: iyear <ljyngup@gmail.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Brad Davidson
5828dcbf85 Bump traefik to v2.9.4 / chart v18.3.0
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Petri Kivikangas
df28b12a17 Convert containerd config.toml.tmpl Linux template to v2 syntax
Signed-off-by: Petri Kivikangas <36138+Kitanotori@users.noreply.github.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Brad Davidson
2c8cb2ed97 Set default kubeletPort
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Brad Davidson
2f56136056 Check for RBAC before starting tunnel controllers
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Brad Davidson
0669e12d2d Add GVK lookup to deploy controller
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Brad Davidson
c6c109cf3b Update helm-controller to pull in refactor
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Brad Davidson
36c698abcb Bump Traefik helm chart to v18.0.0
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-11-03 20:56:30 -07:00
Roberto Bonafiglia
64db8d72f9 Update flannel to 0.20.1
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-11-03 15:16:43 -07:00
Brad Davidson
66263ac7f0 Add --flannel-external-ip flag
Using the node external IP address for all CNI traffic is a breaking change from previous versions; we should make it an opt-in for distributed clusters instead of default behavior.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-24 10:12:52 -07:00
Brad Davidson
d5807b6e38 Fix RBAC to allow removal of legacy finalizer
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-20 17:02:21 -07:00
Brad Davidson
206006cc33 Return ProviderID in URI format
The InstancesV1 interface handled this for us by combining the ProviderName and InstanceID values; the new interface requires us to do it manually

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-17 10:26:22 -07:00
Brad Davidson
128b882b69 Add ServiceAccount for svclb pods
For 1.24 and earlier, the svclb pods need a ServiceAccount so that we can allow their sysctls in PSPs

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f25419ca2c)
2022-10-14 16:35:31 -07:00
Derek Nola
39361a8053 [Release-1.23] Replace deprecated ioutil package (#6236)
* check integration test null pointer

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

* Remove rotate retries

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

* Replace ioutil package

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

* Rebase fix

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

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-10-07 19:02:58 -07:00
Brad Davidson
72177d42ca Bump traefik to 2.9.1 / chart 12.0.0
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
d814456e90 Handle custom kubelet port in agent tunnel
The kubelet port can be overridden by users; we shouldn't assume its always 10250

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
dddd06da5c Fix occasional "TLS handshake error" in apiserver network proxy.
We should be reading from the hijacked bufio.ReaderWriter instead of
directly from the net.Conn. There is a race condition where the
underlying http handler may consume bytes from the hijacked request
stream, if it comes in the same packet as the CONNECT header. These
bytes are left in the buffered reader, which we were not using. This was
causing us to occasionally drop a few bytes from the start of the
tunneled connection's client data stream.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
95f216a5b0 Use structured logging instead of logrus for event recorders
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
75303fe579 Disable cloud-node and cloud-node-lifecycle if CCM is disabled
If CCM and ServiceLB are both disabled, don't run the cloud-controller-manager at all;
this should provide the same CLI flag behavior as previous releases, and not create
problems when users disable the CCM but still want ServiceLB.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
d59b8407a7 Move servicelb into cloudprovider LoadBalancer interface
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
53fede31e2 Move DisableServiceLB/Rootless/ServiceLBNamespace into config.Control
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
806a8989e5 Implement InstancesV2 instead of Instances
... and drop legacy ClusterID support.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Brad Davidson
5d9c826133 Bump metrics-server to v0.6.1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-10-07 16:58:35 -07:00
Manuel Buil
be9c26a086 Add flannel-external-ip when there is a k3s node-external-ip
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-09-29 10:05:59 +02:00
Derek Nola
5c5201f724 Remove codespell from Drone, add to GH Actions (#6004)
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit 035c03cfaa)
2022-08-18 13:28:21 -07:00
Roberto Bonafiglia
d04af60aad Updated flannel to v0.19.1
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-08-08 09:58:17 +02:00
Roberto Bonafiglia
c366ee06de Fix comments and add check in case of IPv6 only node
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-08-04 18:47:13 +02:00
Roberto Bonafiglia
b5f2344283 Added NodeIP autodect in case of dualstack connection
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-08-04 18:47:13 +02:00
Vladimir Kochnev
c94dd33012 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:39:34 -07:00
Brad Davidson
4afe65bff5 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:39:34 -07:00
Brad Davidson
15100b5081 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:39:34 -07:00
Brad Davidson
89f4bce6d7 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:39:34 -07:00
Brad Davidson
74d017cda2 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:39:34 -07:00
Derek Nola
3bcd7cee81 [Release-1.23] Update etcd error to match correct url (#5949)
* Update etcd error to match correct url 
* Bump macos version used in GH actions.

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-08-03 20:10:07 -07:00
Derek Nola
313dd6e597 Fix secrets reencryption for 8K+ secrets (#5939)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-08-03 09:10:04 -07:00
Brad Davidson
ea29d624ad 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:42:10 -07:00
Brad Davidson
118f9a9f53 Bump remotedialer
Includes fix for recently identified memory leak.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-12 12:29:04 -07:00
Brad Davidson
beb6e4c8da Fix deletion of svclb DaemonSet when Service is deleted
87e1806697 removed the OwnerReferences
field from the DaemonSet, which makes sense since the Service may now be
in a different namespace than the DaemonSet and cross-namespace owner
references are not supported.  Unfortunately, we were relying on
garbage collection to delete the DameonSet, so this started leaving
orphaned DaemonSets when Services were deleted.

We don't want to add an a Service OnRemove handler, since this will add
finalizers to all Services, not just LoadBalancers services, causing
conformance tests to fail. Instead, manage our own finalizers, and
restore the DaemonSet removal Event that was removed by the same commit.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-07-12 12:28:20 -07:00