Skip to content

Add snapshot beta CRD deployment for 1.17#98

Merged
k8s-ci-robot merged 20 commits into
kubernetes-csi:masterfrom
xing-yang:snapshot_beta
Dec 5, 2019
Merged

Add snapshot beta CRD deployment for 1.17#98
k8s-ci-robot merged 20 commits into
kubernetes-csi:masterfrom
xing-yang:snapshot_beta

Conversation

@xing-yang

Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR adds snapshot beta CRD deployment for 1.17.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
Note: This PR is not ready for review.

Does this PR introduce a user-facing change?:

Adds snapshot beta CRD deployment for 1.17

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 18, 2019
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 18, 2019
@ggriffiths ggriffiths force-pushed the snapshot_beta branch 2 times, most recently from 579ea03 to ee5fd27 Compare October 22, 2019 22:45
: ${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}
# TODO: Change back to dynamic path after image is released officially
CSI_SNAPSHOTTER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/deploy/kubernetes/rbac.yaml"
: ${CSI_SNAPSHOTTER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/deploy/kubernetes/rbac.yaml}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So before the snapshot beta PR is merged, the rbac.yaml here won't work. You can create a rbac.yaml temporarily so you can test it manually.

Add the following to the existing rbac.yaml:

  • apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotcontents/status"]
    verbs: ["update"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to link kubernetes-latest to the 1.17 directory:
https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/deploy/kubernetes-latest

Updated this symlink

kind: VolumeSnapshotClass
metadata:
name: csi-hostpath-snapclass
snapshotter: hostpath.csi.k8s.io

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotClass
metadata:
name: csi-hostpath-snapclass
driver: hostpath.csi.k8s.io
deletionPolicy: Delete

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we still need to pre-create snapshotclass with the new apis.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this

@xing-yang

Copy link
Copy Markdown
Contributor Author

storageclass.yaml:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: csi-hostpath-sc
provisioner: hostpath.csi.k8s.io
reclaimPolicy: Delete
volumeBindingMode: Immediate

snapshot.yaml

apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
  name: new-snapshot-demo
spec:
  volumeSnapshotClassName: csi-hostpath-snapclass
  source:
    persistentVolumeClaimName: hpvc

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 25, 2019
@xing-yang

Copy link
Copy Markdown
Contributor Author

We also need to link kubernetes-latest to the 1.17 directory:
https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/deploy/kubernetes-latest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 25, 2019
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 25, 2019
#: ${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}
# TODO: Change back to dynamic path after image is released officially
#CSI_SNAPSHOTTER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/deploy/kubernetes/rbac.yaml"
#: ${CSI_SNAPSHOTTER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/deploy/kubernetes/rbac.yaml}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should work now. The snapshot beta API PR is merged and its rbac.yaml is updated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this

containers:
- name: csi-snapshotter
# TODO: change to official image when released
image: quay.io/k8scsi/csi-snapshotter:testsnapshotbeta

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the following image which is build from the master code:
image: quay.io/k8scsi/csi-snapshotter:canary

serviceAccountName: csi-provisioner
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:testsnapshotbeta #v1.4.0-rc1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the following image which uses the merged snapshot beta APIs:
quay.io/k8scsi/csi-provisioner:testsplitcontroller

@@ -0,0 +1,74 @@
---

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update these 3 CRDs using the lates ones here. They are merged into master branch of external-snapshotter now:
https://github.com/kubernetes-csi/external-snapshotter/tree/master/config/crd

@ggriffiths ggriffiths Oct 28, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with the latest CRDs

Comment thread deploy/kubernetes-1.17/README.md Outdated
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Readme does not apply any more. Replace this readme with following:

The deployment for Kubernetes 1.17 installs VolumeSnapshot Beta CRDs and thus is imcompatible
with Kubernetes < 1.17 when the VolumeSnapshot CRDs were Alpha.

Comment on lines +78 to +81
#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}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't change these RBAC's. These should just work?

CSI_PROVISIONER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-provisioner/master/deploy/kubernetes/rbac.yaml"
: ${CSI_PROVISIONER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-provisioner/master/deploy/kubernetes/rbac.yaml}
CSI_ATTACHER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-attacher/master/deploy/kubernetes/rbac.yaml"
: ${CSI_ATTACHER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-attacher/master/deploy/kubernetes/rbac.yaml}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need these temporary rbac files any more.

@ggriffiths ggriffiths Oct 28, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed these

args:
- -v=5
- --csi-address=/csi/csi.sock
- --connection-timeout=15s

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag is deprecated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, removed

@xing-yang xing-yang changed the title WIP: Add snapshot beta CRD deployment for 1.17 Add snapshot beta CRD deployment for 1.17 Oct 29, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 29, 2019
k8s-ci-robot and others added 2 commits December 2, 2019 06:35
…ure can be tested. Test cases that test accessing volumes from multiple nodes need to be skipped
@ggriffiths

Copy link
Copy Markdown
Contributor

Addressed most recent round of feedback @xing-yang @msau42

/test pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master

Comment thread release-tools/prow.sh Outdated

kubectl apply -f "https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${CSI_SNAPSHOTTER_VERSION}/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml"
cnt=0
expected_running_pods=3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pull the "replicas" value from the deployment file? (It's currently one)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this.
/test pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master

@ggriffiths

Copy link
Copy Markdown
Contributor

Was missing the snapshotclass file in the k8s 1.17 directory. Just re-added it.
/test pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master

@msau42

msau42 commented Dec 4, 2019

Copy link
Copy Markdown
Collaborator

lgtm! thanks for all your work on this!
/approve

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: msau42, xing-yang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ggriffiths

Copy link
Copy Markdown
Contributor

lgtm! thanks for all your work on this!
/approve

Thanks! I'll update my PR to the release tools repo with the latest prow.sh changes. Once that's merged, I'll update the PR with the final commits.

Signed-off-by: Grant Griffiths <grant@portworx.com>
@ggriffiths

Copy link
Copy Markdown
Contributor

Here is the PR for these prow.sh changes. Updated it with my latest changes to release-tools/prow.sh
kubernetes-csi/csi-release-tools#49
@xing-yang @msau42

k8s-ci-robot and others added 4 commits December 4, 2019 06:38
Enable topology testing with hostpath driver
…ersion_gt

Improve snapshot-controller running check and version_gt to support multiple formats
Signed-off-by: Grant Griffiths <grant@portworx.com>
@ggriffiths

Copy link
Copy Markdown
Contributor

Tests seem to failing after I did
git subtree pull --prefix=release-tools https://github.com/kubernetes-csi/csi-release-tools.git master

if [ "$ARCH" = "amd64" ]; then \
	CGO_ENABLED=0 GOOS=windows go build -mod=vendor -a -ldflags '-X main.version=v1.3.0-rc1-40-ga068236c -extldflags "-static"' -o ./bin/hostpathplugin.exe ./cmd/hostpathplugin ; \
	CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -mod=vendor -a -ldflags '-X main.version=v1.3.0-rc1-40-ga068236c -extldflags "-static"' -o ./bin/hostpathplugin-ppc64le ./cmd/hostpathplugin
/bin/sh: 3: Syntax error: end of file unexpected (expecting "fi")
make: *** [release-tools/build.make:71: build-hostpathplugin] Error 2

@msau42

msau42 commented Dec 4, 2019

Copy link
Copy Markdown
Collaborator

My bad, I think it's missing a "\" at the end

@ggriffiths

Copy link
Copy Markdown
Contributor

Updated with the fix to build.make
/test pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master

@ggriffiths

Copy link
Copy Markdown
Contributor

/test pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master

@ggriffiths

Copy link
Copy Markdown
Contributor

Seems like a change is incompatible with pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master.

I just re-ran the following on a local k8s 1.16 cluster
install_snapshot_crds
install_snapshot_controller
deploy/kubernetes-1.17/deploy-hostpath.sh
and tested snapshots manually, and everything seems fine.

@msau42 do you know of any other prow.sh or test-infra changes that may cause this test to fail?
https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-csi_csi-driver-host-path/98/pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master/1202366525122547714

@msau42

msau42 commented Dec 5, 2019

Copy link
Copy Markdown
Collaborator
Dec  4 23:41:34.186: INFO: At 2019-12-04 23:36:35 +0000 UTC - event for pod-subpath-test-hostpath-csi-k8s-io-dynamicpv-7ntl: {kubelet csi-prow-worker} FailedMount: MountVolume.MountDevice failed for volume "pvc-0200512e-849b-4df5-b90e-547ba8e30c64" : kubernetes.io/csi: attacher.MountDevice failed to create newCsiDriverClient: driver name hostpath.csi.k8s.io not found in the list of registered CSI drivers

Looks like the volume got provisioned on node csi-prow-worker2, but the Pod got scheduled on csi-prow-worker:

I1204 23:36:19.514673       1 event.go:258] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"provisioning-2145", Name:"hostpath.csi.k8s.iov56w5", UID:"0200512e-849b-4df5-b90e-547ba8e30c64", APIVersion:"v1", ResourceVersion:"2248", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "provisioning-2145/hostpath.csi.k8s.iov56w5"
I1204 23:36:19.522595       1 connection.go:183] GRPC response: {"volume":{"accessible_topology":[{"segments":{"topology.hostpath.csi/node":"csi-prow-worker2"}}],"capacity_bytes":1048576,"volume_id":"df74845e-16ee-11ea-8c4c-3edb8610010e"}}

image: quay.io/k8scsi/csi-provisioner:v1.5.0-rc1
args:
- -v=5
- --csi-address=/csi/csi.sock

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you're missing the "--feature-gates=Topology=true" flag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 👍 Will add now.

Signed-off-by: Grant Griffiths <grant@portworx.com>
@ggriffiths

Copy link
Copy Markdown
Contributor

/test pull-kubernetes-csi-csi-driver-host-path-1-17-on-kubernetes-master

@ggriffiths

Copy link
Copy Markdown
Contributor

Looks like that did the job! Thanks @msau42 !

All tests are passing now.
/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants