Skip to content

Conversation

SzucsAti
Copy link
Contributor

@SzucsAti SzucsAti commented Jul 25, 2022

On IBMCloud users can set a loadbalancer annotation to enable proxy protocol on the loadbalancer:
service.kubernetes.io/ibm-load-balancer-cloud-provider-enable-features: "proxy-protocol"
https://cloud.ibm.com/docs/containers?topic=containers-vpc-lbaas

With this PR users can configure proxy protocol on the ingresscontroller custom resource. Cluster-ingress-operator will read the value of this field and configure the loadbalancer accordingly.

  endpointPublishingStrategy:
    loadBalancer:
      providerParameters:
        type: IBM
        ibm:
          protocol: PROXY
      scope: External
    type: LoadBalancerService

This PR is based on an other PR which is not yet merged, it implements IBMLoadBalancerParameters:
#1208

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 25, 2022

Hello @SzucsAti! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

For merging purposes, this repository follows the no-Feature-Freeze process which means that in addition to the standard lgtm and approved labels this repository requires either:

bugzilla/valid-bug - applied if your PR references a valid bugzilla bug

OR

qe-approved, docs-approved, and px-approved - these labels can be applied by anyone in the openshift org via the /label command.

Who should apply these qe/docs/px labels?

  • For a no-Feature-Freeze team who is merging a feature before code freeze, they need to get those labels applied to their api repo PR by the appropriate teams (i.e. qe, docs, px)
  • For a Feature Freeze (traditional) team who is merging a feature before FF, they can self-apply the labels (via /label commands), they are basically irrelevant for those teams
  • For a Feature Freeze team who is merging a feature after FF, the PR should be rejected barring an exception

@SzucsAti
Copy link
Contributor Author

/test verify

@SzucsAti
Copy link
Contributor Author

/assign

@SzucsAti SzucsAti removed their assignment Jul 26, 2022
@SzucsAti
Copy link
Contributor Author

/assign @deads2k @soltysh

