Commit Graph

2054 Commits

Author SHA1 Message Date
Derek Nola ccb09f627a
Delay service readiness until after startuphooks have finished (#5736)
* 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-16 08:22:42 -07:00
Derek Nola dbb0811766
[Engine-1.21] Update Kubernetes to v1.21.12 (#5501)
* Update to v1.21.12

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

* Update tags to k3s-io for v1.21.12

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-04-24 22:25:09 -07:00
Derek Nola 51a7692e33
[Engine-1.21] Secrets Encryption: Add RetryOnConflict around updating nodes (#5496)
* Add RetryOnConflict around updating nodes

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-04-22 13:45:31 -07:00
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
Brad Davidson 5d4e9d5e8f update trivy to 0.25.3 (#5426)
(cherry picked from commit 0a5e0b6cbf)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
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 3a8910f0b4 Update Kubernetes to v1.21.11-k3s1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-18 14:03:01 -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 a05c3db6d6 Disable ineffassign CI plugin for excessive false positives
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 3531df3f31)
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
Brad Davidson 171dd09d79 Bump containerd to v1.4.13-k3s1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-03-15 15:03:26 -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
Hussein Galal b4e50c29c7
Update to v1.21.10 (#5150)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2022-02-22 21:36:30 +02:00
Brad Davidson 1f529b5161 Update Wrangler to resolve issue with deleting owned resources.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-02-11 15:52:11 -08: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
Derek Nola 3b3d2d222b
[Engine-1.21] Update to v1.21.9 (#5005)
* Backport #4861

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

* Update tags to k3s-io for v1.21.9

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-01-25 09:16:20 -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 fbacc9c42a Fix CRD version lookup
Backport CRD lookup fix from a5355f0827

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