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

[release/v1.8] Fix snapshot-webhook admitting non-supported objects and add default VolumeSnapshotClass for all supported providers #3275

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions addons/csi-external-snapshotter/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ webhooks:
- name: "validation-webhook.snapshot.storage.k8s.io"
rules:
- apiGroups: ["snapshot.storage.k8s.io"]
apiVersions: ["v1", "v1beta1"]
apiVersions: ["v1"]
operations: ["CREATE", "UPDATE"]
resources: ["volumesnapshots", "volumesnapshotcontents", "volumesnapshotclasses"]
resources: ["volumesnapshotclasses"]
scope: "*"
clientConfig:
service:
Expand All @@ -32,11 +32,10 @@ webhooks:
path: "/volumesnapshot"
caBundle: |
{{ .Certificates.KubernetesCA | b64enc | indent 6 }}
admissionReviewVersions: ["v1", "v1beta1"]
admissionReviewVersions: ["v1"]
sideEffects: None
failurePolicy: Fail
timeoutSeconds: 2

---
apiVersion: apps/v1
kind: Deployment
Expand Down
31 changes: 31 additions & 0 deletions addons/default-storage-class/storage-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,20 @@ kind: VolumeSnapshotClass
apiVersion: snapshot.storage.k8s.io/v1
metadata:
name: csi-azuredisk-vsc
annotations:
snapshot.storage.kubernetes.io/is-default-class: "true"
driver: disk.csi.azure.com
deletionPolicy: Delete
parameters:
incremental: "true"
tags:
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: csi-azurefile-vsc
driver: file.csi.azure.com
deletionPolicy: Delete
{{ end }}
---
apiVersion: storage.k8s.io/v1
Expand Down Expand Up @@ -70,6 +79,15 @@ parameters:
type: gp2
volumeBindingMode: WaitForFirstConsumer
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: ebs-csi
annotations:
snapshot.storage.kubernetes.io/is-default-class: "true"
driver: ebs.csi.aws.com
deletionPolicy: Delete
---
{{ end }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand Down Expand Up @@ -217,6 +235,19 @@ parameters:
isSegmentedIscsiNetwork: {{ default "false" .Params.isSegmentedIscsiNetwork | quote }}
allowVolumeExpansion: true
reclaimPolicy: Delete
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: ntnx-csi
annotations:
snapshot.storage.kubernetes.io/is-default-class: "true"
driver: csi.nutanix.com
parameters:
storageType: NutanixVolumes
csi.storage.k8s.io/snapshotter-secret-name: ntnx-secret
csi.storage.k8s.io/snapshotter-secret-namespace: kube-system
deletionPolicy: Delete
{{ end }}

{{ if eq .Config.CloudProvider.CloudProviderName "hetzner" }}
Expand Down