-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ability to entirely opt-out of argo cd and rollouts integrations #1382
feat: add ability to entirely opt-out of argo cd and rollouts integrations #1382
Conversation
✅ Deploy Preview for docs-kargo-akuity-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1382 +/- ##
==========================================
+ Coverage 45.31% 45.52% +0.21%
==========================================
Files 136 136
Lines 11761 11823 +62
==========================================
+ Hits 5329 5382 +53
- Misses 6240 6250 +10
+ Partials 192 191 -1 ☔ View full report in Codecov by Sentry. |
53834d8
to
9df1f3a
Compare
Instead of (or in addition to) the The reason I think this is desired is because coordinating I'm okay with having the option of |
This is an example of how we avoid a configuration knob for Istio in Argo Rollouts by trying to detect if an Istio VirtualService is even present. If not, we don't attempt to start the informer. https://github.com/argoproj/argo-rollouts/blob/master/utils/istio/istio.go#L16-L22 func DoesIstioExist(dynamicClient dynamic.Interface, namespace string) bool {
_, err := dynamicClient.Resource(GetIstioVirtualServiceGVR()).Namespace(namespace).List(context.TODO(), metav1.ListOptions{Limit: 1})
if err != nil {
return false
}
return true
} |
9df1f3a
to
75c7834
Compare
75c7834
to
abc446c
Compare
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
abc446c
to
c18671d
Compare
// Phase describes the current phase of the Verification process. Generally, | ||
// this will be a reflection of the underlying AnalysisRun's phase, however, | ||
// there are exceptions to this, such as in the case where an AnalysisRun | ||
// cannot be launched successfully. | ||
Phase VerificationPhase `json:"phase,omitempty"` | ||
// Message may contain additional information about why the verification | ||
// process is in its current phase. | ||
Message string `json:"message,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the main changes to the resources types.
It's always been possible that something could go wrong with a verification other than an AnalysisRun failing or erroring, so really, this is the way things should have been done from the start. Added Phase and Message fields for reporting such problems.
The specific problem that is more likely to occur, starting with this PR, is that verification is requested, but the controller doesn't have Rollouts integration enabled. This means an AnalysisRun cannot even be launched.
c18671d
to
fc5b97a
Compare
{{- if .Values.api.rollouts.integrationEnabled }} | ||
- apiGroups: | ||
- argoproj.io | ||
resources: | ||
- analysistemplates | ||
verbs: | ||
- "*" | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes #1379
fc5b97a
to
05afd25
Compare
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
05afd25
to
50a496c
Compare
if a.argocdClient == nil { | ||
return promo.Status.WithPhase(kargoapi.PromotionPhaseFailed), newFreight, | ||
errors.New( | ||
"Argo CD integration is disabled on this controller; cannot perform " + | ||
"promotion", | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't just the Application reconciler that we cannot start when Argo CD is disabled. We also cannot carry out Argo CD-based promotion mechanisms.
if r.argocdClient == nil && len(argoCDAppUpdates) > 0 { | ||
h.Status = kargoapi.HealthStateUnknown | ||
h.Issues = []string{ | ||
"Argo CD integration is disabled on this controller; cannot assess" + | ||
" the health or sync status of Argo CD Applications", | ||
} | ||
return &h | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot factor Application state into Stage health if Argo CD integration is disabled.
@@ -70,12 +70,12 @@ type reconciler struct { | |||
startVerificationFn func( | |||
context.Context, | |||
*kargoapi.Stage, | |||
) (*kargoapi.VerificationInfo, error) | |||
) *kargoapi.VerificationInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function signature changed...
If something goes wrong, we report it through the VerificationInfo's Phase and Message fields. What we don't want is for a verification problem to present as a Stage problem.
func (r *reconciler) startVerification( | ||
ctx context.Context, | ||
stage *kargoapi.Stage, | ||
) (*kargoapi.VerificationInfo, error) { | ||
) *kargoapi.VerificationInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once again, if something goes wrong, we now report it through the VerificationInfo's Phase and Message fields. What we don't want is for a verification problem to look like a Stage problem.
argoClient client.Client // nil if credential borrowing is not enabled | ||
cfg KubernetesDatabaseConfig | ||
kargoClient client.Client | ||
argocdClient client.Client // nil if credential borrowing is not enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You see changes like this throughout. "argoClient" was too ambiguous, because Rollouts is also and Argo project. argocdClient
is more specific.
@@ -485,7 +523,7 @@ type FreightReference struct { | |||
Charts []Chart `json:"charts,omitempty"` | |||
// VerificationInfo is information about any verification process that was | |||
// associated with this Freight for this Stage. | |||
VerificationInfo *VerificationInfo `json:"verificationResult,omitempty"` | |||
VerificationInfo *VerificationInfo `json:"verificationInfo,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an oops to begin with.
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
36db30b
to
12bfb28
Compare
@jessesuen, I addressed this in new commit 12bfb28 I think there is a benefit to explicitly disabling Argo CD and/or Rollouts integrations if they are undesired because the controller is granted slightly fewer permissions that way. But your point about configuration for many shards being difficult is a good one. And we've also seen instances of our own colleagues being surprised at the controller going into a crash loop when they forgot to install one of the dependencies. So where I landed was:
Does all that seem ok? Willing to tweak this further if you think I've missed the mark. |
Yep! That is effectively the same as what I was asking for. |
Fixes #1379
Highlights:
WIP because I am still addressing some of @jessesuen feedback.