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

karmada-webhook: fix the no such host error #6079

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhzhuang-zju
Copy link
Contributor

@zhzhuang-zju zhzhuang-zju commented Jan 23, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:
when deploying karmada instance by operator or karmadactl init,karmada-apiserver will report dial tcp: lookup karmada-webhook.karmada-system.svc on x.x.x.x: no such host error if the namespace of karmada instance is not karmada-system.

# The following patch enables conversion webhook for CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: resourcebindings.work.karmada.io
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
url: https://karmada-webhook.karmada-system.svc:443/convert
caBundle: {{caBundle}}
conversionReviewVersions: ["v1"]

The webhook url is hardcoded and actually needs to be entered via a variable.

Which issue(s) this PR fixes:
Fixes #4893

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-operator`: fix the "no such host" error when accessing the /convert webhook.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 23, 2025
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 23, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 34.21053% with 25 lines in your changes missing coverage. Please review.

Project coverage is 48.13%. Comparing base (216d251) to head (fffd206).

Files with missing lines Patch % Lines
operator/pkg/tasks/init/karmadaresource.go 0.00% 16 Missing ⚠️
pkg/karmadactl/cmdinit/karmada/deploy.go 43.75% 7 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6079      +/-   ##
==========================================
+ Coverage   48.11%   48.13%   +0.01%     
==========================================
  Files         668      668              
  Lines       55163    55190      +27     
==========================================
+ Hits        26544    26563      +19     
- Misses      26894    26896       +2     
- Partials     1725     1731       +6     
Flag Coverage Δ
unittests 48.13% <34.21%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zhzhuang-zju and additionally assign poor12, prodanlabs for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

hack/deploy-karmada.sh Outdated Show resolved Hide resolved
operator/pkg/util/util.go Show resolved Hide resolved
operator/pkg/util/util.go Show resolved Hide resolved
pkg/karmadactl/cmdinit/karmada/deploy_test.go Outdated Show resolved Hide resolved
@zhzhuang-zju
Copy link
Contributor Author

https://github.com/karmada-io/karmada/actions/runs/13175234470/job/36772974450?pr=6079#step:4:765
error: wait for Deployment(karmada-system/karmada-apiserver) rollout: context deadline exceeded: client rate limiter Wait returned an error: context deadline exceeded

/retest

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Thanks, other parts LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

operator: dial tcp: lookup karmada-webhook.karmada-system.svc on x.x.x.x: no such host
5 participants