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

Making Kube service appProtocol field optional #7873

Merged

Conversation

admgolovin
Copy link
Contributor

@admgolovin admgolovin commented Nov 2, 2021

What this PR does / why we need it:

This PR is making the appProtocol field of the Nginx ingress controller definition optional.

That is needed as not all Cloud providers could correctly work with it.
For example here is what happens when we expose our Nginx ingress-controller Kubernetes service through IBM Cloud NLB instance:

Events:
  Type     Reason                           Age                From                Message
  ----     ------                           ----               ----                -------
  Normal   EnsuringLoadBalancer             13s (x3 over 28s)  service-controller  Ensuring load balancer
  Warning  CreatingCloudLoadBalancerFailed  13s (x3 over 28s)  ibm-cloud-provider  Error on cloud load balancer afd6a32934ebe4cc89b782a88c9dea3a for service kube-system/nginx-ingress-dal10-3157072-controller-exp with UID fd6a3293-4ebe-4cc8-9b78-2a88c9dea3a8: Service configuration is not supported: application protocol
  Warning  SyncLoadBalancerFailed           13s (x3 over 28s)  service-controller  Error syncing load balancer: failed to ensure load balancer: Error on cloud load balancer afd6a32934ebe4cc89b782a88c9dea3a for service kube-system/nginx-ingress-dal10-3157072-controller-exp with UID fd6a3293-4ebe-4cc8-9b78-2a88c9dea3a8: Service configuration is not supported: application protocol

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

How Has This Been Tested?

Here is an example of the Nginx ingress Kubernetes service that is failing:

apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: nginx-ingress
    meta.helm.sh/release-namespace: kube-system
    service.kubernetes.io/ibm-load-balancer-cloud-provider-enable-features: ipvs
    service.kubernetes.io/ibm-load-balancer-cloud-provider-ip-type: public
    service.kubernetes.io/ibm-load-balancer-cloud-provider-scheduler: rr
    service.kubernetes.io/ibm-load-balancer-cloud-provider-vlan: <vlan>
    service.kubernetes.io/ibm-load-balancer-cloud-provider-zone: <zone>
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: nginx-ingress
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/version: 1.0.4
    helm.sh/chart: ingress-nginx-4.0.6
    loadBalancerType: main
    nlbVersion: "2"
  name: nginx-ingress-dal10-3157072-controller-exp
  namespace: kube-system
spec:
  externalTrafficPolicy: Local
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
    appProtocol: http
  - name: https
    port: 443
    protocol: TCP
    targetPort: https
    appProtocol: https
  selector:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: nginx-ingress-dal10-3157072
    app.kubernetes.io/name: ingress-nginx
  sessionAffinity: None
  type: LoadBalancer

If we remove the appProtocol field, an IBM Cloud NLB instance will be created successfully for the Nginx ingress-controller service.
We also tried to roll back into the 4.0.0 version of the Nginx ingress-controller chart (before the appProtocol field was released). And it is working for us.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 2, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @admgolovin!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Nov 2, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @admgolovin. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 2, 2021
@k8s-ci-robot k8s-ci-robot added the area/helm Issues or PRs related to helm charts label Nov 2, 2021
@longwuyuan
Copy link
Contributor

Does "optional" imply that the field is not set (by default to http/https) ?

@allen-servedio
Copy link

This feature was added in #7493. Even the author of that feature stated:

This is a minor change to make the deployment more semantic - although there is no particular reason to require this at this current time, having ports identify themselves makes life easier for any extensions / metrics scrapers / projects in future.

We have identified an edge case where this actually breaks things and so need to turn it off. So, in this case, the optionality of the feature is to have it on by default per the original author's intent with the ability to turn it off if needed @longwuyuan

@longwuyuan
Copy link
Contributor

longwuyuan commented Nov 3, 2021

Can this be tested without IBM-Cloud. Say at least on a kind cluster. It would be appropriate to run at least some kind of tests, that assured non IBM-Cloud users don't see any impact at all.

@longwuyuan
Copy link
Contributor

Also, if it is not too much trouble, then request that you create a issue and link it here. so that the issue tracks the details of the related information, for future searches. thanks. Sometimes directly creating PR seems ok but in my opinion, this one should have a issue that details the entire story with full specifics

@admgolovin
Copy link
Contributor Author

Closes #7885

@admgolovin
Copy link
Contributor Author

@longwuyuan That chart has been tested in the AWS EKS cluster as well. There are no breaking changes since those appProtocol fields are included in the Kubernetes service definition by default. We are just adding the ability to disable them if they don't needed.

@strongjz
Copy link
Member

strongjz commented Nov 9, 2021

/check-cla
/triage accepted
/kind feature
/area helm
/priority important-longterm
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Nov 9, 2021
@k8s-ci-robot k8s-ci-robot removed the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Nov 9, 2021
@admgolovin admgolovin force-pushed the fix/app-protocol-chart-value branch 2 times, most recently from b187378 to 3bc713d Compare November 22, 2021 18:52
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 22, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2021
@k8s-ci-robot
Copy link
Contributor

@admgolovin: 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
pull-ingress-nginx-boilerplate 7ef34b3 link true /test pull-ingress-nginx-boilerplate

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@admgolovin admgolovin force-pushed the fix/app-protocol-chart-value branch 2 times, most recently from 6124355 to 78713d5 Compare November 22, 2021 19:15
@admgolovin
Copy link
Contributor Author

@cpanato The rebase is done. All excessive commits have been squashed.

@rikatz
Copy link
Contributor

rikatz commented Nov 23, 2021

argh sorry @admgolovin my bad!

We have just released a new version and there is another conflict.

Please fix both, and ping me (here or in Slack) so we can release this and fix the problem in IBM Cloud ASAP.

Thanks

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 25, 2021
@admgolovin
Copy link
Contributor Author

@cpanato @rikatz The rebase is complete. PR is ready for merge.

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 26, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: admgolovin, cpanato

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 26, 2021
@k8s-ci-robot k8s-ci-robot merged commit 5a5bff1 into kubernetes:main Nov 26, 2021
rchshld pushed a commit to joomcode/ingress-nginx that referenced this pull request May 19, 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. area/docs area/helm Issues or PRs related to helm charts cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants