Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

shwetaap
Copy link
Contributor

@shwetaap shwetaap commented May 2, 2024

Add Korrel8r deployment within observability operator

Copy link

openshift-ci bot commented May 2, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@shwetaap shwetaap force-pushed the COO-128 branch 4 times, most recently from 5f0387f to d4c340c Compare May 13, 2024 04:56
Copy link

openshift-ci bot commented May 13, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shwetaap
Once this PR has been reviewed and has the lgtm label, please assign danielmellado for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Shweta Padubidri <spadubid@redhat.com>
Copy link

@alanconway alanconway left a 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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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.

Copy link
Contributor

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"]

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:

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",

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{

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?

Comment on lines +106 to +113
// 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
// }
// }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Contributor

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 ;)

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.

@danielmellado
Copy link
Contributor

/assign @jan--f

@shwetaap
Copy link
Contributor Author

Closing this PR, and moving the work to here - #497

@shwetaap shwetaap closed this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants