Commit Graph

47 Commits

Author SHA1 Message Date
justinsb ef219c3c35 chore: fix method-matching on Render method
This allows us to invoke methods that accept interfaces, and arguably
the old logic was incorrect (though it worked in the case where we
wanted exact type matches)
2024-10-13 09:01:36 -04:00
justinsb ffd52cac40 refactor: Introduce DeletionProcessingMode
Deletion processing is not entirely a factor of the target, it is more
a factor of our mode of execution (dry-run vs pre-rolling-update vs
post-rolling-update).  We want to introduce that post-rolling-update
phase, so introduce the DeletionProcessingMode enum and move it from
the target to the context.
2024-02-15 08:12:19 -05:00
justinsb d8c449a4f8 Basic OpenTelemetry support
We initially support capturing to a file (in our own format, as it
doesn't appear a suitable format exists).  This means we don't need a
server to capture the traces, and can start capturing through prow
without a lot of infrastructure changes.

Co-authored-by: Peter Rifel <rifelpet@users.noreply.github.com>
2023-11-18 09:12:19 -05:00
Peter Rifel bf47eedcb3
Add an inner error to TryAgainLaterError 2023-07-28 18:49:35 -05:00
John Gardiner Myers d916596c32 Give nodeup a read-only Keystore 2022-12-20 12:00:37 -08:00
John Gardiner Myers 7abacb9b3b Get default CheckExisting from Target 2022-12-20 12:00:37 -08:00
John Gardiner Myers f5fb91c858 Move SecretStore to CloudupSubContext 2022-12-20 12:00:37 -08:00
John Gardiner Myers 4d309b0b36 Move Cluster into CloudupSubContext 2022-12-20 08:11:01 -08:00
John Gardiner Myers 9b22483ab2 Separate out a fi.InstallContext 2022-12-19 17:18:58 -08:00
John Gardiner Myers a16dbf3747 Make some functions private 2022-12-18 13:44:23 -08:00
John Gardiner Myers f7383b29da Move Cloud into CloudupSubContext 2022-12-18 13:40:02 -08:00
John Gardiner Myers 0aba1a24b9 Move ClusterConfigBase into CloudupSubContext 2022-12-18 13:40:02 -08:00
John Gardiner Myers 7fcd55737a Remove unused fields from fi.Context 2022-12-18 13:40:02 -08:00
John Gardiner Myers 7c3e32369a Refactor Context into separate cloudup and nodeup types 2022-12-17 17:42:46 -08:00
justinsb 5fde739814 Introduce context.Context into some of our "Context" objects
The rule of thumb is that we shouldn't be embedding a context.Context,
but it is reasonable when the lifetime is similar and when the
refactor would otherwise be unacceptably large.

This is a minimal way to introduce it, based on adding the support
needed in the GCS support for serviceAccountIssuerDiscovery.  We will
need to plumb through the context in many more places over time.
2022-12-12 09:56:09 -05:00
Ciprian Hacman ea7df00719 Run hack/update-gofmt.sh 2021-12-01 22:39:50 +02:00
Eng Zer Jun 425173ae9f
refactor: move from io/ioutil to io and os packages
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-11-12 15:37:18 +08:00
John Gardiner Myers eb076e3713 Render managed files with Terraform 2021-06-28 12:15:15 -07:00
John Gardiner Myers 7c9e7e9286 Make Lifecycle field non-pointer 2021-06-02 23:02:16 -07:00
Guangwen Feng 66d48164a9 Fix typo in comment
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2021-01-06 16:18:46 +08: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
Ciprian Hacman 3a1120724e Cleanup AWS EC2 eventual consistency warnings 2020-07-29 23:38:15 +03:00
ZouYu 2fc52ec6be fix some go-lint warning
Signed-off-by: ZouYu <zouy.fnst@cn.fujitsu.com>
2020-06-09 08:52:50 +08:00
yuxiaobo 3b4cd437ed Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-13 17:28:28 +08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04: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
Justin Santa Barbara 1af610a6c4 Use fast-retry and cleanup task options for tests
The launch configuration test exposed that our integration tests don't
retry for very long, and wait a long time in between retries.

Create a RunTasksOptions type to hold the parameters, in particular
max task time, and the amount of time we wait when all tasks have
failed.
2018-06-18 00:04:23 -04:00
chrislovecnm aed1000a0f Fixing ExistsAndWarnIfChanges so that it will allow a user to pass
This PR implmenents a new custom error that is returned when a task
lifecycle set to fi.LifecycleExistsAndWarnIfChanges. This will allow
a task to to fail validation, but the task is marked as completed and
the error is cleared.
2018-02-18 19:00:17 -07:00
Justin Santa Barbara f03cc5dbd9 Update dnsprovider imports to use our version 2017-12-13 20:43:01 -05:00
chrislovecnm 8d1ee1fa16 updating files for goimports 2017-11-01 12:51:43 -06:00
Justin Santa Barbara 2eb47b82ce Tolerate errors from Find for tasks with WarnIfInsufficientAccess
We glog.Warning a message, and we record a structured warning for future
use, but we allow operation to continue.
2017-10-30 01:56:41 -04:00
Justin Santa Barbara b2bcba4a6d GCE: Use object-level permissions for files in GCS
This lets us configure cross-project permissions while ourselves needing
minimal permissions, but also gives us a nice hook for future lockdown
of object-level permissions.
2017-10-29 19:17:00 -04:00
Justin Santa Barbara 7a03c6690d Document Render function 2017-07-15 22:04:01 -04:00
Justin Santa Barbara 3dfe48e5ae Wiring up lifecycle 2017-07-15 22:03:54 -04:00
Justin Santa Barbara 645f330dad Re-enable GCE support
We move everything to the models.  We feature-flag it, because we
probably want to change the names etc, and we aren't going to be able to
offer smooth upgrades until that is done.
2017-02-28 20:08:03 -05:00
Zach Loafman e60c36068f Fix retries for AutoScalingGroup pending delete
This:
- reworks how retries are handled in fi/executor.go to a time-based scheme
- changes the single-task limit to 10m (from about 30s of no-progress)
- eliminates the inner IAM propagation retry for LaunchConfigurations,
because the task itself will just be redriven for a while. This also
eliminates any long-pole delay caused by this error (since task Run()
should be 'fast').
2016-11-28 17:04:02 -08:00
chrislovecnm 8fa2aac99f fixing more headers 2016-10-15 19:20:56 -06:00
Justin Santa Barbara c284a181dc Refactor CA/Key interface
We create a simplified interface for use in tasks, vs the CLI which has
more diagnostic functionality
2016-10-11 09:48:43 -04:00
Justin Santa Barbara 88ec3db1bf ManagedFile support
A managed file is templated kops-side, but then stored in the S3 bucket
(aka state store)

This will be used to pass the channel containing the core addons.
2016-10-01 10:21:45 -04:00
Justin Santa Barbara f8bbdb1467 Support deletion of items
We don't normally need to delete items, but we do need to purge old
security group rules.
2016-09-17 23:06:15 -04:00
Justin Santa Barbara 8fb4215e17 Run CI versions of k8s
CI versions are not pushed to gcr.io, so we need to preload the images
by downloading them and doing a docker load.
2016-08-11 01:32:42 -04:00
Justin Santa Barbara 93f634b428 upup: use vfs for secretstore/keystore
This is needed so that we can have encrypted storage and complex keys
(e.g. multiple CA certs).  Multiple CA certs are needed for an in-place
upgrade from kube-up v1.
2016-06-23 08:58:54 -04:00
Justin Santa Barbara 14bae04e01 upup: turn down a few more logging messages 2016-06-13 17:37:30 -04:00
Justin Santa Barbara 16559c9010 upup: Executor that performs some retry logic
If there is an error performing a task, we will reattempt it as long as
forward progress is still being made (i.e. at least one other task
completed successfully)

This makes everything more reliable (though we should still fix these
problems), but it also lays the groundwork for parallel execution.
2016-05-22 21:02:53 +01:00
Justin Santa Barbara ac220d2ba1 Allow Render methods to take fi.Context
We call the Render methods on Tasks by reflection, and some of them
don't care about the Target, but do care about the Context (e.g. the PKI
tasks, which only care about the CAStore)
2016-05-15 17:43:04 -04:00
Justin Santa Barbara caccb8953f UpUp: AWS support
Adds AWS support for both cloudup & nodeup.
Also cleaning up things found along the way!
2016-05-09 13:08:27 -04:00
Justin Santa Barbara d4c2cfaae7 Initial version of upup: cloudup & nodeup
* GCE support only
* Key and secret generation
* "Direct mode" makes API calls
* "Dry run mode" previews the changes
* Terraform output (though key generation not working for master ip)
* cloud-init output (though debian image does not ship with cloud-init)
2016-05-06 16:01:33 -04:00