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

OCPBUGS-4573: Target metrics port by name in internal service #864

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Dec 10, 2022

ensureInternalIngressControllerService: Reformat

Reformat ensureInternalIngressControllerService to follow the standard pattern for "ensure" functions.

  • pkg/operator/controller/ingress/controller.go (ensureIngressController): Expect a Boolean return value from ensureInternalIngressControllerService, indicating whether the service exists.
  • pkg/operator/controller/ingress/internal_service.go (ensureInternalIngressControllerService): Add a Boolean return value. Use a switch statement, and add a to-do comment for handling updates.
    (currentInternalIngressControllerService): Add a Boolean return value.

ensureInternalIngressControllerService: Updates

Add logic to ensureInternalIngressControllerService to update the service when an update is required.

  • pkg/operator/controller/ingress/internal_service.go (ensureInternalIngressControllerService): Use the new updateInternalService method to update the service as needed.
    (updateInternalService): Check whether the given ClusterIP service needs to be updated, and update it if so, using the new internalServiceChanged function.
    (managedInternalServiceAnnotations): New variable with the set of annotation keys for annotations that the operator manages for its internal router services.
    (internalServiceChanged): New function. Check whether the current internal service needs to be updated, and update it if it does, using the new managedInternalServiceAnnotations variable.
  • pkg/operator/controller/ingress/internal_service_test.go: New file.
    (Test_desiredInternalIngressControllerService): New test. Verify that desiredInternalIngressControllerService returns the expected service.
    (Test_internalServiceChanged): New test. Verify that internalServiceChanged correctly detects changes and performs updates.

service-internal.yaml: Target metrics port by name

Use the "metrics" port name instead of port number 1936 for the router internal service's metrics port's target.

Before this change, the router's internal service's metrics port always targeted port 1936 on the router pod. However, the router pod's metrics port can be customized, and so it is not necessarily port 1936. As a consequence, the service's metrics port didn't work when the router pod's metrics port was customized. The router pod's metrics port always has the name "metrics", so this PR changes the service to reference the port by name to avoid breaking when the port number changes.

Follow-up to #694..

  • assets/router/service-internal.yaml: Use the "metrics" port name instead of port 1936 for the metrics port's target.
  • pkg/manifests/bindata.go: Regenerate.
  • pkg/operator/controller/ingress/internal_service_test.go (Test_desiredInternalIngressControllerService): Expect the metrics port to reference the "metrics" target port by name.
    (Test_internalServiceChanged): Add a test case for changing the "metrics" port's target port from an integer to a string.

Reformat ensureInternalIngressControllerService to follow the standard
pattern for "ensure" functions.

* pkg/operator/controller/ingress/controller.go (ensureIngressController):
Expect a Boolean return value from ensureInternalIngressControllerService,
indicating whether the service exists.
* pkg/operator/controller/ingress/internal_service.go
(ensureInternalIngressControllerService): Add a Boolean return value.  Use
a switch statement, and add a to-do comment for handling updates.
(currentInternalIngressControllerService): Add a Boolean return value.
Add logic to ensureInternalIngressControllerService to update the service
when an update is required.

* pkg/operator/controller/ingress/internal_service.go
(ensureInternalIngressControllerService): Use the new updateInternalService
method to update the service as needed.
(updateInternalService): Check whether the given ClusterIP service needs to
be updated, and update it if so, using the new internalServiceChanged
function.
(managedInternalServiceAnnotations): New variable with the set of
annotation keys for annotations that the operator manages for its internal
router services.
(internalServiceChanged): New function.  Check whether the current internal
service needs to be updated, and update it if it does, using the new
managedInternalServiceAnnotations variable.
* pkg/operator/controller/ingress/internal_service_test.go: New file.
(Test_desiredInternalIngressControllerService): New test.  Verify that
desiredInternalIngressControllerService returns the expected service.
(Test_internalServiceChanged): New test.  Verify that
internalServiceChanged correctly detects changes and performs updates.
@openshift-ci-robot openshift-ci-robot added the jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. label Dec 10, 2022
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Jira Issue OCPBUGS-4573, which is invalid:

  • expected the bug to target the "4.13.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

ensureInternalIngressControllerService: Reformat

Reformat ensureInternalIngressControllerService to follow the standard pattern for "ensure" functions.

  • pkg/operator/controller/ingress/controller.go (ensureIngressController): Expect a Boolean return value from ensureInternalIngressControllerService, indicating whether the service exists.
  • pkg/operator/controller/ingress/internal_service.go (ensureInternalIngressControllerService): Add a Boolean return value. Use a switch statement, and add a to-do comment for handling updates.
    (currentInternalIngressControllerService): Add a Boolean return value.

ensureInternalIngressControllerService: Updates

