Commit Graph

916 Commits

Author SHA1 Message Date
Brad Davidson
7168f7282c Move IPv4/v6 selection into helpers
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b12cd62935)
2022-05-20 16:39:13 -07:00
Brad Davidson
f5b8f4b46c Use core constants for cert user/group values
Also update cert gen to ensure leaf certs are regenerated if other key fields change.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 99851b0f84)
2022-05-20 16:39:13 -07:00
Brad Davidson
6a83c1e1b0 Fix log spam due to servicelb event recorder namespace conflict
Don't hardcode the event namespace when creating event recorders; some controllers want to create events in other namespaces.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 965d0a08ef)
2022-05-20 16:39:13 -07:00
Brad Davidson
e17ba49641 Support MixedProtocolLBService and clean up Daemonsets on type change.
Also add event support to increase visibility of change events.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 44c53743dd)
2022-05-20 16:39:13 -07:00
Derek Nola
0663681a3d Replace rancher with k3s-io (#5585)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-05-19 15:54:21 -07:00
Hussein Galal
beaed3c5ed [Release-1.22] Add systemd cgroup controller support (#5555)
* Add systemd cgroup controller support

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Drop unnecessary intermediate variable

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2022-05-12 22:20:50 +02:00
Manuel Buil
329b0c3f45 Add "ipFamilyPolicy: PreferDualStack" to have dual-stack ingress support
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-05-04 18:38:23 +02:00
Brad Davidson
8b0b50a5e8 [release-1.22] Fix issue with datastore corruption on cluster-reset (#5517)
* Bump etcd to v3.5.4-k3s1
* Fix issue with datastore corruption on cluster-reset
* Disable unnecessary components during cluster reset

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-04-27 15:11:41 -07:00
Roberto Bonafiglia
e2c3b89ee5 Added default endpoint for IPv6 (#5510)
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-26 09:16:36 -07:00
Derek Nola
aac491c8bd [Release-1.22] Secrets Encryption: Add RetryOnConflict around updating nodes (#5498)
* Add RetryOnConflict around updating nodes

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-04-22 15:02:07 -07:00
Brad Davidson
b7c7a23e0f Fix issue with long-running apiserver endpoints watch (#5479)
Use ListWatch helpers to retry when the watch channel is closed.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-04-21 09:27:54 -07:00
Manuel Buil
d1ee2b6f1b Fix default ipv6 cidr (#5469)
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-04-20 08:41:54 -07:00
Derek Nola
7ea6f13154 [Release-1.22] Add s390x arch support for k3s (#5447)
* netpol: Add dual-stack support

This change allows to define two cluster CIDRs for compatibility with
Kubernetes dual-stuck, with an assumption that two CIDRs are usually
IPv4 and IPv6.

It does that by levearaging changes in out kube-router fork, with the
following downstream release:

https://github.com/k3s-io/kube-router/releases/tag/v1.3.2%2Bk3s

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>

* 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>
Signed-off-by: Derek Nola <derek.nola@suse.com>

* Increase k3s-root version to v0.10.0 which includes s390x support

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

Co-authored-by: Michal Rostecki <vadorovsky@gmail.com>
Co-authored-by: Sakala Venkata Krishna Rohit <rohitsakala@gmail.com>
2022-04-19 14:43:28 -07:00
Michal Rostecki
33d61bdb26 netpol: Add dual-stack support
This change allows to define two cluster CIDRs for compatibility with
Kubernetes dual-stuck, with an assumption that two CIDRs are usually
IPv4 and IPv6.

It does that by levearaging changes in out kube-router fork, with the
following downstream release:

https://github.com/k3s-io/kube-router/releases/tag/v1.3.2%2Bk3s

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2022-04-15 14:23:28 -07:00
Brad Davidson
c33aa20831 Fix issue with RKE2 servers hanging on listing apiserver addresses
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7e447692c5)
2022-04-15 11:15:00 -07:00
Brad Davidson
508a358d49 Print a helpful error when trying to join additional servers but etcd is not in use
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5b2c14b123)
2022-04-15 11:15:00 -07:00
Brad Davidson
8408d19bd6 Use core constants for cert user/group values
Also update cert gen to ensure leaf certs are regenerated if other key fields change.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 99851b0f84)
2022-04-15 11:15:00 -07:00
Brad Davidson
059710df4e Don't print password conversion rate
Avoids divide-by-zero when the password file is empty

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0bf7c09569)
2022-04-15 11:15:00 -07:00
Brad Davidson
70df1cc324 Move the apiserver addresses controller into the etcd package
This controller only needs to run when using managed etcd, so move it in
with the rest of the etcd stuff. This change also modifies the
controller to only watch the Kubernetes service endpoint, instead of
watching all endpoints in the entire cluster.

Fixes an error message revealed by use of a newer grpc client in
Kubernetes 1.24, which logs an error when the Put to etcd failed because
kine doesn't support the etcd Put operation. The controller shouldn't
have been running without etcd in the first place.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f37e7565b8)
2022-04-15 11:15:00 -07:00
Brad Davidson
50390441bb Fix crash on early snapshot
Don't attempt to retrieve snapshot metadata configmap if the apiserver
isn't available. This could be triggered if the cron expression caused a
snapshot to be triggered before the apiserver is up.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 2a429aac65)
2022-04-15 11:15:00 -07:00
Brad Davidson
b61cdce8c6 Allow agents to query non-apiserver supervisors for apiserver endpoints
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 49544e0d49)
2022-04-15 11:15:00 -07:00
Brad Davidson
ff36514249 Add client certificate authentication support to core Authenticator
This is required to make the websocket tunnel server functional on
etcd-only nodes, and will save some code on the RKE2 side once pulled
through.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit af0b496ef3)
2022-04-15 11:15:00 -07:00
Brad Davidson
e0fa2972da Redact datastore and etcd snapshot config from serialization
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e7437d4ad8)
2022-04-15 11:15:00 -07:00
Brad Davidson
856e7efea5 Bump etcd to 3.5.3-k3s1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-04-15 02:00:15 -07:00
Roberto Bonafiglia
c030917272 Fixed flannel backend helper text
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-14 10:44:16 +02:00
Roberto Bonafiglia
d7e7ddf168 Updated wireguard-native options and added log message
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-11 09:54:42 +02:00
Roberto Bonafiglia
e24e6446fd Added new flannel backend to use wireguard from flannel
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-11 09:54:26 +02:00
Euan Kemp
d4a3edf728 Allow using flannel wireguard backend in a custom config
Ideally we'd have fully fleshed out support for it (i.e. #5011), but
that's a potentially breaking change and taking a little while to merge.

