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

Unable to create Resourcebindings after creating Propagationpolicies #5486

Open
tpiperatgod opened this issue Sep 6, 2024 · 11 comments
Open
Assignees
Labels
kind/question Indicates an issue that is a support question.

Comments

@tpiperatgod
Copy link

Please provide an in-depth description of the question you have:

When I create the deployment or any resource and then create the corresponding pp, the rb is not created, resulting in the resource not being propagated to the member clusters.

You can use this example for testing: https://karmada.io/zh/docs/next/get-started/nginx-example/

logs:

  • karmada-apiserver
W0906 08:34:52.957295       1 dispatcher.go:225] Failed calling webhook, failing closed resourcebinding.karmada.io: failed calling webhook "resourcebinding.karmada.io": failed to call webhook: the server could not find the requested resource
W0906 08:36:14.880577       1 dispatcher.go:225] Failed calling webhook, failing closed resourcebinding.karmada.io: failed calling webhook "resourcebinding.karmada.io": failed to call webhook: the server could not find the requested resource
W0906 08:38:58.734689       1 dispatcher.go:225] Failed calling webhook, failing closed resourcebinding.karmada.io: failed calling webhook "resourcebinding.karmada.io": failed to call webhook: the server could not find the requested resource
  • karmada-controller
I0906 08:38:58.721444       1 detector.go:237] Reconciling object: apps/v1, kind=Deployment, default/nginx
I0906 08:38:58.721600       1 detector.go:429] Applying policy(default/deploy-propagation) for object: apps/v1, kind=Deployment, default/nginx
I0906 08:38:58.721627       1 configurable.go:84] Get replicas for object: apps/v1, Kind=Deployment default/nginx with configurable interpreter.
I0906 08:38:58.721637       1 customized.go:93] Get replicas for object: apps/v1, Kind=Deployment default/nginx with webhook interpreter.
I0906 08:38:58.721648       1 thirdparty.go:70] Get replicas for object: apps/v1, Kind=Deployment default/nginx with thirdparty configurable interpreter.
I0906 08:38:58.721656       1 default.go:94] Get replicas for object: apps/v1, Kind=Deployment default/nginx with build-in interpreter.
E0906 08:38:58.735065       1 detector.go:509] Failed to apply policy(deploy-propagation) for object: apps/v1, kind=Deployment, default/nginx. error: Internal error occurred: failed calling webhook "resourcebinding.karmada.io": failed to call webhook: the server could not find the requested resource
I0906 08:38:58.735145       1 recorder.go:104] "events: Apply policy(default/deploy-propagation) failed: Internal error occurred: failed calling webhook \"resourcebinding.karmada.io\": failed to call webhook: the server could not find the requested resource" type="Warning" object={"kind":"Deployment","namespace":"default","name":"nginx","uid":"8999120d-9733-4385-89a4-3a941250ef62","apiVersion":"apps/v1","resourceVersion":"4339"} reason="ApplyPolicyFailed"

What do you think about this question?:

Environment:

  • Karmada version: v1.9.0
  • Kubernetes version: k8s v1.25.3
  • Others:
@tpiperatgod tpiperatgod added the kind/question Indicates an issue that is a support question. label Sep 6, 2024
@tpiperatgod
Copy link
Author

When I remove the resourcebinding.karmada.io webhook in Mutatingwebhookconfigurations, it works.

If this is the correct action, then is it necessary to check if the charts still contain this faulty (possibly deprecated?) webhook item?

The installation command as follows:

karmadactl init --crds='https://github.com/karmada-io/karmada/releases/download/v1.9.0/crds.tar.gz' \
  --karmada-aggregated-apiserver-image='docker.io/karmada/karmada-aggregated-apiserver:v1.9.0' \
  --karmada-controller-manager-image='docker.io/karmada/karmada-controller-manager:v1.9.0' \
  --karmada-scheduler-image='docker.io/karmada/karmada-scheduler:v1.9.0' \
  --karmada-webhook-image='docker.io/karmada/karmada-webhook:v1.9.0'

@XiShanYongYe-Chang
Copy link
Member

Hi @zhzhuang-zju, would you like to take a look?

@tpiperatgod
Copy link
Author

I found the webhook item resourcebinding.karmada.io was first seen in v1.10.0.

So it could be that karmadactl init is installing with the latest content instead of the specified version?

@zhzhuang-zju
Copy link
Contributor

/assign

@XiShanYongYe-Chang
Copy link
Member

It is possible. You can check whether the version of karmadactl is correct.

@zhzhuang-zju
Copy link
Contributor

It is possible. You can check whether the version of karmadactl is correct.

karmadactl version

@tpiperatgod The mutating-config used by karmadactl init is dependent on the version it builds.

func mutatingConfig(caBundle string, systemNamespace string) string {
return fmt.Sprintf(`apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: mutating-config
labels:
app: karmada-webhook
webhooks:
- name: propagationpolicy.karmada.io
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["policy.karmada.io"]
apiVersions: ["*"]
resources: ["propagationpolicies"]
scope: "Namespaced"
clientConfig:
url: https://karmada-webhook.%[1]s.svc:443/mutate-propagationpolicy
caBundle: %[2]s
failurePolicy: Fail
sideEffects: None

@zhzhuang-zju
Copy link
Contributor

Installation by karmada operator maybe have the same issue, I'll check it later

@tpiperatgod
Copy link
Author

It is possible. You can check whether the version of karmadactl is correct.

karmadactl version

@tpiperatgod The mutating-config used by karmadactl init is dependent on the version it builds.

func mutatingConfig(caBundle string, systemNamespace string) string {
return fmt.Sprintf(`apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: mutating-config
labels:
app: karmada-webhook
webhooks:
- name: propagationpolicy.karmada.io
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["policy.karmada.io"]
apiVersions: ["*"]
resources: ["propagationpolicies"]
scope: "Namespaced"
clientConfig:
url: https://karmada-webhook.%[1]s.svc:443/mutate-propagationpolicy
caBundle: %[2]s
failurePolicy: Fail
sideEffects: None

my karmadactl version is v1.10.4

@tpiperatgod
Copy link
Author

So the expected behaviour is to select the karmadactl with the version according to the server that needs to be installed? Or is it possible to use karmadactl to support the installation of any version of the server?

@zhzhuang-zju
Copy link
Contributor

So the expected behaviour is to select the karmadactl with the version according to the server that needs to be installed? Or is it possible to use karmadactl to support the installation of any version of the server?

In the long run, it would be best for karmadactl to support installations of Karmada instances of any version or at least a certain range of versions. Do you have any suggestions for this?

@tpiperatgod
Copy link
Author

So the expected behaviour is to select the karmadactl with the version according to the server that needs to be installed? Or is it possible to use karmadactl to support the installation of any version of the server?

In the long run, it would be best for karmadactl to support installations of Karmada instances of any version or at least a certain range of versions. Do you have any suggestions for this?

I agree with this approach. If you need any help, feel free to reach out to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

3 participants