Skip to content

Commit

Permalink
disable snapshots
Browse files Browse the repository at this point in the history
Currently there is a limitation in Azure SDK and snapshots can only
be created, not restored. We don't want users to be able to create
snapshots when there is no use for them at this point.

Disable snapshots by removing volume snapshot class resource and
removing snapshotter sidecars.

PR for tracking snapshot restore:
kubernetes-sigs/azurefile-csi-driver#136
  • Loading branch information
RomanBednar committed Apr 26, 2022
1 parent d722a24 commit a9371ec
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 118 deletions.
43 changes: 0 additions & 43 deletions assets/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,49 +268,6 @@ spec:
volumeMounts:
- mountPath: /etc/tls/private
name: metrics-serving-cert
- name: csi-snapshotter
image: ${SNAPSHOTTER_IMAGE}
imagePullPolicy: IfNotPresent
args:
- --csi-address=$(ADDRESS)
- --metrics-address=localhost:8215
- --leader-election
- --leader-election-lease-duration=${LEADER_ELECTION_LEASE_DURATION}
- --leader-election-renew-deadline=${LEADER_ELECTION_RENEW_DEADLINE}
- --leader-election-retry-period=${LEADER_ELECTION_RETRY_PERIOD}
- --v=${LOG_LEVEL}
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- mountPath: /var/lib/csi/sockets/pluginproxy/
name: socket-dir
resources:
requests:
memory: 50Mi
cpu: 10m
- name: snapshotter-kube-rbac-proxy
args:
- --secure-listen-address=0.0.0.0:9215
- --upstream=http://127.0.0.1:8215/
- --tls-cert-file=/etc/tls/private/tls.crt
- --tls-private-key-file=/etc/tls/private/tls.key
- --logtostderr=true
image: ${KUBE_RBAC_PROXY_IMAGE}
imagePullPolicy: IfNotPresent
ports:
# Due to hostNetwork, this port is open on a node and cannot
# conflict with any port used by other CSI drivers.
- containerPort: 9215
name: snapshotter-m
protocol: TCP
resources:
requests:
memory: 20Mi
cpu: 10m
volumeMounts:
- mountPath: /etc/tls/private
name: metrics-serving-cert
- name: csi-liveness-probe
image: ${LIVENESS_PROBE_IMAGE}
imagePullPolicy: IfNotPresent
Expand Down
3 changes: 3 additions & 0 deletions assets/rbac/provisioner_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
12 changes: 0 additions & 12 deletions assets/rbac/snapshotter_binding.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions assets/rbac/snapshotter_role.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions assets/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ spec:
port: 445
protocol: TCP
targetPort: resizer-m
- name: snapshotter-m
port: 446
protocol: TCP
targetPort: snapshotter-m
selector:
app: azure-file-csi-driver-controller
sessionAffinity: None
Expand Down
8 changes: 0 additions & 8 deletions assets/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ spec:
tlsConfig:
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
serverName: azure-file-csi-driver-controller-metrics.openshift-cluster-csi-drivers.svc
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
interval: 30s
path: /metrics
port: snapshotter-m
scheme: https
tlsConfig:
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
serverName: azure-file-csi-driver-controller-metrics.openshift-cluster-csi-drivers.svc
jobLabel: component
selector:
matchLabels:
Expand Down
10 changes: 0 additions & 10 deletions assets/volumesnapshotclass.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
kubeInformersForNamespaces,
assets.ReadFile,
[]string{
"volumesnapshotclass.yaml",
"storageclass.yaml",
"storageclass_nfs.yaml",
"controller_sa.yaml",
Expand All @@ -92,8 +91,6 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
"rbac/provisioner_binding.yaml",
"rbac/resizer_role.yaml",
"rbac/resizer_binding.yaml",
"rbac/snapshotter_role.yaml",
"rbac/snapshotter_binding.yaml",
"rbac/kube_rbac_proxy_role.yaml",
"rbac/kube_rbac_proxy_binding.yaml",
"rbac/prometheus_role.yaml",
Expand Down

0 comments on commit a9371ec

Please sign in to comment.