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

[BUG] Can't apply blueprint cause webhook can't be reached #1292

Closed
muffl0n opened this issue Mar 21, 2022 · 9 comments
Closed

[BUG] Can't apply blueprint cause webhook can't be reached #1292

muffl0n opened this issue Mar 21, 2022 · 9 comments
Labels

Comments

@muffl0n
Copy link
Contributor

muffl0n commented Mar 21, 2022

Describe the bug
When I try to apply a blueprint, I get this error message

Error from server (InternalError): error when creating "blueprint.yaml": Internal error occurred: failed calling webhook "blueprints.cr.kanister.io": failed to call webhook: Post "https://kanister-kanister-operator.kanister.svc:443/validate/v1alpha1/blueprint?timeout=5s": context deadline exceeded

To Reproduce

  1. Create blueprint.yaml
  2. Call kubectl apply -f blueprint.yaml
  3. Get error message

Expected behavior
Blueprint should be applied without an error.

Environment
Kubernetes Version/Provider: GKE v1.22.6-gke.300
Helm-Chart: 0.74.0
Kanister operator: Develop version of PR #1282

Though I'm using the develop version of said PR, I can also reproduce this behaviour with released version ghcr.io/kanisterio/controller:0.74.0

@muffl0n muffl0n added the bug label Mar 21, 2022
@viveksinghggits
Copy link
Contributor

Hi @muffl0n,
can you please confirm if you are facing this continuously or this is intermittent.

@muffl0n
Copy link
Contributor Author

muffl0n commented Mar 21, 2022

I can reproduce this on every try.

@ihcsim
Copy link
Contributor

ihcsim commented Mar 21, 2022

Are there any relevant logs in the operator?

@muffl0n
Copy link
Contributor Author

muffl0n commented Mar 21, 2022

None I found so far. Is there any method to pump up the logging?

@ihcsim
Copy link
Contributor

ihcsim commented Mar 21, 2022

Should be able to use the LOG_LEVEL env var to set the log level. See supported values here.

@ihcsim
Copy link
Contributor

ihcsim commented Mar 21, 2022

I see what the issue is - you have to add additional firewall rules to allow traffic between your private GKE apiserver and the Kanister webhooks. See https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#add_firewall_rules.

@muffl0n
Copy link
Contributor Author

muffl0n commented Mar 21, 2022

You are right! Thank you very much!

I recall having a similar problem with "Config Connector": GoogleCloudPlatform/k8s-config-connector#423
There, they rolled back a change and used 443 again, instead of 9443. Cause 443 (like 10250) is allowed by default, it always works. See also https://cloud.google.com/kubernetes-engine/docs/release-notes#known-20210222

Is there a special reason why Kanister uses 9443 and not 443? Notice: It's the port of the pod/endpoint, not the service's one.

Edit: Default changed to 9443 some time ago: kubernetes-sigs/controller-runtime#1076
Wonder what's behind that decision.

@ihcsim
Copy link
Contributor

ihcsim commented Mar 22, 2022

9443 is the default port used in the webhook package. Also, it might have something to do with getting the HTTP server to listen at a lower port number requires the NET_ADMIN capability.

muffl0n added a commit to muffl0n/kanister that referenced this issue Mar 22, 2022
muffl0n added a commit to muffl0n/kanister that referenced this issue Mar 22, 2022
@muffl0n
Copy link
Contributor Author

muffl0n commented Mar 22, 2022

Thanks for the clarification! I added a section to "Troubleshooting" in #1309

@muffl0n muffl0n closed this as completed Mar 22, 2022
muffl0n added a commit to muffl0n/kanister that referenced this issue Mar 22, 2022
muffl0n added a commit to muffl0n/kanister that referenced this issue Mar 22, 2022
muffl0n added a commit to muffl0n/kanister that referenced this issue Mar 22, 2022
muffl0n added a commit to muffl0n/kanister that referenced this issue Mar 23, 2022
mergify bot added a commit that referenced this issue Mar 24, 2022
* Add section "Webhook" in "Troubleshooting"

Fixes #1292

* Add backticks to port

* Apply suggestions from code review

Co-authored-by: Pavan Navarathna <pavan@kasten.io>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants