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

feat: add operator controller to add ServiceMonitor #616

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

jan--f
Copy link
Collaborator

@jan--f jan--f commented Nov 4, 2024

Fixes: COO-482

@jan--f jan--f requested a review from a team as a code owner November 4, 2024 19:50
@jan--f jan--f requested review from simonpasquier and sthaha and removed request for a team November 4, 2024 19:50
Copy link

openshift-ci bot commented Nov 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jan--f

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved label Nov 4, 2024
@jan--f jan--f force-pushed the obo-incluster-sm branch 4 times, most recently from f3a0f56 to 28a4096 Compare November 5, 2024 08:49
limitations under the License.
*/

package operator_controller
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit)

Suggested change
package operator_controller
package operator

"app.kubernetes.io/component": "operator",
"app.kubernetes.io/name": name,
"app.kubernetes.io/part-of": name,
"openshift.io/user-monitoring": "true",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"openshift.io/user-monitoring": "true",
"openshift.io/user-monitoring": "false",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, shame on me blindly copy/pasting :)

KeyFile: "/etc/prometheus/secrets/metrics-client-certs/tls.key",
SafeTLSConfig: monv1.SafeTLSConfig{
ServerName: ptr.To(fmt.Sprintf("%s.%s.svc", name, namespace)),
InsecureSkipVerify: ptr.To(false),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
InsecureSkipVerify: ptr.To(false),

ctrl, err := ctrl.NewControllerManagedBy(mgr).
Owns(&monv1.ServiceMonitor{}, generationChanged).
Watches(
&appsv1.Deployment{},
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we rather make the servicemonitor owned by the service?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I wasn't sure, will change that.

@jan--f jan--f changed the title WIP: feat: add operator controller to add ServiceMonitor feat: add operator controller to add ServiceMonitor Nov 5, 2024
@jan--f
Copy link
Collaborator Author

jan--f commented Nov 5, 2024

/retest

Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Can we modify the script running the OCP e2e tests to enable cluster monitoring? It would help to validate the feature.

@jan--f
Copy link
Collaborator Author

jan--f commented Nov 5, 2024

Can we modify the script running the OCP e2e tests to enable cluster monitoring? It would help to validate the feature.

I thought that's what happens anyway. @lihongyan1 would know best I think.

@jan--f
Copy link
Collaborator Author

jan--f commented Nov 5, 2024

Found it:

is that not working as expected?

@simonpasquier
Copy link
Contributor

I'm not sure where the operator namespace is created but worst case, the main() e2e test could add the openshift.io/cluster-monitoring: "true" label to the namespace?

@simonpasquier
Copy link
Contributor

/lgtm
/retest-required

@openshift-ci openshift-ci bot added the lgtm label Nov 5, 2024
Copy link

openshift-ci bot commented Nov 5, 2024

@jan--f: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/observability-operator-e2e 0869cae link true /test observability-operator-e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jan--f
Copy link
Collaborator Author

jan--f commented Nov 5, 2024

Bypassing ci/prow/observability-operator-e2e since the reported failure related to the dashboards UIPlugin and is unrelated to this change.

@jan--f jan--f closed this Nov 5, 2024
@jan--f jan--f reopened this Nov 5, 2024
@jan--f jan--f merged commit 5f2b6e5 into rhobs:main Nov 5, 2024
13 of 17 checks passed
@lihongyan1
Copy link
Contributor

Found it:

is that not working as expected?

the script work as expected

@lihongyan1
Copy link
Contributor

I'm not sure where the operator namespace is created but worst case, the main() e2e test could add the openshift.io/cluster-monitoring: "true" label to the namespace?

observability-operator/test/run-e2e-ocp.sh install upstream latest image under namespace openshift-operators as indicated by readme in git repo

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.

3 participants