@SzucsAti SzucsAti force-pushed the proxy-protocol branch 3 times, most recently from 6d2e3a3 to 40d91c3 Compare October 5, 2022 13:13
@SzucsAti SzucsAti changed the title Add proxy protocol support to IBMLoadBalancerParameters NE-1091: Add proxy protocol support to IBMLoadBalancerParameters Oct 21, 2022
type ProviderLoadBalancerParameters struct {
// type is the underlying infrastructure provider for the load balancer.
// Allowed values are "AWS", "Azure", "BareMetal", "GCP", "Nutanix",
// Allowed values are "AWS", "Azure", "BareMetal", "GCP", "IBM", "Nutanix",
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the change to the discriminator enum to allow this? Can't see a change to LoadBalancerProviderType included here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was already changed here: https://github.com/openshift/api/blob/master/operator/v1/types_ingress.go#L473-#L490. Comment was not up to date.

// protocol specifies whether the load balancer uses PROXY protocol to forward connections to
// the IngressController. See "service.kubernetes.io/ibm-load-balancer-cloud-provider-enable-features:
// "proxy-protocol"" at https://cloud.ibm.com/docs/containers?topic=containers-vpc-lbaas"

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this blank line expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not expected, fixed.

@JoelSpeed
Copy link
Contributor

The changes to the API look good here but, given the proximity to branch cuts, I'd like to see a QE approval of the feature before we merge this

/hold

@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 Oct 24, 2022
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 23, 2023
@SzucsAti
Copy link
Contributor Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 23, 2023
Comment on lines 604 to 611
// The following values are valid for this field:
//
// * The empty string.
// * "TCP".
// * "PROXY".
//
// The empty string specifies the default, which is TCP without PROXY
// protocol. Note that the default is subject to change.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to update the wording to be consistent with our standard wording on other APIs

Suggested change
// The following values are valid for this field:
//
// * The empty string.
// * "TCP".
// * "PROXY".
//
// The empty string specifies the default, which is TCP without PROXY
// protocol. Note that the default is subject to change.
// Valid values for protocol and TCP, PROXY and omitted.
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
// The current default is TCP, without the proxy protocol enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, applied your suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

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

@JoelSpeed, should we update the godoc on the other protocol fields likewise? I can get that in a follow-up if you like.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah a follow up would be great if you can, thanks

Comment on lines 613 to 608
// +kubebuilder:validation:Optional
// +optional
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need both versions of this, just +optional will suffice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed // +kubebuilder:validation:Optional.

Co-authored-by: Vincent Burckhardt <vincent.burckhardt@ie.ibm.com>
@JoelSpeed
Copy link
Contributor

API looks good, have you run through any pre-merge validation with the QE team? Could we look to get their ack on this feature?

@candita
Copy link
Contributor

candita commented Feb 1, 2023

/assign @Miciah
/assign @gcs278

@lihongan
Copy link
Contributor

lihongan commented Feb 2, 2023

For pre-merge validation, I think we have no chance to test the api directly.
Can anyone help to create PR to cluster-ingress-operator with the API bump? then QE can do pre-merge validation with the two PRs.
cc @SzucsAti @Miciah

@candita
Copy link
Contributor

candita commented Feb 2, 2023

For pre-merge validation, I think we have no chance to test the api directly. Can anyone help to create PR to cluster-ingress-operator with the API bump? then QE can do pre-merge validation with the two PRs. cc @SzucsAti @Miciah

@SzucsAti can you confirm that openshift/cluster-ingress-operator#812 is a PR that can be used to do pre-merge validation?

@attiss
Copy link

attiss commented Feb 2, 2023

Hi @lihongan @candita,

Yes, openshift/cluster-ingress-operator#812 is the correct PR for pre-merge validations.

@lihongan
Copy link
Contributor

lihongan commented Feb 3, 2023

@attiss thanks for confirming. Looks openshift/cluster-ingress-operator#812 needs rebase and some checks were failed.
Anyway, I'll have a try to see if I can build payload with the two PRs.

@lihongan
Copy link
Contributor

lihongan commented Feb 3, 2023

Oops, cannot build the payload with cluster-bot and it reports:

pull request openshift/cluster-ingress-operator#812 needs to be rebased to branch master

so the rebase is mandatory

@SzucsAti
Copy link
Contributor Author

SzucsAti commented Feb 3, 2023

@lihongan
Copy link
Contributor

lihongan commented Feb 7, 2023

tested with pre-merge validation and passed

$ oc get clusterversion
NAME      VERSION                                                   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.13.0-0.ci.test-2023-02-07-013419-ci-ln-k91zc62-latest   True        False         139m    Cluster version is 4.13.0-0.ci.test-2023-02-07-013419-ci-ln-k91zc62-latest

### after updating the ingresscontroller/default and got 
$ oc -n openshift-ingress-operator get ingresscontroller/default -oyaml
<---snip-->
spec:
  endpointPublishingStrategy:
    loadBalancer:
      dnsManagementPolicy: Managed
      providerParameters:
        ibm:
          protocol: PROXY
        type: IBM
      scope: External
    type: LoadBalancerService
<------>
status:
  domain: apps.hongli-ibm.ibmcloud.qe.devcluster.openshift.com
  endpointPublishingStrategy:
    loadBalancer:
      dnsManagementPolicy: Managed
      providerParameters:
        ibm:
          protocol: PROXY
        type: IBM
      scope: External
    type: LoadBalancerService
<------>

### ensure router pods use PROXY protocol
$ oc -n openshift-ingress get deployment/router-default -oyaml
<---snip--->
        - name: ROUTER_USE_PROXY_PROTOCOL
          value: "true"

### ensure the proxy-protocol annotation is added to the LB service 
$ oc -n openshift-ingress get svc/router-default -oyaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.kubernetes.io/ibm-load-balancer-cloud-provider-enable-features: proxy-protocol
    service.kubernetes.io/ibm-load-balancer-cloud-provider-ip-type: public
<---snip--->

### ensure routes and ingress operator work well
$ curl https://canary-openshift-ingress-canary.apps.hongli-ibm.ibmcloud.qe.devcluster.openshift.com -k
Healthcheck requested
 
$ oc get co/ingress
NAME      VERSION                                                   AVAILABLE   PROGRESSING   DEGRADED   SINCE   MESSAGE
ingress   4.13.0-0.ci.test-2023-02-07-013419-ci-ln-k91zc62-latest   True        False         False      153m    

@lihongan
Copy link
Contributor

lihongan commented Feb 7, 2023

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Feb 7, 2023
@Miciah
Copy link
Contributor

Miciah commented Feb 7, 2023

/lgtm
/hold cancel
@JoelSpeed, are you ready to approve the API change?

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 7, 2023
@ahardin-rh
Copy link

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Feb 7, 2023
@CFields651
Copy link

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Feb 7, 2023
@gcs278
Copy link
Contributor

gcs278 commented Feb 7, 2023

/lgtm

1 similar comment
@JoelSpeed
Copy link
Contributor

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gcs278, JoelSpeed, Miciah, SzucsAti

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 Feb 7, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 7, 2023

@SzucsAti: all tests passed!

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.

@openshift-merge-robot openshift-merge-robot merged commit 3961c9d into openshift:master Feb 7, 2023
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. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.