This is a much simpler change which won't break anything, but will allow
a "Type": "wireguard" reference in the "--flannel-conf" custom config
file to work.

Signed-off-by: Euan Kemp <euank@euank.com>
2022-04-11 09:53:23 +02:00
Roberto Bonafiglia
15472506e1 Fixed gofmt format
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 12:55:27 +02:00
Roberto Bonafiglia
27264a45cb Fixed included modules
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 11:05:18 +02:00
Roberto Bonafiglia
29a761360b Fixed http URL on etcd
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 10:22:59 +02:00
Roberto Bonafiglia
ba0270c6bc Fixed loadbalancer in case of IPv6 addresses
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 10:22:34 +02:00
Roberto Bonafiglia
80b22ded81 Fixed etcd register
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 10:19:34 +02:00
Roberto Bonafiglia
5df127ec72 Fixed client URL
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 10:19:21 +02:00
Roberto Bonafiglia
a8fdf93e15 Updated localhost address on IPv6 only setup
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 10:18:58 +02:00
Roberto Bonafiglia
44253bcfd4 Fixed etcd URL in case of IPv6 address
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2022-04-05 10:14:35 +02:00
Luther Monson
21fed356e6 Merge pull request #5362 from luthermonson/fix-containerd-npipe-122
[1.22] Wrap containerd.New
2022-03-30 07:36:08 -07:00
Brad Davidson
d499e79e5c Skip setting up client tls when etcd server does not have tls enabled
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-30 01:05:53 -07:00
Luther Monson
4a97a7c8da add a wrapper around the containerd.New call to fix and pass the proper npipe connector
Signed-off-by: Luther Monson <luther.monson@gmail.com>
2022-03-29 18:07:57 -07:00
Brad Davidson
4cc9a48c1b Defragment etcd datastore before clearing alarms
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-28 09:28:13 -07:00
Brad Davidson
b0d715e03e Fix etcd-only secrets encryption rotation
Improve feedback when running secrets-encrypt commands on etcd-only nodes, and
allow etcd-only nodes to properly restart when effecting rotation.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e811689df9)
2022-03-25 14:38:07 -07:00
Brad Davidson
26ddaec248 Ensure that apiserver ready channel checks re-dial every time
Closing idle connections isn't guaranteed to close out a pooled connection to a
loadbalancer endpoint that has been removed. Instead, ensure that requests used
to wait for the apiserver to become ready aren't reused.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-23 13:23:07 -07:00
Brad Davidson
bef28b2ef0 go generate
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-18 23:31:19 -07:00
Brad Davidson
58b65cbeb1 Defer ensuring node passwords on etcd-only nodes during initial cluster bootstrap
This allows secondary etcd nodes to bootstrap the kubelet before an
apiserver joins the cluster. Rancher waits for all the etcd nodes to
come up before adding the control-plane nodes, so this needs to be
handled properly.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 38706eeec0)
2022-03-18 13:24:23 -07:00
Brad Davidson
ff23175968 Update helm-controller
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a93b9b6d53)
2022-03-17 16:01:25 -07:00
Brad Davidson
373977563d Close additional leaked GPRC clients
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-15 18:08:33 -07:00
Brad Davidson
11ac5a87b7 Bootstrap the executor even when the agent is disabled
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f090bf2d5e)
2022-03-15 18:08:33 -07:00
Brad Davidson
e323a85116 Fix etcd-snapshot commands by making setup more consistent.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a7878db17f)
2022-03-15 18:08:33 -07:00
Brad Davidson
3d3a4d08ca Ignore cluster membership errors when reconciling from temp etcd
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 9a48086524)
2022-03-15 18:08:33 -07:00
Brad Davidson
83d858a169 Move temporary etcd startup into etcd module
Reuse the existing etcd library code to start up the temporary etcd
server for bootstrap reconcile. This allows us to do proper
health-checking of the datastore on startup, including handling of
alarms.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e4846c92b4)
2022-03-15 18:08:33 -07:00