Add logic to ensureInternalIngressControllerService to update the service when an update is required.

  • pkg/operator/controller/ingress/internal_service.go (ensureInternalIngressControllerService): Use the new updateInternalService method to update the service as needed.
    (updateInternalService): Check whether the given ClusterIP service needs to be updated, and update it if so, using the new internalServiceChanged function.
    (managedInternalServiceAnnotations): New variable with the set of annotation keys for annotations that the operator manages for its internal router services.
    (internalServiceChanged): New function. Check whether the current internal service needs to be updated, and update it if it does, using the new managedInternalServiceAnnotations variable.
  • pkg/operator/controller/ingress/internal_service_test.go: New file.
    (Test_desiredInternalIngressControllerService): New test. Verify that desiredInternalIngressControllerService returns the expected service.
    (Test_internalServiceChanged): New test. Verify that internalServiceChanged correctly detects changes and performs updates.

service-internal.yaml: Target metrics port by name

Use the "metrics" port name instead of port number 1936 for the router internal service's metrics port's target.

Before this change, the router's internal service's metrics port always targeted port 1936 on the router pod. However, the router pod's metrics port can be customized, and so it is not necessarily port 1936. As a consequence, the service's metrics port didn't work when the router pod's metrics port was customized. The router pod's metrics port always has the name "metrics", so this PR changes the service to reference the port by name to avoid breaking when the port number changes.

Follow-up to #694..

  • assets/router/service-internal.yaml: Use the "metrics" port name instead of port 1936 for the metrics port's target.
  • pkg/manifests/bindata.go: Regenerate.
  • pkg/operator/controller/ingress/internal_service_test.go (Test_desiredInternalIngressControllerService): Expect the metrics port to reference the "metrics" target port by name.
    (Test_internalServiceChanged): Add a test case for changing the "metrics" port's target port from an integer to a string.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Dec 10, 2022
@Miciah
Copy link
Contributor Author

