Skip to content

Custom Admission Webhook in K8s #1371

Answered by alexp-lyft
SandraGH5 asked this question in Q&A
Discussion options

You must be logged in to vote

Also make sure the webhook returns HTTP 200 OK. Otherwise the response will be wrapped in 500 InternalServerError by kube prior to returning to the client

Sample AdmissionReview response with kind, message, reason and code set as required:

ar.Response.Result = &metav1.Status{
            Message: "... exceeded quota ...",
            Code:    403,
            Reason:  "Forbidden",
}
ar.SetGroupVersionKind(v1.SchemeGroupVersion.WithKind("AdmissionReview")) 

Replies: 2 comments 1 reply

Comment options

SandraGH5
Aug 24, 2021
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@SandraGH5
Comment options

SandraGH5 Aug 26, 2021
Collaborator Author

Answer selected by SandraGH5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants