Commit Graph

55 Commits

Author SHA1 Message Date
Peter Rifel 5ac11aa55a
Cleanup logging for reconcile cluster 2025-02-23 21:04:31 -06:00
Kubernetes Prow Robot 51db52f025
Merge pull request #17154 from justinsb/build_our_own_rest_config
chore: refactor factory to accept a cluster
2024-12-28 09:08:12 +01:00
justinsb 859a9fd9f1 chore: refactor factory to accept a cluster
This should allow us to build our own rest config in future,
rather than relying on the kubeconfig being configured correctly.

To do this, we need to stop sharing the factory between the channels
and kops commands.
2024-12-27 15:36:37 -05:00
justinsb ebcfebe50e chore: add context to rolling update functions
Move it out of the struct, and into the function parameters.

This is more go idiomatic.
2024-12-27 14:22:51 -05:00
Jack Andersen 66fe8e8118
Move results insert to original location to reduce diff
Signed-off-by: Jack Andersen <jandersen@plaid.com>
2022-12-21 09:30:18 -08:00
Jack Andersen dfd9516a4f
Continue to log if an error is encountered, separate the exit check 2022-12-21 09:30:18 -08:00
Jack Andersen f5f71f17f9
Satisfy the Is interface with ValidationTimeoutError and change callers of err check
Signed-off-by: Jack Andersen <jandersen@plaid.com>
2022-12-21 09:30:17 -08:00
jandersen-plaid 4eb455c6b9
Update pkg/instancegroups/rollingupdate.go
Co-authored-by: Ole Markus With <olemarkus@gmail.com>
2022-12-21 09:30:16 -08:00
Jack Andersen 2bd5403f37
Create a specific error type for validation timeouts and classify as exitable
Signed-off-by: Jack Andersen <jandersen@plaid.com>
2022-12-21 09:30:16 -08:00
Jack Andersen 6efd68f428
Remove optionality and exit when specific error prefix is matched
Signed-off-by: Jack Andersen <jandersen@plaid.com>
2022-12-21 09:30:14 -08:00
Jack Andersen f9ea9b3ef8
Add a flag to rolling update to fail immediately on IG error
Signed-off-by: Jack Andersen <jandersen@plaid.com>
2022-12-21 09:30:13 -08:00
John Gardiner Myers de9055b588 Update control-plane terminology in CLI output strings 2022-11-23 21:32:10 -08:00
John Gardiner Myers d39ba74bd7 Change the control-plane IG role to "ControlPlane" in v1alpha3 API 2022-11-22 17:05:29 -08:00
Ole Markus With b45968c992 Log and aggregate errors from rolling update
Rather than just returning the error from the first failing IG
2022-10-20 20:04:18 +02:00
justinsb 4b2f773748 rolling-update: don't deregister our only apiserver
If we do, we can't drain the node afterwards.  We also are going to
have dropped connections in this case anyway.
2022-09-15 09:16:57 -04:00
Bronson Mirafuentes 86b0ef0d0c add drain-timeout flag to rolling-update cluster 2022-01-20 14:05:55 -08:00
Ciprian Hacman ea7df00719 Run hack/update-gofmt.sh 2021-12-01 22:39:50 +02:00
Ole Markus With 20bd724f5e Add support for scaling out the control plane with dedicated apiserver nodes
Ensure apiserver role can only be used on AWS (because of firewalling)

Apply api-server label to CP as well

Consolidate node not ready validation message

Guard apiserver nodes with a feature flag

Rename Apiserver role to APIServer

Add an integration test for apiserver nodes

Rename Apiserver role to APIServer

Enumerate all roles in rolling update docs

Apply suggestions from code review

Co-authored-by: Steven E. Harris <seh@panix.com>
2021-03-20 20:57:00 +01:00
Ole Markus With 2659a30280 Make get instances respect needs-update annotation
Make it possible for addons to set needs-update annotation

Use onDelete update strategy for cilium and set needs-update annotation

Rename node roles
2020-11-16 08:26:17 +01:00
Ole Markus With aa66c4f6d8 Add rolling upgrade to openstack 2020-10-01 20:07:44 +02:00
Ole Markus With 63f13322d5 Don't pass ctx and cluster everywhere 2020-09-23 08:30:24 +02:00
Ole Markus With 0ec71686b9 Refactor cloudinstancegroupmember in a more independent cloud instance representation
Apply suggestions from code review

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-08-30 21:37:03 +02:00
Ole Markus With ff6c04938d Add kops delete instance command
Add support for deleting instance by k8s node name

