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-33237: Run haproxy to connect to kas from data plane if noproxy settings contain kas #3999

Merged
merged 1 commit into from
May 9, 2024

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented May 8, 2024

Without this change, even if the kas is contained in no_proxy config we would deploy the adhoc kubernetes-default-proxy which would forward connections targetting kas pod through the proxy.

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 8, 2024
@openshift-ci-robot
Copy link

@enxebre: This pull request references Jira Issue OCPBUGS-33237, which is invalid:

  • expected the bug to target the "4.16.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:

Without this change, even if the kas is contained in no_proxy config we would deploy the adhoc kubernetes-default-proxy which would forward connections targetting kas pod through the proxy.

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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 openshift-eng/jira-lifecycle-plugin repository.

@enxebre
Copy link
Member Author

enxebre commented May 8, 2024

/hold
To understand better this scenario setup before shipping

@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 May 8, 2024
@enxebre
Copy link
Member Author

enxebre commented May 8, 2024

/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. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 8, 2024
@openshift-ci-robot
Copy link

@enxebre: This pull request references Jira Issue OCPBUGS-33237, 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.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from csrwng and hasueki May 8, 2024 11:43
@openshift-ci openshift-ci bot added area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels May 8, 2024
Copy link
Contributor

openshift-ci bot commented May 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre

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 May 8, 2024
for _, substr := range substrings {
if strings.Contains(s, substr) {
return true
}

Choose a reason for hiding this comment

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

The apiServerAddr can be an IP and spec.configuration.proxy.noProxy (ProxySpec) could be a CIDR/IP so that may need to be checked as well.

Copy link

netlify bot commented May 8, 2024

Deploy Preview for hypershift-docs ready!

Name Link
🔨 Latest commit f1504a3
🔍 Latest deploy log https://app.netlify.com/sites/hypershift-docs/deploys/663bac35608b3100084e2203
😎 Deploy Preview https://deploy-preview-3999--hypershift-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@enxebre enxebre force-pushed the kas-skip-proxy branch 2 times, most recently from d4dfca4 to 7b1327d Compare May 8, 2024 14:23
}

machineConfig := manifests.MachineConfigAPIServerHAProxy()
ignition.SetMachineConfigLabels(machineConfig)
serializedConfig, err := apiServerProxyConfig(haProxyImage, controlPlaneOperatorImage, apiServerExternalAddress, apiServerInternalAddress, apiServerExternalPort, apiServerInternalPort, apiserverProxy)
serializedConfig, err := apiServerProxyConfig(haProxyImage, controlPlaneOperatorImage, apiServerExternalAddress, apiServerInternalAddress, apiServerExternalPort, apiServerInternalPort, apiserverProxy, noProxy, hcluster.Spec.Networking.ServiceNetwork[0].CIDR.String(), hcluster.Spec.Networking.ClusterNetwork[0].CIDR.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are we checking that hcluster.Spec.Networking.ServiceNetwork is not zero-length?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is defaulted in the API, I can still add a safety check

if proxyAddr == "" {

// Check if no proxy contains any address that should result in skipping the system proxy
containsSubstring := func(s string, substrings ...string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use slices.ContainsFunc()?

@@ -0,0 +1 @@
zz_fixture_TestAPIServerHAProxyConfig.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Something went wrong here, should be serializing the config as YAML

Copy link
Member Author

Choose a reason for hiding this comment

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

they are syslinks and I think that's how GH represent the change

Copy link
Contributor

Choose a reason for hiding this comment

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

Did they get generated from UPDATE=true go test ./... ? I never saw symlinked fixtures before

Copy link
Member Author

Choose a reason for hiding this comment

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

nvm symlink was causing troubles so I recreated then with test

@enxebre enxebre force-pushed the kas-skip-proxy branch 5 times, most recently from b7a6c03 to 909d70f Compare May 8, 2024 16:38
@openshift-ci openshift-ci bot added area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/testing Indicates the PR includes changes for e2e testing labels May 8, 2024
Without this change, even if the kas is contained in no_proxy config we would deploy the adhoc kubernetes-default-proxy which would forward connections targetting kas pod through the proxy.
@enxebre
Copy link
Member Author

enxebre commented May 8, 2024

/test e2e-aws

@sjenning
Copy link
Contributor

sjenning commented May 8, 2024

/retest

@stevekuznetsov
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2024
@enxebre
Copy link
Member Author

enxebre commented May 9, 2024

/hold cancel

@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 May 9, 2024
@enxebre
Copy link
Member Author

enxebre commented May 9, 2024

/test e2e-azure

Copy link
Contributor

openshift-ci bot commented May 9, 2024

@enxebre: The following test 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-azure f1504a3 link false /test e2e-azure

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-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 905708a into openshift:main May 9, 2024
12 of 13 checks passed
@openshift-ci-robot
Copy link

@enxebre: Jira Issue OCPBUGS-33237: All pull requests linked via external trackers have merged:

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

In response to this:

Without this change, even if the kas is contained in no_proxy config we would deploy the adhoc kubernetes-default-proxy which would forward connections targetting kas pod through the proxy.

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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 openshift-eng/jira-lifecycle-plugin repository.

@enxebre enxebre removed area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/cli Indicates the PR includes changes for CLI area/testing Indicates the PR includes changes for e2e testing area/ci-tooling Indicates the PR includes changes for CI or tooling labels May 9, 2024
@celebdor
Copy link
Contributor

/cherry-pick release-4.15

@openshift-cherrypick-robot

@celebdor: new pull request created: #4014

In response to this:

/cherry-pick release-4.15

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-sigs/prow repository.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-05-14-095225

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. area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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

8 participants