kubernetes: Admission controller fails on timeout when failurePolicy set to Ignore
Trying to set up a validating admission webhook on my GKE cluster using the following yaml:
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
name: test-admission-webhook
webhooks:
- name: my-admission-webhook.io
rules:
- apiGroups:
- ""
apiVersions:
- "v1"
operations:
- "CREATE"
resources:
- "pods"
failurePolicy: Ignore
clientConfig:
url: "https://192.168.99.1:8080"
caBundle: %%TEST_BUNDLE%%
And my server is still down, I can’t run any pod on my cluster, getting the following error:
Error creating: Timeout: request did not complete within allowed duration
Even when I removed the failurePolicy field from my yaml file (which is supposed to default to Ignore as mentioned in the official doc) and I’m getting the same error.
/sig api-machinery /kind bug
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 19 (14 by maintainers)
I think @yue9944882 and @liggitt were right. It’s your create request timing-out not your admission request
tl;dr: it’s behaving by design. But we shouldn’t use the same timeout for client request and admission request. You could do one of the following to fix:
Timeoutin yourrestclient.Config(e.g.confighere). It will change the timeout for all your client requests (per request timeout configuration is WIP)(longer version) I think what happened is:
there are two different requests, built on same client package with the same timeout
since webhook server is unresponsive, both requests hang.
(you can tell from the error message, it should contain the text “Internal error” if apiserver actually didn’t honor ignore policy and returned error)
It should work. A failure policy of ignore should fail open on timeout or other call errors