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

Corner Case: upstream name duplication causing ingress pointing to wrong service #11937

Closed
Revolution1 opened this issue Sep 6, 2024 · 7 comments
Labels
kind/support Categorizes issue or PR as a support question. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@Revolution1
Copy link

Version: v1.10.1 (but this bug exists in the latest main branch)

Let's say we have 2 ingress-paths:

  1. points to backend: service.name: example, service.port.name: service-rpc
  2. points to backend: service.name: example-service, serivce.port.name: rpc

In the ingress controller, they will be converted to upstream name by func upstreamName

// upstreamName returns a formatted upstream name based on namespace, service, and port
func upstreamName(namespace string, service *networking.IngressServiceBackend) string {
if service != nil {
if service.Port.Number > 0 {
return fmt.Sprintf("%s-%s-%d", namespace, service.Name, service.Port.Number)
}
if service.Port.Name != "" {
return fmt.Sprintf("%s-%s-%s", namespace, service.Name, service.Port.Name)
}
}
return fmt.Sprintf("%s-INVALID", namespace)
}

The output for path 1 and 2 with be the same example-service-rpc

Which makes one of the path points to wrong backend.

@Revolution1 Revolution1 added the kind/bug Categorizes issue or PR as related to a bug. label Sep 6, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 6, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@Revolution1 Revolution1 changed the title Corner Case: backend duplication causing ingress pointing to wrong service Corner Case: upstream name duplication causing ingress pointing to wrong service Sep 6, 2024
@longwuyuan
Copy link
Contributor

/remove-kind bug

  • A short text description is not a bug so removing bug label
  • See the template of a new bug report and edit your issue description to answer the questions that are asked in a new bug report, in markdown format
  • Show a step-by-step detailed guide to reproduce the problem
    • Create a kind cluster
    • Install ingress-nginx controller in it
    • Create a deployment using image nginx:alpine
    • Create a deployment using image httpd:alpine
    • Create the services and ingresses
    • Show the curl command outputs
    • show the kubectl describe of all related resources
    • show the logs
    • show all data and explain the bug in this practical environment

/kind support
/triage needs-information

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. triage/needs-information Indicates an issue needs more information in order to work on it. and removed kind/bug Categorizes issue or PR as related to a bug. labels Sep 6, 2024
@Revolution1
Copy link
Author

Revolution1 commented Sep 6, 2024

@longwuyuan Okay, will change.
Btw, Is this report not clear enough or you're actually a bot that can only read text scrictly obey the template?

@Revolution1
Copy link
Author

the template also got some bugs in it
image

@Revolution1
Copy link
Author

link to: #11938

@longwuyuan
Copy link
Contributor

/close

Duplicate of #11938

@k8s-ci-robot
Copy link
Contributor

@longwuyuan: Closing this issue.

In response to this:

/close

Duplicate of #11938

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
Development

No branches or pull requests

3 participants