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

docs: overriding behavior for common labels #5699

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

rexagod
Copy link
Contributor

@rexagod rexagod commented Jun 18, 2023

Description

Document common (reserved) labels in:

  • alertmanager
  • prometheus
  • thanos-ruler

Fixes #4549.

Type of change

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Document overriding behavior for common (reserved) labels.

- Document overriding behavior in common (reserved) labels for `alertmanager`, `prometheus`, and `thanos-ruler.

@rexagod rexagod requested a review from a team as a code owner June 18, 2023 18:10
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.

Thanks! I've got only some minor comments. I've focused on Alertmanager but if you agree with my suggestions, the same applies to Prometheus and ThanosRuler.

pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
pkg/apis/monitoring/v1/alertmanager_types.go Outdated Show resolved Hide resolved
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.

Just a few nits :)

@@ -68,7 +68,13 @@ type ThanosRulerList struct {
type ThanosRulerSpec struct {
// Version of Thanos to be deployed.
Version string `json:"version,omitempty"`
// PodMetadata contains Labels and Annotations gets propagated to the thanos ruler pods.
// PodMetadata contains Labels and Annotations gets propagated to the ThanosRuler pods,
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
// PodMetadata contains Labels and Annotations gets propagated to the ThanosRuler pods,
// PodMetadata configures labels and annotations which are propagated to the ThanosRuler pods.

@@ -68,7 +68,13 @@ type ThanosRulerList struct {
type ThanosRulerSpec struct {
// Version of Thanos to be deployed.
Version string `json:"version,omitempty"`
// PodMetadata contains Labels and Annotations gets propagated to the thanos ruler pods.
// PodMetadata contains Labels and Annotations gets propagated to the ThanosRuler pods,
// out of which, the following are reserved and cannot be overridden:
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
// out of which, the following are reserved and cannot be overridden:
//
// The following items are reserved and cannot be overridden:

@@ -59,7 +59,16 @@ func (l *Prometheus) GetStatus() PrometheusStatus {
// CommonPrometheusFields are the options available to both the Prometheus server and agent.
// +k8s:deepcopy-gen=true
type CommonPrometheusFields struct {
// PodMetadata configures labels and annotations which are propagated to the Prometheus pods.
// PodMetadata configures labels and annotations which are propagated to the Prometheus pods,
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
// PodMetadata configures labels and annotations which are propagated to the Prometheus pods,
// PodMetadata configures labels and annotations which are propagated to the Prometheus pods.

@@ -59,7 +59,16 @@ func (l *Prometheus) GetStatus() PrometheusStatus {
// CommonPrometheusFields are the options available to both the Prometheus server and agent.
// +k8s:deepcopy-gen=true
type CommonPrometheusFields struct {
// PodMetadata configures labels and annotations which are propagated to the Prometheus pods.
// PodMetadata configures labels and annotations which are propagated to the Prometheus pods,
// out of which, the following are reserved and cannot be overridden:
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
// out of which, the following are reserved and cannot be overridden:
//
// The following items are reserved and cannot be overridden:

@@ -60,7 +60,14 @@ func (l *Alertmanager) DeepCopyObject() runtime.Object {
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +k8s:openapi-gen=true
type AlertmanagerSpec struct {
// PodMetadata configures Labels and Annotations which are propagated to the alertmanager pods.
// PodMetadata configures Labels and Annotations which are propagated to the Alertmanager pods,
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
// PodMetadata configures Labels and Annotations which are propagated to the Alertmanager pods,
// PodMetadata configures labels and annotations which are propagated to the Alertmanager pods.

@@ -60,7 +60,14 @@ func (l *Alertmanager) DeepCopyObject() runtime.Object {
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +k8s:openapi-gen=true
type AlertmanagerSpec struct {
// PodMetadata configures Labels and Annotations which are propagated to the alertmanager pods.
// PodMetadata configures Labels and Annotations which are propagated to the Alertmanager pods,
// out of which, the following are reserved and cannot be overridden:
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
// out of which, the following are reserved and cannot be overridden:
//
// The following items are reserved and cannot be overridden:

Document overriding behavior for common labels in,
* alertmanager,
* prometheus, and,
* thanos-ruler.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
@rexagod
Copy link
Contributor Author

rexagod commented Nov 1, 2023

I'm encountering errors on make --always-make format generate, I'll try getting the binary manually from source.

Downloading shellcheck
tar: shellcheck-stable/shellcheck: Not found in archive
tar: Error exit delayed from previous errors.
make: *** [/Users/rexagod/repositories/work/prometheus-operator/tmp/bin/controller-gen] Error 1

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@simonpasquier simonpasquier enabled auto-merge (squash) November 3, 2023 10:20
@simonpasquier simonpasquier merged commit 45185c8 into prometheus-operator:main Nov 3, 2023
17 checks passed
adinhodovic pushed a commit to adinhodovic/prometheus-operator that referenced this pull request Nov 13, 2023
* docs: overriding behavior for common labels

Document overriding behavior for common labels in,
* alertmanager,
* prometheus, and,
* thanos-ruler.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

* Regenerate Documentation/api/md

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

---------

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Common labels override labels from podMetadata
3 participants