Add yes flag
2020-08-28 08:43:30 +02:00
Peter Rifel 4d9f0128a3
Upgrade to klog2
This splits up the kubernetes 1.19 PR to make it easier to keep up to date until we get it sorted out.
2020-08-16 20:56:48 -05:00
John Gardiner Myers 494209884a Rolling update instance groups in consistent order 2020-06-20 10:58:06 -07:00
Justin Santa Barbara ffb6cd61aa Rolling-update validation harmonization
This is a follow-on to #8868; I believe the intent of that was to
expose the option to do more (or fewer) retries.

We previously had a single retry to prevent flapping; this basically
unifies the previous behaviour with the idea of making it
configurable.

* validate-count=0 effectively turns off validation.

* validate-count=1 will do a single validation, without flapping
  detection.

* validate-count>=2 will require N succesful validations in a row,
waiting ValidateSuccessDuration in between.

A nice side-effect of this is that the tests now explicitly specify
ValidateCount=1 instead of setting ValidateSuccessDuration=0, which
had the side effect of doing the equivalent to ValidateCount=1.
2020-04-17 01:40:02 -04:00
Justin Santa Barbara 31bb16d4d1 Add context.Context to most signatures
The client-go signature for most methods adds a context.Context
object, and also makes Options mandatory.  Feed through a
context.Context through many of our methods (but use context.TODO to
stop it getting totally out of hand!)
2020-04-11 14:44:17 -04:00
Jesse Haka 11eaacd53e validationtimes -> validationcount 2020-04-08 13:55:29 +03:00
Jesse Haka e1e79790ef validate cluster n times in rolling update 2020-04-08 13:55:24 +03:00
John Gardiner Myers 33e23166e4 Support the kops.k8s.io/needs-update annotation on nodes 2020-03-09 22:43:09 -07:00
John Gardiner Myers 03eb8246c7 Refactor/simplify rolling update 2020-03-09 11:05:58 -07:00
Kubernetes Prow Robot 121d9f461f
Merge pull request #7909 from johngmyers/remove-drain-feature-flag
Remove DrainAndValidateRollingUpdate feature flag
2020-01-05 11:15:40 -08:00
John Gardiner Myers 0cbd76ecfb Simplify code for rolling updates of nodes 2019-12-31 10:25:55 -08:00
Jesse Haka 44183aef7f validate cluster twice 2019-12-12 08:48:15 +02:00
John Gardiner Myers 2e36124f77 Expose ValidateTickDuration for use by unit tests 2019-12-09 18:43:20 -08:00
Kashif Saadat fcf6f0098c Canal Typha spec and apimachinery 2019-12-06 15:36:48 +00:00
John Gardiner Myers 4eccd3d53f Remove DrainAndValidateRollingUpdate feature flag 2019-12-05 22:50:04 -08:00
Peter Rifel 3dc06afa12 Fix goimports errors
It turns out we werent running verify-goimports in our CI jobs.

While we work to get that enabled, we can at least unblock the releases by doing a one-time fix of the failing goimports
2019-11-19 05:05:02 -08:00
John Gardiner Myers 63e0c5e726 Add tests for cluster validation during rolling update 2019-11-04 16:26:39 -08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Justin SB 96aa37d03d
Remove unused ClientGetter from Drain code
This is no longer needed now we are using the k8s drain code.
2019-09-03 07:04:37 -07:00
Justin SB 3e33ac7682
Change code from glog to klog
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog.  That
will happen when we update to k8s 1.13.
2019-05-06 12:54:51 -04:00
Rodrigo Menezes 2b9243ff8c Getting things ready for when we are ready for 1.12 2018-12-04 18:50:17 -08:00
mikeweiwei 027d324aaf If don't use formatted output,fix logging calls 2018-10-10 19:19:09 +08:00
Justin Santa Barbara 62e8e17077 Code fixes for k8s 1.11 API changes 2018-09-28 20:14:45 -04:00
Justin Santa Barbara 3a1ce236d1 Simplify logic around master rolling-update
We were using a waitgroup, but we weren't actually running in parallel.
2018-07-21 23:04:22 -04:00
Deniz Zoeteman 2a69901d52 Add message to error for stopping rolling update after failure 2018-07-17 18:56:31 +02:00
Deniz Zoeteman b06e3efa4d Stop with rolling update if bastions or masters failed to update 2018-07-16 16:56:47 +02:00
Justin Santa Barbara 55e3a5f212 Validation: Take a cluster object, not just the name 2018-03-20 01:12:07 -04:00
Todd Lyons 40eed60dd8 Interactive cli arg framework
Just builds, haven't tested yet.
2017-12-28 10:54:17 -08:00