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

Kubernetes CSI - Persistent Volume Source Type #55204

Merged
merged 2 commits into from Nov 18, 2017
Merged

Kubernetes CSI - Persistent Volume Source Type #55204

merged 2 commits into from Nov 18, 2017

Conversation

vladimirvivien
Copy link
Member

@vladimirvivien vladimirvivien commented Nov 7, 2017

What this PR does / why we need it:
This PR is to track the addition of new API type CSIPersistentVolumeSource that will be used as PersistentVolume for storage sources managed by CSI drivers.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
xref kubernetes/enhancements#178

Special notes for your reviewer:

Other CSI Volume Plugin PRs:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 7, 2017
@k8s-github-robot k8s-github-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Nov 7, 2017
Copy link
Member

@dixudx dixudx left a comment

Choose a reason for hiding this comment

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

@vladimirvivien I didn't see MountInterface was implemented for csi in this PR.

@jsafrane @rootfs PTAL.

pkg/api/types.go Outdated

// VolumeHandle is the unique volume name returned by the CSI volume
// plugin’s CreateVolume to refer to the volume on all subsequent calls.
VolumeHandle string
Copy link
Member

Choose a reason for hiding this comment

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

Add // Required for VolumeHandle.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dixudx will add // Required

if len(csi.VolumeHandle) == 0 {
allErrs = append(allErrs, field.Required(fldPath.Child("volumeHandle"), ""))
}

Copy link
Member

Choose a reason for hiding this comment

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

Also need to validate MountSecretRef and AttachSecretRef if they are not nil.

Like,

if csi.MountSecretRef != nil {
		if len(csi.MountSecretRef.Name) == 0 {
			allErrs = append(allErrs, field.Required(fldPath.Child("MountSecretRef", "name"), ""))
		}
		...
}

Copy link
Member Author

Choose a reason for hiding this comment

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

@dixudx ok good catch. Will look into this as well. Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dixudx I dbl checked, MountSecretRef is no longer part of the API type.

@vladimirvivien vladimirvivien changed the title K8s csi volume source Kubernetes CSI - Adding Persistent Volume Source Type Nov 7, 2017
@vladimirvivien vladimirvivien changed the title Kubernetes CSI - Adding Persistent Volume Source Type Kubernetes CSI - Persistent Volume Source Type Nov 7, 2017
@vladimirvivien
Copy link
Member Author

vladimirvivien commented Nov 7, 2017

@dixudx thanks for the review. What do you mean by MountInterface? (Are you referring to the volume.Mounter interface ?) Please point me where I can do it. Thank you!

I am also working on #54529 which is the actual volume plugin impl for CSI.

@jsafrane
Copy link
Member

jsafrane commented Nov 8, 2017

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 8, 2017
@@ -105,6 +107,7 @@ func ProbeExpandableVolumePlugins(config componentconfig.VolumeConfiguration) []
allPlugins = append(allPlugins, scaleio.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, storageos.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, fc.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, fc.ProbeVolumePlugins()...)
Copy link
Member

Choose a reason for hiding this comment

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

fc -> csi

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

errfield: "driver",
},
{
name: "missing volume handle",
Copy link
Member

Choose a reason for hiding this comment

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

some successful test would be nice here, both of the current ones are error cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

added couple of successful tests.

@@ -1073,6 +1073,14 @@ func printFlockerVolumeSource(flocker *api.FlockerVolumeSource, w PrefixWriter)
flocker.DatasetName, flocker.DatasetUUID)
}

func printCSIPersistentVolumeSource(csi *api.CSIPersistentVolumeSource, w PrefixWriter) {
w.Write(LEVEL_2, "Type:\tCSIVolume (a generic volume resource that represents a volume managed by an external CSI plugin)\n"+
Copy link
Member

Choose a reason for hiding this comment

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

CSI -> Container Storage Interface? At least for now, before it gets well-known.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added full CSI name

pkg/api/types.go Outdated
@@ -391,6 +391,9 @@ type PersistentVolumeSource struct {
// More info: https://releases.k8s.io/HEAD/examples/volumes/storageos/README.md
// +optional
StorageOS *StorageOSPersistentVolumeSource
// CSI represents storage that handled by an external CSI driver
Copy link
Member

Choose a reason for hiding this comment

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

CSI -> Container Storage Interface?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. Added full name.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2017
pkg/api/types.go Outdated
// This may be empty if no secret is required. If the secret object contains
// more than one secret, all secrets are passed.
// +optional
MountSecretRef *SecretReference
Copy link
Member

Choose a reason for hiding this comment

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

did we remove secret refs in the proposal?

Copy link
Member Author

Choose a reason for hiding this comment

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

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 14, 2017
@vladimirvivien
Copy link
Member Author

/test pull-kubernetes-verify

@vladimirvivien
Copy link
Member Author

/test pull-kubernetes-unit

1 similar comment
@vladimirvivien
Copy link
Member Author

/test pull-kubernetes-unit

// This may be empty if no secret is required. If the secret object contains
// more than one secret, all secrets are passed.
// +optional
MountSecretRef *SecretReference
Copy link
Member

Choose a reason for hiding this comment

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

Secrets were postponed to future release, please remove them.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, github still shows that MountSecretRef is present in the first commit and at the same time it shows this review remark has been resolved / relevant code has been modified.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, you put it into the commit with generated code. Sorry for the noise.

Still, IMO it should be squashed into the first commit for further review. Nobody looks at the generated stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jsafrane ah ok, that commit slipped in to the generated stuff. I will fix that. Thanks.

@jsafrane
Copy link
Member

lgtm from sig-storage point of view

/assign @thockin @liggitt
for API review

@saad-ali
Copy link
Member

/lgtm
/approve

@thockin for API review.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2017
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2017
@saad-ali
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2017
@jsafrane
Copy link
Member

@thockin, can you please approve? It's blocking subsequent PRs.

@@ -1318,6 +1318,19 @@ func validateStorageOSPersistentVolumeSource(storageos *core.StorageOSPersistent
return allErrs
}

func validateCSIPersistentVolumeSource(csi *core.CSIPersistentVolumeSource, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
Copy link
Member

Choose a reason for hiding this comment

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

Please add a feature gate check:

if !utilfeature.DefaultFeatureGate.Enabled(features.CSIPersistentVolume) {
  allErrs = append(allErrs, field.Forbidden(fldPath, "field is disabled by feature-gate CSIPersistentVolume"))
}

This commit tracks source code update to support the CSI volume source type additionn.
This commit tracks all auto-generated sources.
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 18, 2017
@saad-ali
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 18, 2017
@thockin
Copy link
Member

thockin commented Nov 18, 2017

/approve

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saad-ali, thockin, vladimirvivien

Associated issue: 178

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 18, 2017
@saad-ali saad-ali added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Nov 18, 2017
@saad-ali saad-ali added this to the v1.9 milestone Nov 18, 2017
@saad-ali saad-ali added kind/feature Categorizes issue or PR as related to a new feature. sig/storage Categorizes an issue or PR as relevant to SIG Storage. labels Nov 18, 2017
@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Pull Request Needs Approval

@erictune @liggitt @saad-ali @thockin @vladimirvivien @yujuhong @kubernetes/sig-storage-misc

Action required: This pull request must have the status/approved-for-milestone label applied by a SIG maintainer. If the label is not applied within 6 days, the pull request will be moved out of the v1.9 milestone.

Pull Request Labels
  • sig/storage: Pull Request will be escalated to these SIGs if needed.
  • priority/important-soon: Escalate to the pull request owners and SIG owner; move out of milestone after several unsuccessful escalation attempts.
  • kind/feature: New functionality.
Help

@saad-ali
Copy link
Member

/test pull-kubernetes-node-e2e

1 similar comment
@saad-ali
Copy link
Member

/test pull-kubernetes-node-e2e

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 928c85f into kubernetes:master Nov 18, 2017
k8s-github-robot pushed a commit that referenced this pull request Nov 22, 2017
Automatic merge from submit-queue (batch tested with PRs 54529, 53765). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubernetes CSI - in-tree Plugin Implementation

**What this PR does / why we need it**:
This PR is part of the internal Kubernetes CSI Volume plugin.  It implements the Attach/Detach/Mount/Unmount API.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: kubernetes/enhancements#178

**Special notes for your reviewer**:
- Implements feature kubernetes/enhancements#178
- Designed kubernetes/community#1258

Other CSI Volume plugin PRs
- CSI Persistent Volume Source - #55204

**Release note**:
```release-note
NONE
```
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. milestone/needs-approval priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants