-
Notifications
You must be signed in to change notification settings - Fork 94
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
Metrics: Add server for Egress IP/firewall #358
Metrics: Add server for Egress IP/firewall #358
Conversation
33177fe
to
8be36b1
Compare
8be36b1
to
8de163e
Compare
Forced pushed to group cache + mutex together in the same struct. |
pkg/network/master/metrics/server.go
Outdated
const ( | ||
shutdownTimeout = time.Millisecond * 50 | ||
endpoint = "/metrics" | ||
defaultBindAddress = "127.0.0.1:29102" |
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.
I was weighing up whether to bind to loopback or not. I went with loopback because it's an insecure HTTP server and I want to protect this server against exposure by mistake. This server will be exposed via RBAC proxy.
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.
Yes, loopback+rbac proxy is correct.
When this merges you also need to update dev-guide/host-port-registry.md
in openshift/enhancements
to reflect the fact that this port is now used by openshift-sdn-controller.
/assign @danwinship |
pkg/network/master/metrics/server.go
Outdated
const ( | ||
shutdownTimeout = time.Millisecond * 50 | ||
endpoint = "/metrics" | ||
defaultBindAddress = "127.0.0.1:29102" |
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.
Yes, loopback+rbac proxy is correct.
When this merges you also need to update dev-guide/host-port-registry.md
in openshift/enhancements
to reflect the fact that this port is now used by openshift-sdn-controller.
6f1cd9d
to
cfa0235
Compare
@danwinship The first iteration was poor. It wasn't a good idea to have a metric for egress firewall per namespace. I got rid of that and just keep a total count for egress firewall rules. If this merges, I will update the port number reservation in dev-guide/host-port-registry.md in repo openshift/enhancements. |
cfa0235
to
aae0a7b
Compare
Forced pushed to change default port from 29102 -> 29100 so as not to possibly conflict with ovn-k port. |
/retest |
1 similar comment
/retest |
/retest |
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.
/approve
general idea is good, needs a few tweaks, but then anyone can /lgtm it after that
6ae2f3b
to
1bc06d7
Compare
Add an insecure HTTP metrics server that serves metrics on loopback port 29100. Add metrics to count egress firewalls, egress firewall rules and egress IPs count. Signed-off-by: Martin Kennelly <mkennell@redhat.com>
1bc06d7
to
e909174
Compare
@danwinship I made the changes you requested - ENP metric, renamed file, and unit tests. I also noticed an error I made in the original code you reviewed. I made the mistake of checking if interface{} was nil for func parameter |
/retest |
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 really an lgtm, I just had a small nit that I wanted to give you time to decide what to do about (and if I put a real lgtm, the bot will merge the PR). Let me know
var metricEgressIPCount = prometheus.NewGauge(prometheus.GaugeOpts{ | ||
Namespace: metricSDNNamespace, | ||
Subsystem: metricSDNSubsystemController, | ||
Name: "num_egress_ips", |
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.
Very small nit (you can discard it and slightest hesitation): call it num_assigned_egress_ips
as to not confuse it with the number of egress IP objects
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.
Id love to change it to what you suggested but I want to keep this name consistent with OVN-K and that PR is merged. Its not worth it for me to rename it now.
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.
Understood then :)
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexanderConstantinescu, danwinship, martinkennelly 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 |
Add an insecure HTTP metrics server that serves
metrics on loopback port 29100.
Add metrics to count egress firewalls,
egress firewall rules and egress IPs count.
In order to validate the metrics:
Metric
num_egress_ips
:Metric
num_egress_firewall_rules
:Metric
num_egress_firewalls
:Signed-off-by: Martin Kennelly mkennell@redhat.com