-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add Korrel8r deployment within COO #474
Conversation
Skipping CI for Draft Pull Request. |
5f0387f
to
d4c340c
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shwetaap The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Shweta Padubidri <spadubid@redhat.com>
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.
Looks good. I was unsure why there are korrel8r_svc.yaml and korrel8r_deploy.yaml when it looks like this is (almost) what the controller code generates. Othewise it all makes sense.
@@ -39,6 +39,7 @@ var defaultImages = map[string]string{ | |||
"prometheus": "", | |||
"alertmanager": "", | |||
"thanos": obopo.DefaultThanosImage, | |||
"korrel8r": "quay.io/korrel8r/korrel8r:latest", |
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.
"korrel8r": "quay.io/korrel8r/korrel8r:latest", | |
"korrel8r": "quay.io/korrel8r/korrel8r:0.6.2", |
Using :latest may give unpredicatable behavior when the latest tag moves.
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.
+1 to that, we're also trying to promote this behavior later on for coo 0.3.0
spec: | ||
containers: | ||
- image: quay.io/korrel8r/korrel8r:latest | ||
command: ["/bin/korrel8r", "web", "--config", "/etc/korrel8r/openshift-svc.yaml"] |
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.
Needs HTTPS and server-certificate settings, see:
https://github.com/korrel8r/operator/blob/main/controllers/korrel8r_controller.go
Note the mounted secret is generated by the service, see next comment.
@@ -0,0 +1,12 @@ | |||
apiVersion: v1 | |||
kind: Service | |||
metadata: |
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.
Need annotation to request serving certs from OCP ,see:
https://github.com/korrel8r/operator/blob/main/controllers/korrel8r_controller.go#L343
func componentLabels(name string) map[string]string { | ||
return map[string]string{ | ||
"app.kubernetes.io/instance": name, | ||
"app.kubernetes.io/part-of": "Korrel8r", |
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.
Need a consistent interpretation for these app.k8s.io labels.
E.g. is korrel8r part-of COO or part-of itself? Is korrel8r a component or does it have components?
Is instance a unique name within a namespace or unique cluster-wide?
The k8s docs are a bit ambiguous. I'm not so concerned about finding the "right" answer, more about being consistent with the rest of COO.
} | ||
|
||
func newKorrel8rDeployment(name string, namespace string, korrel8rCfg Korrel8rConfiguration) *appsv1.Deployment { | ||
deploy := &appsv1.Deployment{ |
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.
What's the relationship between this code and the YAML files above?
// korrel8rRoute := &routev1.Route{} | ||
// if err := rm.k8sClient.Get(ctx, req.NamespacedName, korrel8rRoute); err != nil { | ||
// if err != nil { | ||
// // retry since some error has occured | ||
// return ctrl.Result{}, err | ||
// } | ||
// } | ||
|
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.
// korrel8rRoute := &routev1.Route{} | |
// if err := rm.k8sClient.Get(ctx, req.NamespacedName, korrel8rRoute); err != nil { | |
// if err != nil { | |
// // retry since some error has occured | |
// return ctrl.Result{}, err | |
// } | |
// } |
Not needed
logger logr.Logger | ||
controller controller.Controller | ||
korrel8rconf Korrel8rConfiguration | ||
version string |
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.
already marked by Github, but version is unused. I assume that as this is a draft it'll be filled later ;)
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.
In the korrel8r operator it was used to set the "app.kubernetes.io/version" label from the image tag of the korrel8r image. Not very important since you can check the image directly - I think we can drop it.
/assign @jan--f |
Closing this PR, and moving the work to here - #497 |
Add Korrel8r deployment within observability operator