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

Helm linkerd-controler-plane Allow Custom labels on Pod Monitor #11222

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

jseiser
Copy link
Contributor

@jseiser jseiser commented Aug 8, 2023

Need to be able to set labels on Pod Monitors

add a labels section to podMonitor

Helm Lint/Helm Template

Fixes #11175

Signed-off-by: Justin S [email protected]

Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

Thanks @jseiser 👍

Can you please run bin/helm-docs to upgrade the chart's README.md file? I don't understand why the helm-docs-diff CI job didn't complain...

charts/linkerd-control-plane/values.yaml Outdated Show resolved Hide resolved
Need to be able to set labels on Pod Monitors

add a labels section to podMonitor

Helm Lint/Helm Template

Fixes #[11175]

Signed-off-by: Justin S <[email protected]>
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jseiser
Copy link
Contributor Author

jseiser commented Aug 29, 2023

@alpeb

Anything else we need to do on this one?

Copy link
Member

@mateiidavid mateiidavid left a comment

Choose a reason for hiding this comment

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

@jseiser thanks for the change! We generally need 2 reviewers and I took my time with it. I think it'd be great to also include a labels field for pod monitor in code, otherwise things might be lost during deserialization when using the CLI.

I think adding a map here should do the trick

PodMonitor struct {
Enabled bool `json:"enabled"`
ScrapeInterval string `json:"scrapeInterval"`
ScrapeTimeout string `json:"scrapeTimeout"`
Controller *PodMonitorController `json:"controller"`
ServiceMirror *PodMonitorComponent `json:"serviceMirror"`
Proxy *PodMonitorComponent `json:"proxy"`
}

cc: @alpeb

@alpeb
Copy link
Member

alpeb commented Sep 7, 2023

It seems that for free-form fields like this one the marshaling is forgiving enough:

$ bin/linkerd install --set podMonitor.enabled=true --set podMonitor.labels.foo=bar | grep -B 6 foo
kind: PodMonitor
metadata:
  name: "linkerd-controller"
  namespace: linkerd
  labels:
    linkerd.io/control-plane-ns: linkerd
    foo: bar
--
kind: PodMonitor
metadata:
  name: "linkerd-service-mirror"
  namespace: linkerd
  labels:
    linkerd.io/control-plane-ns: linkerd
    foo: bar
--
kind: PodMonitor
metadata:
  name: "linkerd-proxy"
  namespace: linkerd
  labels:
    linkerd.io/control-plane-ns: linkerd
    foo: bar
--
          matchNames:
            - {{ .Release.Namespace }}
            - linkerd-viz
            - linkerd-jaeger
      enabled: true
      labels:
        foo: bar

But I think it's still good to add that entry into the PodMonitor struct for completeness sake 👍

@jseiser
Copy link
Contributor Author

jseiser commented Sep 8, 2023

I do not know Go to even attempt to add that.

Copy link
Member

@mateiidavid mateiidavid left a comment

Choose a reason for hiding this comment

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

@alpeb's right, I did a bit of testing on a separate PR and it doesn't seem like it requires us to populate the Go values struct (unless we turn it into an actual CLI flag which I doubt is in the books).

We can forgo consistency here since OP isn't comfortable in Go and since we likely have more similar fields that do not have a corresponding field in the internal model.

Thanks for the PR!

@alpeb alpeb merged commit 610e2b8 into linkerd:main Sep 15, 2023
34 checks passed
@jseiser jseiser deleted the 11175 branch September 15, 2023 14:44
adamshawvipps pushed a commit to adamshawvipps/linkerd2 that referenced this pull request Sep 18, 2023
…erd#11222)

Need to be able to set labels on Pod Monitors

add a labels section to podMonitor

Helm Lint/Helm Template

Fixes #[11175]

Signed-off-by: Justin S <[email protected]>
adamshawvipps pushed a commit to adamshawvipps/linkerd2 that referenced this pull request Sep 18, 2023
…erd#11222)

Need to be able to set labels on Pod Monitors

add a labels section to podMonitor

Helm Lint/Helm Template

Fixes #[11175]

Signed-off-by: Justin S <[email protected]>
Signed-off-by: Adam Shaw <[email protected]>
mateiidavid added a commit that referenced this pull request Sep 22, 2023
This edge release updates the proxy's dependency on the `rustls` library to
patch security vulnerability [RUSTSEC-2023-0052]  (GHSA-8qv2-5vq6-g2g7), a
potential CPU usage denial-of-service attack when acceting a TLS handshake from
an untrusted peer with a maliciously-crafted certificate. Furthermore, this
edge release contains a few improvements to the control plane and jaeger
extension Helm charts.

