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

inherit nodeReporterPort from felixconfig #1227

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

ozdanborne
Copy link
Member

@ozdanborne ozdanborne commented Mar 12, 2021

Description

Some of our users are setting the PrometheusReporterPort in FelixConfiguration (Enterprise) to prevent port conflicts with other services on their hosts. That felixconfig option gets overwritten by the env var Operator sets.

This PR enables Operator to check if the value is set in the FelixConfiguration and use that value instead of its hardcoded default.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

Copy link
Member

@tmjd tmjd left a comment

Choose a reason for hiding this comment

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

Looking good, maybe one validation to add to the controller?

pkg/controller/installation/core_controller.go Outdated Show resolved Hide resolved
pkg/render/node.go Show resolved Hide resolved
@ozdanborne ozdanborne force-pushed the configurable-noderporter-port branch from 53ba19c to e492dff Compare March 15, 2021 13:57

if nodeReporterMetricsPort == 0 {
err := errors.New("felixConfiguration prometheusReporterPort=0 not supported")
r.SetDegraded("", err, reqLogger)
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to have something in the 1st field because that is the Degraded "reason", I think saying "Invalid metrics port" would work and you can keep the error message as you have it.

@ozdanborne ozdanborne force-pushed the configurable-noderporter-port branch from 66738d5 to babde82 Compare March 15, 2021 16:50
@tmjd tmjd added enterprise Feature applies to enterprise only kind/enhancement New feature or request labels Mar 15, 2021
Copy link
Member

@tmjd tmjd left a comment

Choose a reason for hiding this comment

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

LGTM

@ozdanborne ozdanborne merged commit 0284fd7 into tigera:master Mar 15, 2021
@ozdanborne ozdanborne deleted the configurable-noderporter-port branch March 15, 2021 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-pr-required enterprise Feature applies to enterprise only kind/enhancement New feature or request release-note-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants