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

The admissionregistration.k8s.io/v1beta1 API version of MutatingWebhookConfiguration is no longer served as of v1.22. #205

Open
jackzhao0711 opened this issue Jan 16, 2024 · 6 comments

Comments

@jackzhao0711
Copy link

jackzhao0711 commented Jan 16, 2024

Current EKS version:1.21
Purpose: Upgrade version to 1.22
EKS upgrade insights shows that there are deprecated api versions:
image

Check cluster:
kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io -A
image

Check details:
kubectl get MutatingWebhookConfiguration.v1beta1.admissionregistration.k8s.io "0500-amazon-eks-fargate-mutation.amazonaws.com" -o yaml | grep apiVersion
kubectl get MutatingWebhookConfiguration.v1.admissionregistration.k8s.io "0500-amazon-eks-fargate-mutation.amazonaws.com" -o yaml | grep apiVersion

The difference between the two: v1beta1 & v1
image
image

Question:
1、In the second picture, why does the first row show v1, but the second column shows v1beta1?
2、If I upgrade to v1.22, will v1beta1 in the first picture be automatically updated to v1? In the same way, will the second row in the second picture also be updated?

For "pod-identity-webhook", the phenomenon is the same as above.
kubectl get MutatingWebhookConfiguration.v1beta1.admissionregistration.k8s.io "pod-identity-webhook" -o yaml | grep apiVersion
kubectl get MutatingWebhookConfiguration.v1.admissionregistration.k8s.io "pod-identity-webhook" -o yaml | grep apiVersion
image
image

Guys, is there anything I need to do before upgrading?

@KevinHuang40856
Copy link

for your first question, the reason the apiVersion in second column is from the rules config to lists one or more API versions to match. if you view the full yaml output, you will find it
refer https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-rules

@KevinHuang40856
Copy link

for second question, there is no such automatic upgrade. firstly all existing persisted objects are accessible via the new APIs, however as the admissionregistration.k8s.io/v1beta1 API version of MutatingWebhookConfiguration is no longer served as of v1.22 also the below changes in admissionregistration.k8s.io/v1 , you need to update YAML spec files to the new API version and change accordingly. eg you may have to add webhooks[*].admissionReviewVersions

webhooks[].failurePolicy default changed from Ignore to Fail for v1
webhooks[
].matchPolicy default changed from Exact to Equivalent for v1
webhooks[].timeoutSeconds default changed from 30s to 10s for v1
webhooks[
].sideEffects default value is removed, and the field made required, and only None and NoneOnDryRun are permitted for v1
webhooks[].admissionReviewVersions default value is removed and the field made required for v1 (supported versions for AdmissionReview are v1 and v1beta1)
webhooks[
].name must be unique in the list for objects created via admissionregistration.k8s.io/v1

@jackzhao0711
Copy link
Author

@KevinHuang40856 Thank you for your reply, since my cluster is created through CDK and these apis are automatically generated, how should I find and update these values?

@KevinHuang40856
Copy link

cdk created cluster, but normally will not create MutatingWebhookConfiguration resources.

if you are using cdk8s to create the kubunetes resources , you will have a look at construct you are using.

@KevinHuang40856
Copy link

if your cdk created cluster with old k8s version, you can make cdk to create/upgrade cluster with new version to get new api version.

@jackzhao0711
Copy link
Author

@KevinHuang40856 Sorry, it took so long to reply to you. This problem has been solved, and the version will be automatically updated after upgrading directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants