Skip to content

Commit

Permalink
Merge pull request #231 from ZeroMagic/csidriver_crd
Browse files Browse the repository at this point in the history
chore: remove cluster driver registrar
  • Loading branch information
andyzhangx committed Apr 4, 2020
2 parents 7c9a307 + f8e10bd commit 4b20a48
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 126 deletions.

This file was deleted.

Expand Up @@ -68,25 +68,6 @@ spec:
requests:
cpu: 10m
memory: 20Mi
- name: cluster-driver-registrar
image: "{{ .Values.image.clusterDriverRegistrar.repository }}:{{ .Values.image.clusterDriverRegistrar.tag }}"
args:
- --csi-address=$(ADDRESS)
- --driver-requires-attachment=true
- --v=5
env:
- name: ADDRESS
value: /csi/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /csi
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 10m
memory: 20Mi
- name: csi-snapshotter
image: "{{ .Values.image.csiSnapshotter.repository }}:{{ .Values.image.csiSnapshotter.tag }}"
args:
Expand Down
@@ -0,0 +1,8 @@
---
apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
name: file.csi.azure.com
spec:
attachRequired: true
podInfoOnMount: true
4 changes: 0 additions & 4 deletions charts/latest/azurefile-csi-driver/values.yaml
Expand Up @@ -11,10 +11,6 @@ image:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-attacher
tag: v1.2.0
pullPolicy: IfNotPresent
clusterDriverRegistrar:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-cluster-driver-registrar
tag: v1.0.1
pullPolicy: IfNotPresent
csiSnapshotter:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-snapshotter
tag: v1.1.0
Expand Down
36 changes: 0 additions & 36 deletions deploy/crd-csi-driver-registry.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions deploy/csi-azurefile-controller.yaml
Expand Up @@ -68,25 +68,6 @@ spec:
requests:
cpu: 10m
memory: 20Mi
- name: cluster-driver-registrar
image: mcr.microsoft.com/oss/kubernetes-csi/csi-cluster-driver-registrar:v1.0.1
args:
- --csi-address=$(ADDRESS)
- --driver-requires-attachment=true
- --v=5
env:
- name: ADDRESS
value: /csi/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /csi
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 10m
memory: 20Mi
- name: csi-snapshotter
image: mcr.microsoft.com/oss/kubernetes-csi/csi-snapshotter:v1.1.0
args:
Expand Down
8 changes: 8 additions & 0 deletions deploy/csi-azurefile-driver.yaml
@@ -0,0 +1,8 @@
---
apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
name: file.csi.azure.com
spec:
attachRequired: true
podInfoOnMount: true
2 changes: 1 addition & 1 deletion deploy/install-driver.sh
Expand Up @@ -34,10 +34,10 @@ if [ $ver != "master" ]; then
fi

echo "Installing Azure File CSI driver, version: $ver ..."
kubectl apply -f $repo/crd-csi-driver-registry.yaml
kubectl apply -f $repo/crd-csi-node-info.yaml
kubectl apply -f $repo/rbac-csi-azurefile-controller.yaml
kubectl apply -f $repo/csi-azurefile-controller.yaml
kubectl apply -f $repo/csi-azurefile-driver.yaml
kubectl apply -f $repo/csi-azurefile-node.yaml

if [[ "$#" -gt 1 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion deploy/uninstall-driver.sh
Expand Up @@ -35,9 +35,9 @@ fi

echo "Uninstalling Azure File CSI driver, version: $ver ..."
kubectl delete -f $repo/csi-azurefile-controller.yaml --ignore-not-found
kubectl delete -f $repo/csi-azurefile-driver.yaml --ignore-not-found
kubectl delete -f $repo/csi-azurefile-node.yaml --ignore-not-found
kubectl delete -f $repo/csi-azurefile-node-windows.yaml --ignore-not-found
kubectl delete -f $repo/crd-csi-driver-registry.yaml --ignore-not-found
kubectl delete -f $repo/crd-csi-node-info.yaml --ignore-not-found
kubectl delete -f $repo/rbac-csi-azurefile-controller.yaml --ignore-not-found
echo 'Uninstalled Azure File CSI driver successfully.'
12 changes: 4 additions & 8 deletions hack/verify-helm-chart.sh
Expand Up @@ -43,21 +43,17 @@ pip install yq
# Extract images from csi-azurefile-controller.yaml
expected_csi_provisioner_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[0].image | head -n 1)"
expected_csi_attacher_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[1].image | head -n 1)"
expected_cluster_driver_registrar_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[2].image | head -n 1)"
expected_csi_snapshotter_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[3].image | head -n 1)"
expected_csi_resizer_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[4].image | head -n 1)"
expected_liveness_probe_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[5].image | head -n 1)"
expected_azurefile_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[6].image | head -n 1)"
expected_csi_snapshotter_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[2].image | head -n 1)"
expected_csi_resizer_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[3].image | head -n 1)"
expected_liveness_probe_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[4].image | head -n 1)"
expected_azurefile_image="$(cat ${PKG_ROOT}/deploy/csi-azurefile-controller.yaml | yq -r .spec.template.spec.containers[5].image | head -n 1)"

csi_provisioner_image="$(get_image_from_helm_chart "csiProvisioner")"
validate_image "${expected_csi_provisioner_image}" "${csi_provisioner_image}"

csi_attacher_image="$(get_image_from_helm_chart "csiAttacher")"
validate_image "${expected_csi_attacher_image}" "${csi_attacher_image}"

cluster_driver_registrar_image="$(get_image_from_helm_chart "clusterDriverRegistrar")"
validate_image "${expected_cluster_driver_registrar_image}" "${cluster_driver_registrar_image}"

csi_snapshotter_image="$(get_image_from_helm_chart "csiSnapshotter")"
validate_image "${expected_csi_snapshotter_image}" "${csi_snapshotter_image}"

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/util.go
Expand Up @@ -43,7 +43,7 @@ func GiBToBytes(volumeSizeGiB int64) int64 {
}

// roundUpSize calculates how many allocation units are needed to accommodate
// a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS
// a volume of given size. E.g. when user wants 1500MiB volume, while Azure File
// allocates volumes in gibibyte-sized chunks,
// RoundUpSize(1500 * 1024*1024, 1024*1024*1024) returns '2'
// (2 GiB is the smallest allocatable volume that can hold 1500MiB)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/testsuites/testsuites.go
Expand Up @@ -364,7 +364,7 @@ type TestDeployment struct {
}

func NewTestDeployment(c clientset.Interface, ns *v1.Namespace, command string, pvc *v1.PersistentVolumeClaim, volumeName, mountPath string, readOnly, isWindows bool) *TestDeployment {
generateName := "ebs-volume-tester-"
generateName := "azurefile-volume-tester-"
selectorValue := fmt.Sprintf("%s%d", generateName, rand.Int())
replicas := int32(1)
testDeployment := &TestDeployment{
Expand Down

0 comments on commit 4b20a48

Please sign in to comment.