Commit Graph

625 Commits

Author SHA1 Message Date
Brian Downs
b60ee806f5 add nodeName to etcd struct, update refs
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:53:13 -07:00
Brian Downs
a1220f7fc7 Add ability for node to save etcd snapshot state at start.
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:52:49 -07:00
Brian Downs
a74fb99037 Update snapshot local and S3 logic and supporting code.
* Add the collection of the snapshots to the retry logic.
* Remove node specific entries and collected entries to maps and
  update the config map.
* Add node-name flag to the etcd-snapshot command and set in ENV.

Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:52:16 -07:00
Brian Downs
86ecb79716 remove dirs from snapshot listing
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:52:11 -07:00
Brian Downs
2ca14a331e remove unnecessary prefix:
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:52:04 -07:00
Brian Downs
a711f6a365 export needed function to create core factory
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:57 -07:00
Brian Downs
62bbef7253 update struct field doc comment and get basename on s3 obj
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:49 -07:00
Brian Downs
83ae76fe8d update data structure and account for possible race in start
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:42 -07:00
Brian Downs
4c57fad5a1 update doc comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:35 -07:00
Brian Downs
297d80a924 remove unnecessary error condition
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:27 -07:00
Brian Downs
4e90846599 add node name to s3 structure data
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:20 -07:00
Brian Downs
a831b8e611 add location comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:13 -07:00
Brian Downs
d6378e5901 add addtional log entry
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:51:06 -07:00
Brian Downs
77caab3c34 update retention
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:50:58 -07:00
Brian Downs
b3e84c8862 code clean up, simplification, etc.
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:50:52 -07:00
Brian Downs
a846957a47 update func sig
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:50:44 -07:00
Brian Downs
9882eb0887 update vendor and config map name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:50:30 -07:00
Brian Downs
a6f64cc73d update node name in s3 files
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:48:54 -07:00
Brian Downs
10f0a7908a add configmap save logic
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:48:45 -07:00
Brian Downs
977d7923dd Add ability to list snapshots.
This adds the ability to list snapshots stored locally and in S3 and
their respective metadata.

Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-06-29 09:48:38 -07:00
Derek Nola
5d0a12a616 Update to v1.20.8 (#3477)
* Update to v1.20.8
* Fix comment typo that was breaking tests
Signed-off-by: root <derek.nola@suse.com>
2021-06-17 19:34:10 -07:00
Brad Davidson
245f27e2b2 Handle conntrack-related sysctls in supervisor agent setup
(cherry picked from commit 7e175e8ad4)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-05-19 01:03:00 -07:00
MonzElmasry
e939805a5e change --disable-apiserver flag
Signed-off-by: MonzElmasry <menna.elmasry@rancher.com>
2021-05-13 00:25:07 +02:00
MonzElmasry
77390596e6 add cloud controller manager fixes from master
Signed-off-by: MonzElmasry <menna.elmasry@rancher.com>
2021-04-16 00:09:09 +02:00
Brian Downs
1521e3b085 Resolve local retention issue when S3 in use.
Remove early return preventing local retention policy to be enforced
resulting in N number of snapshots being stored.

Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-04-14 12:11:32 -07:00
Brian Downs
221c9ae589 add hidden attribute to disable flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-04-13 16:29:51 -07:00
Brian Downs
9a572ecae0 delete nocluster file and remove build tag
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-04-13 16:29:51 -07:00
Brian Downs
3f73665131 remove hidden attribute from cluster flags and related code
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-04-13 16:29:51 -07:00
Brian Downs
29f6275aae add etcd s3 secret and access key flags and env vars to secret data
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-04-12 15:53:12 -07:00
Brian Downs
c09142a3a7 put etcd bootstrap save call in goroutine and update comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-03-18 12:52:03 -07:00
Brian Downs
62839b302a remove duplicate method
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2021-03-16 11:24:56 -07:00
Brian Downs
0167f86f5d Have Bootstrap Data Stored in etcd at Completed Start (#3038)
* have state stored in etcd at completed start and remove unneeded code

Signed-off-by: Brian Downs <brian.downs@gmail.com>
(cherry picked from commit 7c99f8645d)
2021-03-15 16:04:10 -07:00
Brian Downs
1da86eaa0b Etcd Snapshot/Restore to/from S3 Compatible Backends (#2902)
* Add functionality for etcd snapshot/restore to and from S3 compatible backends.
* Update etcd restore functionality to extract and write certificates and configs from snapshot.

Signed-off-by: Brian Downs <brian.downs@gmail.com>
(cherry picked from commit 4d1f9eda9d)
2021-03-15 16:04:04 -07:00
Brian Downs
0a3360fc6f Add ability to perform an etcd on-demand snapshot via cli (#2819)
* add ability to perform an etcd on-demand snapshot via cli

Signed-off-by: Brian Downs <brian.downs@gmail.com>
(cherry picked from commit 13229019f8)
2021-03-15 16:02:47 -07:00
Chris Kim
bc400f5396 Define a Controllers and LeaderControllers on the server config (#3053)
Signed-off-by: Chris Kim <oats87g@gmail.com>
2021-03-12 07:27:42 -08:00
Brad Davidson
01fc0249af Log clearer error on startup if NPC cannot be started
Servers should always be upgraded before agents, but generally this
isn't required because things are compatible between versions. In this
case we're OK with failing closed if the user upgrades out of order, but
we should give a clearer message about what steps are required to fix
the issue.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 31bbae1eb1)
2021-03-11 12:13:56 -08:00
Hussein Galal
b0c0d372b8 [release-1.20] Add disable components flags (#3019)
* Add disable flags for control components (#2900)

* Add disable flags to control components

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* golint

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* more fixes

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* fixes to disable flags

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Add comments to functions

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Fix joining problem

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* more fixes

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* golint

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* fix ticker

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* fix role labels

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* more fixes

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* remove etcd member if disable etcd is passed

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* update dynamiclistener

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* change error to warn when removing self from etcd members

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Mark disable components flags as experimental

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2021-03-05 00:04:48 +02:00
Brad Davidson
6e768c301e Use appropriate response codes for authn/authz failures
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-09 16:28:20 -08:00
Brad Davidson
374271e9a0 Collect IPs from all pods before deciding to use internal or external addresses (#2909)
* Collect IPs from all pods before deciding to use internal or external addresses

@Taloth correctly noted that the code that iterates over ServiceLB pods
to collect IP addresses was failing to add additional internal IPs once
the map contained ANY entry from a previous node. This may date back to
when ServiceLB used a Deployment instead of a DaemonSet, so there was
only ever a single pod.

The new behavior is to collect all internal and external IPs, and then
construct the address list of a single type - external if there are any,
otherwise internal.

https://github.com/k3s-io/k3s/issues/1652#issuecomment-774497788

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Co-authored-by: Brian Downs <brian.downs@gmail.com>
2021-02-09 16:26:57 -08:00
Brad Davidson
e06119729b Improve handling of comounted cpu,cpuacct controllers (#2911)
* Improve handling of comounted cpu,cpuacct controllers

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-09 16:12:58 -08:00
Brad Davidson
ad5e504cf0 Allow joining clusters when the server CA is trusted by the OS CA bundle (#2743)
* Add tests to clientaccess/token
* Fix issues in clientaccess/token identified by tests
* Update tests to close coverage gaps
* Remove redundant check turned up by code coverage reports
* Add warnings if CA hash will not be validated

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-08 22:28:57 -08:00
Brad Davidson
6c472b5942 Use zstd instead of gzip for embedded tarball
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-08 21:08:35 -08:00
Brad Davidson
c5e2676d5c Update local-path-provisioner and helper busybox (#2885)
* Update local-path-provisioner and helper busybox

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-04 10:49:25 -08:00
Brad Davidson
65c78cc397 Replace options.KubeRouterConfig with config.Node and remove metrics/waitgroup stuff
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-03 10:41:51 -08:00
Brad Davidson
07256cf7ab Add ServiceIPRange and ServiceNodePortRange to agent config
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-03 10:41:51 -08:00
Brad Davidson
95a1a86847 Spell check upstream code
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-03 10:41:51 -08:00
Brad Davidson
29483d0651 Initial update of netpol and utils from upstream
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-02-03 10:41:51 -08:00
Akihiro Suda
f3c41b7650 fix cgroup2 support
Fix issue 900

cgroup2 support was introduced in PR 2584, but got broken in f3de60ff31

It was failing with "F1210 19:13:37.305388    4955 server.go:181] cannot set feature gate SupportPodPidsLimit to false, feature is locked to true"

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-25 22:45:07 -08:00
Akihiro Suda
728ebcc027 rootless: remove rootful /run/{netns,containerd} symlinks
Since a recent commit, rootless mode was failing with the following errors:

```
E0122 22:59:47.615567      21 kuberuntime_manager.go:755] createPodSandbox for pod "helm-install-traefik-wf8lc_kube-system(9de0a1b2-e2a2-4ea5-8fb6-22c9272a182f)" failed: rpc error: code = Unknown desc = failed to create network namespace for sandbox "285ab835609387f82d304bac1fefa5fb2a6c49a542a9921995d0c35d33c683d5": failed to setup netns: open /var/run/netns/cni-c628a228-651e-e03e-d27d-bb5e87281846: permission denied
...
E0122 23:31:34.027814      21 pod_workers.go:191] Error syncing pod 1a77d21f-ff3d-4475-9749-224229ddc31a ("coredns-854c77959c-w4d7g_kube-system(1a77d21f-ff3d-4475-9749-224229ddc31a)"), skipping: failed to "CreatePodSandbox" for "coredns-854c77959c-w4d7g_kube-system(1a77d21f-ff3d-4475-9749-224229ddc31a)" with CreatePodSandboxError: "CreatePodSandbox for pod \"coredns-854c77959c-w4d7g_kube-system(1a77d21f-ff3d-4475-9749-224229ddc31a)\" failed: rpc error: code = Unknown desc = failed to create containerd task: io.containerd.runc.v2: create new shim socket: listen unix /run/containerd/s/8f0e40e11a69738407f1ebaf31ced3f08c29bb62022058813314fb004f93c422: bind: permission denied\n: exit status 1: unknown"
```

Remove symlinks to /run/{netns,containerd} so that rootless mode can create their own /run/{netns,containerd}.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-22 19:51:43 -08:00
Brad Davidson
071de833ae Fix typo in field tag
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-01-22 19:38:37 -08:00