-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 prometheus containr port name #1099
Conversation
pkg/webhook/patch.go
Outdated
@@ -401,6 +401,7 @@ func addContainerPort(pod *corev1.Pod, port int32, protocol string) *patchOperat | |||
|
|||
path := fmt.Sprintf("/spec/containers/%d/ports", i) | |||
containerPort := corev1.ContainerPort{ | |||
Name: "metrics", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function addContainerPort
is a generic one and not specific to the Prometheus port. What you probably should do is pass in the port name and specify the port name in the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liyinan926
Hello,
There is a suggestion for this. #1101
I would appreciate it if you could review it.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liyinan926 Added port name from caller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -3600,6 +3600,8 @@ spec: | |||
maximum: 49151 | |||
minimum: 1024 | |||
type: integer | |||
portName: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also needed in the ScheduledSparkApplication
CRD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liyinan926 Thanks, I updated it
* Add prometheus containr port name * jmx exporter port name can be added by caller * Add portName CRD to scheduled spark application
PodMonitor
is one of prometheus operator CRDs, and it collects metrics from pod selector.For collecting, it requires port name of metrics
https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#podmetricsendpoint
then, I have added metrics port name when mutating pod
it's example of
PodMonitor