Miciah commented Dec 10, 2022

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Dec 10, 2022
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Jira Issue OCPBUGS-4573, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.13.0) matches configured target version for branch (4.13.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lihongan

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Dec 10, 2022
@openshift-ci openshift-ci bot requested a review from lihongan December 10, 2022 00:55
@Miciah
Copy link
Contributor Author

Miciah commented Dec 11, 2022

/retest-required

@candita
Copy link
Contributor

candita commented Dec 14, 2022

/assign @frobware

@frobware
Copy link
Contributor

frobware commented Jan 3, 2023

/retest

@Miciah Miciah force-pushed the OCPBUGS-4573-service-internal-dot-yaml-target-metrics-port-by-name branch from 34d3af4 to c44b72f Compare January 3, 2023 16:43
@frobware
Copy link
Contributor

frobware commented Jan 5, 2023

/retest

@frobware
Copy link
Contributor

frobware commented Jan 5, 2023

{  openshift cluster install failed with cluster bootstrap}

/test e2e-gcp-ovn-serial

@candita
Copy link
Contributor

candita commented Jan 9, 2023

/test e2e-gcp-ovn-serial

Use the "metrics" port name instead of port number 1936 for the router
internal service's metrics port's target.

Before this commit, the router's internal service's metrics port always
targeted port 1936 on the router pod.  However, the router pod's metrics
port can be customized, and so it is not necessarily port 1936.  As a
consequence, the service's metrics port didn't work when the router pod's
metrics port was customized.  The router pod's metrics port always has the
name "metrics", so this commit changes the service to reference the port by
name to avoid breaking when the port number changes.

This commit fixes OCPBUGS-4573.

https://issues.redhat.com/browse/OCPBUGS-4573

Follow-up to commit af653f9.

* assets/router/service-internal.yaml: Use the "metrics" port name instead
of port 1936 for the metrics port's target.
* pkg/manifests/bindata.go: Regenerate.
* pkg/operator/controller/ingress/internal_service_test.go
(Test_desiredInternalIngressControllerService): Expect the metrics port to
reference the "metrics" target port by name.
(Test_internalServiceChanged): Add a test case for changing the "metrics"
port's target port from an integer to a string.
@Miciah Miciah force-pushed the OCPBUGS-4573-service-internal-dot-yaml-target-metrics-port-by-name branch from c44b72f to 9c6e368 Compare January 10, 2023 00:02
@frobware
Copy link
Contributor

{  1 events happened too frequently

event happened 21 times, something is wrong: node/ci-op-rz7hm0sh-9dec8-5hnrs-worker-c-bx756 - reason/ErrorReconcilingNode roles/worker [k8s.ovn.org/node-chassis-id annotation not found for node ci-op-rz7hm0sh-9dec8-5hnrs-worker-c-bx756, macAddress annotation not found for node "ci-op-rz7hm0sh-9dec8-5hnrs-worker-c-bx756" , k8s.ovn.org/l3-gateway-config annotation not found for node "ci-op-rz7hm0sh-9dec8-5hnrs-worker-c-bx756"]}

/retest-required

@frobware
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2023
@frobware
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frobware

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 13, 2023
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 560b2d3 and 2 for PR HEAD 9c6e368 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD dc49def and 1 for PR HEAD 9c6e368 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD fc69408 and 0 for PR HEAD 9c6e368 in total

@candita
Copy link
Contributor

candita commented Jan 13, 2023

/test ?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 13, 2023

@candita: The following commands are available to trigger required jobs:

  • /test e2e-aws-operator
  • /test e2e-aws-ovn
  • /test e2e-aws-ovn-serial
  • /test e2e-aws-ovn-upgrade
  • /test e2e-azure-operator
  • /test e2e-gcp-operator
  • /test images
  • /test unit
  • /test verify

The following commands are available to trigger optional jobs:

  • /test e2e-aws-ovn-single-node
  • /test e2e-azure-ovn
  • /test e2e-gcp-ovn

Use /test all to run all jobs.

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@candita
Copy link
Contributor

candita commented Jan 13, 2023

/test e2e-gcp-ovn

@candita
Copy link
Contributor

candita commented Jan 13, 2023

/test e2e-aws-ovn-serial

@openshift-ci-robot
Copy link
Contributor

/hold

Revision 9c6e368 was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 14, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2023

@Miciah: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ovn-serial 9c6e368 link true /test e2e-gcp-ovn-serial
ci/prow/e2e-azure-ovn 9c6e368 link false /test e2e-azure-ovn
ci/prow/e2e-gcp-ovn 9c6e368 link false /test e2e-gcp-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Miciah
Copy link
Contributor Author

Miciah commented Jan 19, 2023

/hold cancel
/retest-required

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 19, 2023
@openshift-merge-robot openshift-merge-robot merged commit 2c30c06 into openshift:master Jan 19, 2023
@openshift-ci-robot
Copy link
Contributor

@Miciah: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-4573 has been moved to the MODIFIED state.

In response to this:

ensureInternalIngressControllerService: Reformat

Reformat ensureInternalIngressControllerService to follow the standard pattern for "ensure" functions.

  • pkg/operator/controller/ingress/controller.go (ensureIngressController): Expect a Boolean return value from ensureInternalIngressControllerService, indicating whether the service exists.
  • pkg/operator/controller/ingress/internal_service.go (ensureInternalIngressControllerService): Add a Boolean return value. Use a switch statement, and add a to-do comment for handling updates.
    (currentInternalIngressControllerService): Add a Boolean return value.

ensureInternalIngressControllerService: Updates

Add logic to ensureInternalIngressControllerService to update the service when an update is required.

  • pkg/operator/controller/ingress/internal_service.go (ensureInternalIngressControllerService): Use the new updateInternalService method to update the service as needed.
    (updateInternalService): Check whether the given ClusterIP service needs to be updated, and update it if so, using the new internalServiceChanged function.
    (managedInternalServiceAnnotations): New variable with the set of annotation keys for annotations that the operator manages for its internal router services.
    (internalServiceChanged): New function. Check whether the current internal service needs to be updated, and update it if it does, using the new managedInternalServiceAnnotations variable.
  • pkg/operator/controller/ingress/internal_service_test.go: New file.
    (Test_desiredInternalIngressControllerService): New test. Verify that desiredInternalIngressControllerService returns the expected service.
    (Test_internalServiceChanged): New test. Verify that internalServiceChanged correctly detects changes and performs updates.

service-internal.yaml: Target metrics port by name

Use the "metrics" port name instead of port number 1936 for the router internal service's metrics port's target.

Before this change, the router's internal service's metrics port always targeted port 1936 on the router pod. However, the router pod's metrics port can be customized, and so it is not necessarily port 1936. As a consequence, the service's metrics port didn't work when the router pod's metrics port was customized. The router pod's metrics port always has the name "metrics", so this PR changes the service to reference the port by name to avoid breaking when the port number changes.

Follow-up to #694..

  • assets/router/service-internal.yaml: Use the "metrics" port name instead of port 1936 for the metrics port's target.
  • pkg/manifests/bindata.go: Regenerate.
  • pkg/operator/controller/ingress/internal_service_test.go (Test_desiredInternalIngressControllerService): Expect the metrics port to reference the "metrics" target port by name.
    (Test_internalServiceChanged): Add a test case for changing the "metrics" port's target port from an integer to a string.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Miciah
Copy link
Contributor Author

Miciah commented Apr 24, 2023

/cherry-pick release-4.12

@openshift-cherrypick-robot

@Miciah: new pull request created: #910

In response to this:

/cherry-pick release-4.12

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants