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

Moves hostpath driver from kubernetes-csi/drivers monorepo #1

Merged
merged 164 commits into from
Jan 23, 2019

Conversation

vladimirvivien
Copy link
Member

@vladimirvivien vladimirvivien commented Dec 13, 2018

This PR is to setup and migrate the Hostpath CSI driver from the github.com/kubernetes-csi/drivers mono repo to its own repository.

  • Copies source from drivers mono repo
  • Rearrange packages and names
  • Adjust Makefile and other build files
  • Introduce deploy/deploy-hostpath.sh to automatically install hostpath in cluster
  • Adds README documentation

chakri-nelluri and others added 30 commits November 15, 2017 15:28
add hostpath driver to test create/delete volume
hostpath: create and delete volume
Signed-off-by: Huamin Chen <[email protected]>
- Add csi-nodeplugin-simplenfs-flexdriver dockerfile & kubernetes dep…
# where it is executed.

K8S_RELEASE=${K8S_RELEASE:-"release-1.13"}
CSI_RELEASE=${CSI_RELEASE:-"release-1.0"}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these two variables are a bit misleading. Instead of selecting one particular, well-tested release they reference the latest code in certain release branches.

I understand that this is easier to implement and review, but is it really what we want?

I personally would prefer a solution where for each of the sidecars we install exactly the RBAC rules released together with that sidecar image.

There's also no guarantee that we will always have the same release branch for all apps. For example, we might release an external-provisioner 1.1.0 on a release-1.1 branch while the rest need no major new release and thus stay on the release-1.0 branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

One way to avoid duplicating the versions of the sidecars would be to grep for each image in the .yaml file and rename it with sed to obtain the corresponding RBAC yaml URL.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pohly I am taking a simple approach, in the next push, to just create a variable for each component. That way user of the script can set versions independently.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment that explains the simplification and warns about the downside ("pick the latest version on a branch, which might not match what was released together with the current set of containers")?

Copy link
Contributor

Choose a reason for hiding this comment

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

I went ahead and changed it so that the version for the RBAC files is taken from the version in the .yaml: vladimirvivien@557d126

apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-node-sa
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this entire file is obsolete.

The hostpath driver should use the RBAC rules required by the csi-node-driver-registrar. At least on master, that file was removed (kubernetes-csi/node-driver-registrar#7 (comment)), but the release-1.0 still has it and therefore it should be used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@pohly Ok removed the rbac rule for node-driver-registrar

Copy link
Contributor

Choose a reason for hiding this comment

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

You probably haven't pushed that change yet, have you? I updated the version of the node-driver-registrar and in the process removed the RBAC file and service account because it was removed also from that new release: vladimirvivien@76766f1

app/main.go Outdated
/*
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move to a cmd/hostpathplugin directory.


# apply CSIDriver and CSINodeInfo API objects
kubectl apply -f https://raw.githubusercontent.com/kubernetes/csi-api/${K8S_RELEASE}/pkg/crd/manifests/csidriver.yaml --validate=false
kubectl apply -f https://raw.githubusercontent.com/kubernetes/csi-api/${K8S_RELEASE}/pkg/crd/manifests/csinodeinfo.yaml --validate=false
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not always needed, is it?

Worse, can it fail when the CRDs were already installed, which (if I'm not mistaken) is how clusters now should be brought up?

Copy link
Member Author

Choose a reason for hiding this comment

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

@pohly I don't have a good fix for this. I will add a flag (or try to detect if they are there) to install only when needed. Thanks for pointing this out.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with how this is now handled (installation disabled by default).

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vladimirvivien
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: childsb

If they are not already assigned, you can assign the PR to them by writing /assign @childsb in a comment when ready.

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

The pull request process is described here

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

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please email the CNCF helpdesk: [email protected]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 16, 2019
The RBAC rules were already obsolete before and in 1.0.2 they were
also removed officially
(https://github.com/kubernetes-csi/node-driver-registrar/releases/tag/v1.0.2).
Picking the RBAC rules from a release branch is not quite accurate (we
want the rules released together with the tagged version) and is
something that must be kept in sync manually.

It is better to not hard-code this in the script and instead get the
exact versions from the .yaml files.

There should be no need for users to pass parameters to the script, so
let's just mention that this is possible without going into details in
the README.md. The previous instructions were out-dated, too.
@pohly
Copy link
Contributor

pohly commented Jan 21, 2019

/lgtm

We can merge this PR as-is right now and then merge vladimirvivien#1 on top of it, or @vladimirvivien can accept it into his branch and then we merge here. I'm fine with both approaches.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 21, 2019
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 23, 2019
@pohly
Copy link
Contributor

pohly commented Jan 23, 2019

/lgtm

@saad-ali you might have to push this PR directly to master because of the CLA check for some of the commits that this is pulling in from the old repo.

@dims ran into a similar issue with moving code into kubernetes/utils, see kubernetes/utils#55 (comment) for the suggested solution (same as above).

@saad-ali
Copy link
Member

Ack merging

@saad-ali saad-ali merged commit 3b9819c into kubernetes-csi:master Jan 23, 2019
pohly pushed a commit to pohly/csi-driver-host-path that referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.