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

deployment tweaks #1

Merged
merged 2 commits into from
Jan 23, 2019
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
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,10 @@ The easiest way to test the Hostpath driver is to run `deploy/deploy-hostpath.sh
$ sh deploy/deploy-hostpath.sh
```

Or, if you want to override the version

```shell
$ K8S_RELEASE=1.14 CSI_RELEASE=1.0.1 sh deploy/deploy-hostpath.sh
```

You should see an output similar to the following printed on the terminal showing the application of rbac rules and the result of deploying the hostpath driver, external privisioner and external attacher components:

```shell
customresourcedefinition.apiextensions.k8s.io/csidrivers.csi.storage.k8s.io created
customresourcedefinition.apiextensions.k8s.io/csinodeinfos.csi.storage.k8s.io created
applying RBAC rules
serviceaccount/csi-provisioner created
clusterrole.rbac.authorization.k8s.io/external-provisioner-runner created
clusterrolebinding.rbac.authorization.k8s.io/csi-provisioner-role created
Expand All @@ -35,19 +28,19 @@ clusterrole.rbac.authorization.k8s.io/external-attacher-runner created
clusterrolebinding.rbac.authorization.k8s.io/csi-attacher-role created
role.rbac.authorization.k8s.io/external-attacher-cfg created
rolebinding.rbac.authorization.k8s.io/csi-attacher-role-cfg created
serviceaccount/csi-driver-registrar created
clusterrole.rbac.authorization.k8s.io/driver-registrar-runner created
clusterrolebinding.rbac.authorization.k8s.io/csi-driver-registrar-role created
deploying hostpath components
service/csi-hostpath-attacher created
statefulset.apps/csi-hostpath-attacher created
daemonset.apps/csi-hostpathplugin created
service/csi-hostpath-provisioner created
statefulset.apps/csi-hostpath-provisioner created
serviceaccount/csi-node-sa created
clusterrole.rbac.authorization.k8s.io/csi-node-sa created
clusterrolebinding.rbac.authorization.k8s.io/csi-node-sa created
```

The script can also install CRDs that are needed for alpha features,
but as this is something that should be done by the cluster
provisioning tool it is disabled in the script by default. For this
and other customizations see the source code of the deploy script.

## Run example application and validate

Next, validate the deployment. First, ensure all expected pods are running properly including the external attacher, provisioner, and the actual hostpath driver plugin:
Expand Down
17 changes: 14 additions & 3 deletions deploy/deploy-hostpath.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@
# The script assumes that kubectl is available on the OS path
# where it is executed.

set -e
set -o pipefail

function image_version () {
yaml="$1"
image="$2"

# get version from `image: quay.io/k8scsi/csi-attacher:v1.0.1`
grep "image:.*$image" "$yaml" | sed -e 's/.*:v/v/'
}

BASE_DIR=$(dirname "$0")
K8S_RELEASE=${K8S_RELEASE:-"release-1.13"}
PROVISIONER_RELEASE=${PROVISIONER_RELEASE:-"release-1.0"}
ATTACHER_RELEASE=${ATTACHER_RELEASE:-"release-1.0"}
PROVISIONER_RELEASE=${PROVISIONER_RELEASE:-$(image_version "${BASE_DIR}/hostpath/csi-hostpath-provisioner.yaml" csi-provisioner)}
ATTACHER_RELEASE=${ATTACHER_RELEASE:-$(image_version "${BASE_DIR}/hostpath/csi-hostpath-attacher.yaml" csi-attacher)}
INSTALL_CRD=${INSTALL_CRD:-"false"}
BASE_DIR=$(dirname "$0")

# apply CSIDriver and CSINodeInfo API objects
if [[ "${INSTALL_CRD}" =~ ^(y|Y|yes|true)$ ]] ; then
Expand Down
3 changes: 1 addition & 2 deletions deploy/hostpath/csi-hostpath-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ spec:
labels:
app: csi-hostpathplugin
spec:
serviceAccountName: csi-node-sa
hostNetwork: true
containers:
- name: node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.1
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2
imagePullPolicy: Always
lifecycle:
preStop:
Expand Down
46 changes: 0 additions & 46 deletions deploy/hostpath/csi-hostpath-rbac.yaml

This file was deleted.