Commit Graph

830 Commits (18098ca0d8d628d88886294b6c0d1c17bf949817)

Author SHA1 Message Date
Brad Davidson 18098ca0d8
Fix issue with long-running apiserver endpoints watch (#5480)
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:45 -07:00
Brad Davidson 3b1ae9cd5f 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:28 -07:00
Brad Davidson 66ed08c843 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:28 -07:00
Brad Davidson e7fbd6f18e 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:28 -07:00
Brad Davidson 1930acdb45 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:28 -07:00
Brad Davidson 3b36c7e88b 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:28 -07:00
Brad Davidson 4225c93cd6 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:28 -07:00
Brad Davidson 23f9c0cedc 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:28 -07:00
Brad Davidson 2b39bf2340 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:28 -07:00
Brad Davidson ba7eb6c121 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:28 -07:00
Luther Monson edc77fe05f
Merge pull request #5365 from luthermonson/fix-npipe-engine-121
[engine-1.21] Wrap containerd.New
2022-03-30 07:35:57 -07:00
Brad Davidson f1c323c268 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:06:28 -07:00
Luther Monson 9fafe2f11f 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:09:05 -07:00
Brad Davidson 90ce62ceaa Defragment etcd datastore before clearing alarms
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-28 09:28:24 -07:00
Brad Davidson 5cb2c254e5 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:22 -07:00
Brad Davidson ee772c1074 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:29 -07:00
Brad Davidson 87c4a13554 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:44:06 -07:00
Brad Davidson f8fa57de06 Update helm-controller
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a93b9b6d53)
2022-03-17 16:01:41 -07:00
Brad Davidson 5ba59d98c8 Close additional leaked GPRC clients
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-15 18:09:00 -07:00
Brad Davidson 5580875acb 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:09:00 -07:00
Brad Davidson ad40da3271 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:09:00 -07:00
Brad Davidson cbf8cadb92 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:09:00 -07:00
Brad Davidson 7da7a00f8f 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:09:00 -07:00
Brad Davidson 8d13e68cc5 Add function to clear local alarms on etcd startup
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 555087b9b8)
2022-03-15 18:09:00 -07:00
Brad Davidson f55f09672e Fix adding etcd-only node to existing cluster
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5014c9e0e8)
2022-03-15 18:09:00 -07:00
Brad Davidson ee4c209df9 Remove unnecessary copies of etcdconfig struct
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a1b800f0bf)
2022-03-15 18:09:00 -07:00
Brad Davidson 58fe28b500 Fix cluster bootstrap test
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 54bb65064e)
2022-03-15 18:09:00 -07:00
Brad Davidson a18c38d63d Remove unnecessary copies of runtime struct
Several types contained redundant references to ControlRuntime data. Switch to consistently accessing this via config.Runtime instead.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 2989b8b2c5)
2022-03-15 18:09:00 -07:00
Brian Downs 86559341a4
remove unused code (#5247) 2022-03-09 16:33:16 -07:00
Brian Downs d0be109e7c
add net util funcs (#5244) 2022-03-09 14:26:04 -07:00
Brian Downs 749d157d87
fix function arg call (#5234) (#5235) 2022-03-09 08:00:06 -07:00
Derek Nola 6211a979a9
[Engine-1.21] Populate EtcdConfig in runtime from datastore when etcd is disabled (#5230)
* Populate EtcdConfig in runtime from datastore when etcd is disabled (#5222)

Fixes issue with secrets-encrypt rotate not having any etcd endpoints
available on nodes without a local etcd server.

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

* Revert naming to old Kine

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

Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-08 12:07:18 -08:00
Derek Nola a8e7e287fb
Add `--json` flag for `k3s secrets-encrypt status` (#5127) (#5199)
* Add json flag for secrets-encrypt status

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-03-03 10:25:36 -08:00
Derek Nola b2222d0f0e
Create encryption hash file if it doesn't exist (#5170)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-02-28 09:05:51 -08:00
Brian Downs 343c7ceb6b
add ability to specify etcd snapshot list output format (#5132) (#5181) 2022-02-26 12:29:17 -07:00
Derek Nola 70304e030a
Add server flag to access nonlocal/nondefault k3s server (#5016) (#5055)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-01-31 15:58:05 -08:00
Brad Davidson d3189ad239 Move containerd wait into exported function
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-25 13:10:00 -08:00
Brad Davidson 290fb7484c go generate
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-18 17:38:54 -08:00
Brad Davidson 4b442e7bd3 Update packaged components
Update images and manifests/charts for coredns, local-path-provisioner, traefik, and pause

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-18 17:38:54 -08:00
Manuel Buil 0d76df93ac Allow svclb pod to enable ipv6 forwarding
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-01-18 17:38:54 -08:00
Brad Davidson 53b10471c4 Bump klipper-lb image for arm fix
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-18 17:38:54 -08:00
Manuel Buil 4f1fd7b30f Dual-stack support LB controller
Signed-off-by: Manuel Buil <mbuil@suse.com>
2022-01-18 17:38:54 -08:00
Brian Downs 8755fd45f6
[Engine-1.21] Adds the ability to compress etcd snapshots (#4866) (#4958) 2022-01-18 11:08:54 -07:00
Brad Davidson 8fe79bfe7a Skip CGroup v2 evac when agent is disabled
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-14 13:25:31 -08:00
Derek Nola 43e1f40800
Enable logging on all subcommands (#4921) (#4933)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-01-14 09:21:44 -08:00
Brad Davidson f1f4ad64f3 Move ClusterResetRestore handling ControlConfig setup
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-12 10:46:33 -08:00
Brad Davidson 0a1f013f68 Fix handling of agent-token fallback to token
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-07 10:15:17 -08:00
Brad Davidson 4decce56a3 Fix use of agent creds for secrets-encrypt and config validate
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-01-06 14:17:03 -08:00
Luther Monson 3970bc001a
[engine-1.21] Remove the Vendor Directory (#4825)
* code to remove vendor dir

Signed-off-by: Luther Monson <luther.monson@gmail.com>
2021-12-27 14:32:00 -07:00
Brad Davidson b38ef3a6aa Close etcd clients to avoid leaking GRPC connections
If you don't explicitly close the etcd client when you're done with it,
the GRPC connection hangs around in the background. Normally this is
harmelss, but in the case of the temporary etcd we start up on 2399 to
reconcile bootstrap data, the client will start logging errors
afterwards when the server goes away.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8ad7d141e8)
2021-12-22 12:41:36 -08:00