https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/177-volume-snapshot/tighten-validation-webhook-crd.md 1. Ratcheting validation webhook server image 2. Controller labels invalid objects 3. Unit tests for webhook 4. Deployment README and example deployment method with certs 5. Update top-level README Racheting validation: 1. webhook is strict on create 2. webhook is strict on updates where the existing object passes strict validation 3. webhook is relaxed on updates where the existing object fails strict validation (allows finalizer removal, status update, deletion, etc) Additionally the validating wehook server will perform immutability checks on scenario 2 above.
23 lines
900 B
Plaintext
23 lines
900 B
Plaintext
apiVersion: admissionregistration.k8s.io/v1
|
|
kind: ValidatingWebhookConfiguration
|
|
metadata:
|
|
name: "validation-webhook.storage.sigs.k8s.io"
|
|
namespace: "default"
|
|
webhooks:
|
|
- name: "snapshot.validation-webhook.storage.sigs.k8s.io"
|
|
rules:
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
apiVersions: ["v1beta1"]
|
|
operations: ["CREATE", "UPDATE"]
|
|
resources: ["volumesnapshots", "volumesnapshotcontents"]
|
|
scope: "*"
|
|
clientConfig:
|
|
service:
|
|
namespace: "default"
|
|
name: "snapshot-validation-service"
|
|
path: "/volumesnapshot"
|
|
caBundle: ${CA_BUNDLE}
|
|
admissionReviewVersions: ["v1", "v1beta1"]
|
|
sideEffects: None
|
|
failurePolicy: Fail # We recommend switching to Fail only after successful installation of the server and webhook.
|
|
timeoutSeconds: 10 # This will affect the latency and performance. Finetune this value based on your application's tolerance. |