Skip to content

MON-4025: Add AlertmanagerMainConfig - #2148

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
marioferh:alertmanager_monitoring_api
Jul 16, 2025
Merged

MON-4025: Add AlertmanagerMainConfig#2148
openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
marioferh:alertmanager_monitoring_api

Conversation

@marioferh

Copy link
Copy Markdown
Contributor

Every component will be in a separated PR in order to improve review process

First PR: #1929
Related: Enhancements Proposal openshift/enhancements#1627

@openshift-ci

Copy link
Copy Markdown
Contributor

Hello @marioferh! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ciopenshift-ciBot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 15, 2025
@marioferh
marioferhforce-pushed the alertmanager_monitoring_api branch from c0d2965 to c35227fCompareJanuary 15, 2025 15:21
@marioferh

Copy link
Copy Markdown
ContributorAuthor

/hold

@openshift-ciopenshift-ciBot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 15, 2025

@everettraveneverettraven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A lot of the comments are centered around godoc. I'd recommend looking at https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#write-user-readable-documentation-in-godoc for more information on what makes a good godoc that is helpful to users.

Another thing that stood out was multiple fields related to pod spec configuration - you may want to group those into a separate struct to have a single field that clearly denotes that the sub-fields in that object map directly to pod spec fields.

Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1/types_cluster_monitoring.go Outdated
@openshift-merge-robotopenshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2025
@marioferh
marioferhforce-pushed the alertmanager_monitoring_api branch 4 times, most recently from 450dd7b to a6d7bc9CompareApril 30, 2025 08:11
@openshift-merge-robotopenshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2025

@everettraveneverettraven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only got about halfway through the changes on this round, will circle back soon to review the rest.

Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
@marioferh
marioferhforce-pushed the alertmanager_monitoring_api branch 2 times, most recently from e062ce8 to ee3b854CompareMay 6, 2025 10:38
Comment threadconfig/v1alpha1/types_cluster_monitoring.go
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
@marioferh
marioferhforce-pushed the alertmanager_monitoring_api branch 2 times, most recently from b324126 to d9fba48CompareMay 7, 2025 11:34

@everettraveneverettraven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another round of comments. Additionally, I would like to see tests added to ensure the API and validations you have are working as expected.

Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated

// AlertmanagerContainerResources defines simplified resource requirements for a container.
type AlertmanagerContainerResources struct {
// cpu defines the CPU resource limits and requests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because not setting this could be harmful to the system, are there any defaults that we set on a users behalf?

Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
//
// When omitted, this means the user has no opinion and the platform is left
// to choose reasonable defaults. These defaults are subject to change over time.
// The current default is `- operator: "Exists"` which means that all taints are tolerated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is that safe? Not even an API question, but, tolerating all taints is generally not something we would do for control plane components. There are many valid taints (uninitialized for the CCM, network not ready) that I would expect this pod not to tolerate

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

let me think about it

Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
@marioferh

Copy link
Copy Markdown
ContributorAuthor

Continue tomorrow with last comments

@marioferh
marioferhforce-pushed the alertmanager_monitoring_api branch 3 times, most recently from d60f672 to b758adfCompareMay 15, 2025 08:22

@everettraveneverettraven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another round of comments.

I'd also like to see some integration tests put in place to flex your validations and user workflows. https://github.com/openshift/api?tab=readme-ov-file#defining-api-validation-tests

Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
// This field is only effective when the user workload Alertmanager instance is not enabled.
// If the user workload monitoring Alertmanager is enabled, this field is ignored.
// Required: This field must be specified.
// Allowed values are Selectable and None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

well I did selectable and none instead of enable or disable, correct?

Sure. We generally discourage using Enable/Disable for terminology in favor of something more meaningful in the context of the API.

If None and "" semantically mean the same thing, there isn't really a reason to have the None enum value.

For example, if None literally meant no user-defined configurations are processed and "" meant that the platform had some default namespace(s) it looked at for user-defined configurations then those would be semantically different and warrant having different values.

Also, what does Selectable mean? Does this mean I, as a user, can choose which namespaces Alertmanager will look at for user-defined configs?

Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go
Comment threadconfig/v1alpha1/types_cluster_monitoring.go
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go
Comment threadconfig/v1alpha1/types_cluster_monitoring.go
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
Comment threadconfig/v1alpha1/types_cluster_monitoring.go Outdated
@marioferh

Copy link
Copy Markdown
ContributorAuthor

#2148 (comment)
fixed

@JoelSpeed

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2025
@openshift-ci

Copy link
Copy Markdown
Contributor

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/verify-crd-schema

Details

In response to this:

/override ci/prow/verify-crd-schema

Only incorrectly identified newly required fields (they have optional parents)

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.

@openshift-ci

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed, marioferh

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

The pull request process is described here

Details 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-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh

Copy link
Copy Markdown
ContributorAuthor

/retest-required

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh

Copy link
Copy Markdown
ContributorAuthor

/retest-required

1 similar comment
@marioferh

Copy link
Copy Markdown
ContributorAuthor

/retest-required

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh

Copy link
Copy Markdown
ContributorAuthor

/retest-required

@marioferh

Copy link
Copy Markdown
ContributorAuthor

/test e2e-gcp

@marioferh

Copy link
Copy Markdown
ContributorAuthor

/test okd-scos-e2e-aws-ovn

@openshift-ci

openshift-ciBot commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

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

Test nameCommitDetailsRequiredRerun command
ci/prow/okd-scos-imagesc35227flinktrue/test okd-scos-images

Full PR test history. Your PR dashboard.

Details

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.

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 674ad74 and 2 for PR HEAD bcc4fc1 in total

@marioferh

Copy link
Copy Markdown
ContributorAuthor

/test okd-scos-e2e-aws-ovn

1 similar comment
@marioferh

Copy link
Copy Markdown
ContributorAuthor

/test okd-scos-e2e-aws-ovn

@marioferh

Copy link
Copy Markdown
ContributorAuthor

/test minor-e2e-upgrade-minor

@JoelSpeed

Copy link
Copy Markdown
Contributor

Minor upgrade seems to be affected by https://issues.redhat.com/browse/TRT-2190

/override ci/prow/minor-e2e-upgrade-minor

@openshift-ci

Copy link
Copy Markdown
Contributor

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/minor-e2e-upgrade-minor

Details

In response to this:

Minor upgrade seems to be affected by https://issues.redhat.com/browse/TRT-2190

/override ci/prow/minor-e2e-upgrade-minor

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.

@openshift-merge-bot
openshift-merge-botBot merged commit e375905 into openshift:masterJul 16, 2025
@marioferh

Copy link
Copy Markdown
ContributorAuthor

Minor upgrade seems to be affected by https://issues.redhat.com/browse/TRT-2190

/override ci/prow/minor-e2e-upgrade-minor

ty

@openshift-bot

Copy link
Copy Markdown

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-config-api
This PR has been included in build ose-cluster-config-api-container-v4.20.0-202507161450.p0.ge375905.assembly.stream.el9.
All builds following this will include this PR.

@marioferhmarioferh changed the title Monitoring API: Add AlertmanagerMainConfigMON-4025: Add AlertmanagerMainConfigSep 23, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by an approver from all required OWNERS files.lgtmIndicates that a PR is ready to be merged.size/XXLDenotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@marioferh@everettraven@JoelSpeed@openshift-ci-robot@openshift-bot@simonpasquier@openshift-merge-robot