Skip to content

Conversation

@AlinsRan
Copy link
Contributor

@AlinsRan AlinsRan commented Oct 23, 2025

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

Adds support for the following ingress-annotation keys for upstream configuration:

  • k8s.apisix.apache.org/upstream-scheme → sets the upstream scheme (http / https / grpc / grpcs)
  • k8s.apisix.apache.org/upstream-retries → sets the number of retry attempts on upstream errors
  • k8s.apisix.apache.org/upstream-connect-timeout → sets the connect timeout for upstream requests
  • k8s.apisix.apache.org/upstream-read-timeout → sets the read timeout for upstream responses
  • k8s.apisix.apache.org/upstream-send-timeout → sets the send/write timeout for upstream requests

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@AlinsRan AlinsRan marked this pull request as ready for review October 23, 2025 00:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for configuring upstream connection parameters (scheme, retries, and timeouts) via ingress annotations. Previously, these annotations were listed as unsupported; now they are fully implemented.

  • Adds annotation parsing for upstream-scheme, upstream-retries, and upstream timeout settings
  • Implements translator logic to apply these settings to upstream configurations
  • Provides comprehensive test coverage for the new annotation functionality

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/e2e/ingress/annotations.go Adds e2e tests verifying retries, scheme, and timeout annotations work correctly
test/e2e/framework/manifests/nginx.yaml Adds /delay endpoint and additional HTTPS port for testing timeout behavior
internal/webhook/v1/ingress_webhook.go Removes upstream-related annotations from unsupported list
internal/adc/translator/ingress.go Integrates annotation parsing into ingress translation pipeline and applies settings to upstreams
internal/adc/translator/annotations_test.go Adds unit tests for ingress annotation translation logic
internal/adc/translator/annotations/upstream/upstream_test.go Adds unit tests for upstream annotation parser
internal/adc/translator/annotations/upstream/upstream.go Implements parser for upstream-related annotations
internal/adc/translator/annotations.go Updates annotation translation to use new IngressConfig structure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@ronething ronething left a comment

Choose a reason for hiding this comment

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

lgtm

@AlinsRan AlinsRan merged commit 2dc7ae6 into apache:master Oct 24, 2025
31 of 35 checks passed
@AlinsRan AlinsRan deleted the feat/ingerss-upstream-annotations branch October 24, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants