Skip to content

Commit

Permalink
Remove external-attacher and add CSIDriver
Browse files Browse the repository at this point in the history
+ remove 1.13 manifests
  • Loading branch information
jsafrane committed Jul 25, 2019
1 parent 4b2c735 commit e2ad5a9
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 184 deletions.
7 changes: 0 additions & 7 deletions deploy/kubernetes-1.13/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions deploy/kubernetes-1.13/hostpath/csi-hostpath-attacher.yaml

This file was deleted.

55 changes: 0 additions & 55 deletions deploy/kubernetes-1.14/hostpath/csi-hostpath-attacher.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions deploy/kubernetes-1.14/hostpath/csi-hostpath-csidriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
name: hostpath.csi.k8s.io
spec:
attachRequired: false
podInfoOnMount: false
55 changes: 0 additions & 55 deletions deploy/kubernetes-1.15/hostpath/csi-hostpath-attacher.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions deploy/kubernetes-1.15/hostpath/csi-hostpath-csidriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
name: hostpath.csi.k8s.io
spec:
attachRequired: false
podInfoOnMount: false
7 changes: 7 additions & 0 deletions deploy/kubernetes-1.16/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The deployment for Kubernetes 1.16 uses CSI 1.0 and thus is
incompatible with Kubernetes < 1.13.

The sidecars depend on 1.15 API changes for migration and resizing,
and 1.14 API changes for CSIDriver and CSINode.
However the hostpath driver doesn't use those features, so this
deployment can work on older Kubernetes versions.
File renamed without changes.
7 changes: 7 additions & 0 deletions deploy/kubernetes-1.16/hostpath/csi-hostpath-csidriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
name: hostpath.csi.k8s.io
spec:
attachRequired: false
podInfoOnMount: false
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ spec:
volumeMounts:
- mountPath: /csi
name: socket-dir
image: quay.io/k8scsi/livenessprobe:v1.0.2
image: quay.io/k8scsi/livenessprobe:v1.1.0
args:
- --csi-address=/csi/csi.sock
- --connection-timeout=3s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
serviceAccountName: csi-provisioner
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.0.1
image: quay.io/k8scsi/csi-provisioner:v1.3.0
args:
- -v=5
- --csi-address=/csi/csi.sock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
serviceAccount: csi-snapshotter
containers:
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.0.1
image: quay.io/k8scsi/csi-snapshotter:v1.2.0
args:
- -v=5
- --csi-address=/csi/csi.sock
Expand Down
13 changes: 4 additions & 9 deletions deploy/util/deploy-hostpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ BASE_DIR=$(dirname "$0")
# If set, the following env variables override image registry and/or tag for each of the images.
# They are named after the image name, with hyphen replaced by underscore and in upper case.
#
# - CSI_ATTACHER_REGISTRY
# - CSI_ATTACHER_TAG
# - CSI_NODE_DRIVER_REGISTRAR_REGISTRY
# - CSI_NODE_DRIVER_REGISTRAR_TAG
# - CSI_PROVISIONER_REGISTRY
Expand Down Expand Up @@ -56,7 +54,6 @@ function rbac_version () {

# get version from `image: quay.io/k8scsi/csi-attacher:v1.0.1`, ignoring comments
version="$(sed -e 's/ *#.*$//' "$yaml" | grep "image:.*$image" | sed -e 's/ *#.*//' -e 's/.*://')"

if $update_rbac; then
# apply overrides
varname=$(echo $image | tr - _ | tr a-z A-Z)
Expand All @@ -75,8 +72,6 @@ function rbac_version () {
# In addition, the RBAC rules can be overridden separately.
CSI_PROVISIONER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-provisioner/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-provisioner.yaml" csi-provisioner false)/deploy/kubernetes/rbac.yaml"
: ${CSI_PROVISIONER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-provisioner/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-provisioner.yaml" csi-provisioner "${UPDATE_RBAC_RULES}")/deploy/kubernetes/rbac.yaml}
CSI_ATTACHER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-attacher/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-attacher.yaml" csi-attacher false)/deploy/kubernetes/rbac.yaml"
: ${CSI_ATTACHER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-attacher/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-attacher.yaml" csi-attacher "${UPDATE_RBAC_RULES}")/deploy/kubernetes/rbac.yaml}
CSI_SNAPSHOTTER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-snapshotter.yaml" csi-snapshotter false)/deploy/kubernetes/rbac.yaml"
: ${CSI_SNAPSHOTTER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-snapshotter.yaml" csi-snapshotter "${UPDATE_RBAC_RULES}")/deploy/kubernetes/rbac.yaml}

Expand All @@ -95,7 +90,7 @@ run () {

# rbac rules
echo "applying RBAC rules"
for component in CSI_PROVISIONER CSI_ATTACHER CSI_SNAPSHOTTER; do
for component in CSI_PROVISIONER CSI_SNAPSHOTTER; do
eval current="\${${component}_RBAC}"
eval original="\${${component}_RBAC_YAML}"
if [ "$current" != "$original" ]; then
Expand Down Expand Up @@ -146,10 +141,10 @@ done
# Wait until all pods are running. We have to make some assumptions
# about the deployment here, otherwise we wouldn't know what to wait
# for: the expectation is that we run attacher, provisioner,
# snapshotter, socat and hostpath plugin in the default namespace.
# for: the expectation is that we run provisioner, snapshotter,
# socat and hostpath plugin in the default namespace.
cnt=0
while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) -lt 5 ] || ! kubectl describe volumesnapshotclasses.snapshot.storage.k8s.io 2>/dev/null >/dev/null; do
while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) -lt 4 ] || ! kubectl describe volumesnapshotclasses.snapshot.storage.k8s.io 2>/dev/null >/dev/null; do
if [ $cnt -gt 30 ]; then
echo "Running pods:"
kubectl describe pods
Expand Down

0 comments on commit e2ad5a9

Please sign in to comment.