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

feat: add externalname support for upstream #726

Closed
wants to merge 1 commit into from

Conversation

elvis-cai
Copy link

Please answer these questions before submitting a pull request


Bugfix

  • Description

  • How to fix?


New feature or improvement

  • Describe the details and related test reports.
    • Adding kubernetes service type ExternalName support
    • For kind: ApisixUpstream, add two more options passHost and upstreamHost

Let me know if there's anything missing here, thanks.


Backport patches

  • Why need to backport?

  • Source branch

  • Related commits and pull requests

  • Target branch

@tokers
Copy link
Contributor

tokers commented Nov 8, 2021

@elvis-cai Please add some test cases to cover these changes.

@elvis-cai
Copy link
Author

@elvis-cai Please add some test cases to cover these changes.

sure, doc & test added.

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #726 (12563f5) into master (b127ff4) will decrease coverage by 0.12%.
The diff coverage is 67.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #726      +/-   ##
==========================================
- Coverage   32.50%   32.37%   -0.13%     
==========================================
  Files          66       66              
  Lines        6800     6836      +36     
==========================================
+ Hits         2210     2213       +3     
- Misses       4340     4362      +22     
- Partials      250      261      +11     
Impacted Files Coverage Δ
pkg/kube/translation/translator.go 47.32% <55.55%> (+1.24%) ⬆️
pkg/kube/translation/util.go 32.16% <58.82%> (-0.56%) ⬇️
pkg/kube/translation/apisix_upstream.go 83.33% <88.23%> (+0.38%) ⬆️
pkg/apisix/plugin.go 80.00% <0.00%> (-20.00%) ⬇️
pkg/apisix/cluster.go 30.02% <0.00%> (-3.31%) ⬇️
pkg/apisix/route.go 36.91% <0.00%> (-2.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b127ff4...12563f5. Read the comment docs.

metadata:
name: foo-service
spec:
httpHostRewritePolicy:
Copy link
Contributor

Choose a reason for hiding this comment

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

The specification is bad. You should split them.

Copy link
Member

Choose a reason for hiding this comment

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

@elvis-cai and this one

docs/en/latest/concepts/apisix_upstream.md Show resolved Hide resolved
@@ -23,6 +23,15 @@ import (
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v2alpha1"
)

const (
// UseOriginalClientHost means host option set to "pass" for the upstream
UseOriginalClientHost = "useOriginalClientHost"
Copy link
Contributor

Choose a reason for hiding this comment

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

As per the Kubernetes convention, the value should be in upper camel case. Like values of ImagePullPolicy: Always, Never, IfNotPresent.

Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

Please fix the CI errors.

@elvis-cai
Copy link
Author

Please fix the CI errors.

my bad, last commit forget to update test code, updated

@tao12345666333
Copy link
Member

Sorry for delay. Can you resolve the conflict? Then we run the test and merge this PR. Thanks!

@elvis-cai
Copy link
Author

Sorry for delay. Can you resolve the conflict? Then we run the test and merge this PR. Thanks!

all good, conflict resolved and feel free to rerun the test, thanks.

@purekeeper
Copy link

@tokers @tao12345666333 Why this feature not merge to master, Can you go ahead to process this feature ?

@tao12345666333
Copy link
Member

There are too many conflicts to resolve.

@tokers
Copy link
Contributor

tokers commented Mar 12, 2022

@elvis-cai Could you merge the newest master branch? Thanks!

@BrandonArp
Copy link

This looks like a great feature and I'm really looking forward to having it merged. Is there something I can do to help move it along?

@elvis-cai
Copy link
Author

I am more looking forward to the feature #927, but sounds good to me , before that's implemented, will look at if I could fix the conflict and merge the latest master branch.

@BrandonArp
Copy link

@tao12345666333 how does this look? I'd love to see this PR merged

@NMichas
Copy link

NMichas commented Jul 18, 2022

Just adding my +1 for this feature :)

@tao12345666333
Copy link
Member

Sorry for delay reply.
The maintenance team is actively working on the remainder tasks of the v1.5 release window.
We plan to do a pre-release of v1.5 this month.

#726 #927 and some related tasks, I will put them in the v1.6 version to complete.

Currently we have too many things to do, including GitHub issues, PRs, some features and bugfixes, etc., and Slack channel replies. This leaves us almost at full capacity.

If anyone would like to see some new features added, please join us and help us make this project better, thanks

@tao12345666333
Copy link
Member

#1306 has been merged. I will close this one, thanks!

@mbuotidem
Copy link

@tao12345666333 It looks like there's a discrepancy in the docs and what's actually possible when using the ApisixUpstream crd, i.e the passHost feature doesn't work- see #2010.

I'm not sure where the confusion happened but it looks like this pr would have added that feature, but #1306 was merged instead and does include passHostfunctionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

9 participants