* Addressed security vulnerability [RUSTSEC-2023-0052] in the proxy by updating
  its dependency on the `rustls` library
* Added a `prometheusUrl` field for the heartbeat job in the control plane Helm
  chart (thanks @david972!) ([#11343]; fixes [#11342])
* Introduced support for arbitrary labels in the `podMonitors` field in the
  control plane Helm chart (thanks @jseiser!) ([#11222]; fixes [#11175])
* Added support for config merge and Deployment environment to
  `opentelemetry-collector` in the jaeger extension (thanks @iAnomaly!)
  ([#11283])

[#11283]: #11283
[#11222]: #11222
[#11175]: #11175
[#11343]: #11343
[#11342]: #11342

Signed-off-by: Matei David <[email protected]>
@mateiidavid mateiidavid mentioned this pull request Sep 22, 2023
mateiidavid added a commit that referenced this pull request Sep 22, 2023
* edge-29.9.3

This edge release updates the proxy's dependency on the `rustls` library to
patch security vulnerability [RUSTSEC-2023-0052]  (GHSA-8qv2-5vq6-g2g7), a
potential CPU usage denial-of-service attack when acceting a TLS handshake from
an untrusted peer with a maliciously-crafted certificate. Furthermore, this
edge release contains a few improvements to the control plane and jaeger
extension Helm charts.

* Addressed security vulnerability [RUSTSEC-2023-0052] in the proxy by updating
  its dependency on the `rustls` library
* Added a `prometheusUrl` field for the heartbeat job in the control plane Helm
  chart (thanks @david972!) ([#11343]; fixes [#11342])
* Introduced support for arbitrary labels in the `podMonitors` field in the
  control plane Helm chart (thanks @jseiser!) ([#11222]; fixes [#11175])
* Added support for config merge and Deployment environment to
  `opentelemetry-collector` in the jaeger extension (thanks @iAnomaly!)
  ([#11283])

[#11283]: #11283
[#11222]: #11222
[#11175]: #11175
[#11343]: #11343
[#11342]: #11342

Signed-off-by: Matei David <[email protected]>
adleong pushed a commit that referenced this pull request Feb 17, 2024
Need to be able to set labels on Pod Monitors

add a labels section to podMonitor

Helm Lint/Helm Template

Fixes #[11175]

Signed-off-by: Justin S <[email protected]>
@adleong adleong mentioned this pull request Feb 19, 2024
adleong added a commit that referenced this pull request Feb 20, 2024
This stable release back-ports bugfixes and improvements from recent edge
releases.

* Introduced support for arbitrary labels in the `podMonitors` field in the
  control plane Helm chart (thanks @jseiser!) ([#11222]; fixes [#11175])
* Added a `prometheusUrl` field for the heartbeat job in the control plane Helm
  chart (thanks @david972!) ([#11343]; fixes [#11342])
* Updated the Destination controller to return `INVALID_ARGUMENT` status codes
  properly when a `ServiceProfile` is requested for a service that does not
  exist. ([#11980])
* Reduced the load on the Destination controller by only processing Server
  updates on workloads affected by the Server ([#12017])
* Changed how updates to a `Server` selector are handled in the destination
  service. When a `Server` that marks a port as opaque no longer selects a
  resource, the resource's opaqueness will reverted to default settings
  ([#12031]; fixes [#11995])
* Fixed a race condition in the destination service that could cause panics
  under very specific conditions ([#12022]; fixes [#12010])
* Fixed an issue where inbound policy could be incorrect after certain policy
  resources are deleted ([#12088])

[#11222]: #11222
[#11175]: #11175
[#11343]: #11343
[#11342]: #11342
[#11980]: #11980
[#12017]: #12017
[#11995]: #11995
[#12031]: #12031
[#12010]: #12010
[#12022]: #12022
[#12088]: #12088

Signed-off-by: Alex Leong <[email protected]>
Signed-off-by: David ALEXANDRE <[email protected]>
Signed-off-by: Justin S <[email protected]>
Co-authored-by: Oliver Gould <[email protected]>
Co-authored-by: Alejandro Pedraza <[email protected]>
Co-authored-by: David ALEXANDRE <[email protected]>
Co-authored-by: Justin Seiser <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm linkerd-controler-plane Allow Custom labels on Pod Monitor
3 participants