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

Add blog post for Provision volumes from cross namespace data sources #37628

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

ttakahashi21
Copy link
Contributor

@ttakahashi21 ttakahashi21 commented Oct 31, 2022

Add blog for Provision volumes from cross namespace data sources

■KEP
Please see CrossNamespaceVolumeDataSource

■API Change (Merge)
kubernetes/kubernetes#113186

■Controller (Under Review)
kubernetes-csi/external-provisioner#805

@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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 31, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @ttakahashi21!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 31, 2022
@k8s-ci-robot k8s-ci-robot added area/blog Issues or PRs related to the Kubernetes Blog subproject language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Oct 31, 2022
@netlify
Copy link

netlify bot commented Oct 31, 2022

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit d7a69f0
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/6392113b3707e9000801896b
😎 Deploy Preview https://deploy-preview-37628--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Thanks. Here's some early feedback that I hope is useful.

The following things are required to use cross namespace volume provisioning:

* Enable the `CrossNamespaceVolumeDataSource` feature gate
* Install a CRD for the specific `VolumeSnapShot controller`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Install a CRD for the specific `VolumeSnapShot controller`
* Install a CRD for the specific `VolumeSnapShot` controller

Comment on lines 36 to 44
```terminal
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml


kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
```
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend linking to a specific commit, and not to the master branch. That keeps the hyperlink valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The description has been removed. Because it changed to prerequisite work.

* Install the `VolumeSnapShot controller` itself
* Install the `External Provisioner controller` itself
* Install the `Container Stroge Interface Driver` itself

Copy link
Contributor

Choose a reason for hiding this comment

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

Do people also need to install the ReferenceGrant CRD from Gateway API?

volumeMode: Filesystem
```

Note This is only the simplest example.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Note This is only the simplest example.
That is a simple example. For real world use, you might want to use a more complex approach.

kubectl apply -f examples/csi-snapshot-v1beta1.yaml
```

6. Ceate a ns1 namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
6. Ceate a ns1 namespace
6. Create a new namespace named `ns1`

Comment on lines 68 to 75
5. Create StorageClass, PVC, and VolumeSnapshot by the examples in the csi-hostpath repo

```terminal
cd /tmp/csi-driver-host-path
kubectl apply -f examples/csi-storageclass.yaml
kubectl apply -f examples/csi-pvc.yaml
kubectl apply -f examples/csi-snapshot-v1beta1.yaml
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid mentioning host path volumes? People use volume type even when it's not wise to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is possible. In that case, it is assumed that there is a CSI driver setup, snapshot, etc. The implementation procedure does not include prerequisite work. Is this alright with you?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you change hostpath to example then that's good for me. And then tell people they'll need to pick an actual storage driver if they want to follow along from home.

(aside: the text assumed that /tmp/csi-driver-host-path contains manifests, which it usually doesn't, so we were already assuming that people had extra steps to take).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for advising. I decided not to write the description of CSI-Hostpath.


The following things are required to use cross namespace volume provisioning:

* Enable the `CrossNamespaceVolumeDataSource` feature gate
Copy link
Contributor

Choose a reason for hiding this comment

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

good to mention where exactly ( api server/kubelet/..etc)?

cd /tmp/csi-driver-host-path
kubectl apply -f examples/csi-storageclass.yaml
kubectl apply -f examples/csi-pvc.yaml
kubectl apply -f examples/csi-snapshot-v1beta1.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

just use examples/csi-snapshot-v1.yaml

@harshitasao
Copy link
Contributor

Hi @ttakahashi21 , v1.26 Comms Shadow here. This feature blog is on a feature tracked for release, the deadline for submitting a draft is the 29th of November, this should be considered the hard limit since we will need to review/edit/discuss the draft, so if at all possible it's better to submit it earlier to avoid any problems.

Any doubts, we're here to help!


Kubernetes v1.26, released earlier this month, introduced an enable usage of provision of persisten volume claim from volume snapshot in other namespaces.
Before Kubernetes v1.25, by using volume snapshots feature, users can provision volumes from snapshots. However, it only works for the `VolumeSnapshot` in the samme namespace, therefore users can't provision a persisten volume claim in one namespace from a `VolumeSnapshot` in other namespace. On the other hand, there are use cases that require to share the `VolumeSnapshot` across namespaces.
To solve this problem,Kubernetes v1.26 includes a new API field called `dataSourceRef2`.
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 blog needs to be updated to reflect the changes in the implementation, i.e., it is dataSourceRef that is updated to include a namespace and there isn't a dataSourceRef2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Takafumi Takahashi (Hitachi Vantara)

Kubernetes v1.26, released earlier this month, introduced an enable usage of provision of persisten volume claim from volume snapshot in other namespaces.
Before Kubernetes v1.25, by using volume snapshots feature, users can provision volumes from snapshots. However, it only works for the `VolumeSnapshot` in the samme namespace, therefore users can't provision a persisten volume claim in one namespace from a `VolumeSnapshot` in other namespace. On the other hand, there are use cases that require to share the `VolumeSnapshot` across namespaces.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
Before Kubernetes v1.25, by using volume snapshots feature, users can provision volumes from snapshots. However, it only works for the `VolumeSnapshot` in the samme namespace, therefore users can't provision a persisten volume claim in one namespace from a `VolumeSnapshot` in other namespace. On the other hand, there are use cases that require to share the `VolumeSnapshot` across namespaces.
Before Kubernetes v1.25, by using volume snapshots feature, users can provision volumes from snapshots. However, it only works for the `VolumeSnapshot` in the same namespace, therefore users can't provision a persisten volume claim in one namespace from a `VolumeSnapshot` in other namespace. On the other hand, there are use cases that require to share the `VolumeSnapshot` across namespaces.

@@ -0,0 +1,133 @@
---
layout: blog
title: "Kubernetes 1.26: alpha support for provision volumes from cross-namespace snapshots"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
title: "Kubernetes 1.26: alpha support for provision volumes from cross-namespace snapshots"
title: "Kubernetes v1.26: alpha support for provision volumes from cross-namespace snapshots"

The enhancement proposal,
[Provision volumes from cross-namespace snapshots](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3294-provision-volumes-from-cross-namespace-snapshots), includes lots of detail about the history and technical implementation of this feature.

Please get involved by joining the Kubernetes storage SIG to help us enhance this
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Please get involved by joining the Kubernetes storage SIG to help us enhance this
Please get involved by joining the Kubernetes SIG Storage to help us enhance this

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, “the Kubernetes storage SIG” is fine. Expanded out, it'd be “the Kubernetes storage special interest group” which is idiomatic.

@ttakahashi21 ttakahashi21 changed the title [WIP] Add blog post for Provision volumes from cross namespace snapshot [WIP] Add blog post for Provision volumes from cross namespace data sources Nov 28, 2022
@ttakahashi21 ttakahashi21 changed the title [WIP] Add blog post for Provision volumes from cross namespace data sources Add blog post for Provision volumes from cross namespace data sources Nov 28, 2022
@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 Nov 28, 2022
@tengqm
Copy link
Contributor

tengqm commented Nov 29, 2022

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Nov 29, 2022
@ttakahashi21
Copy link
Contributor Author

/assign msau42

@fsmunoz
Copy link
Contributor

fsmunoz commented Nov 30, 2022

Hello, Comms Lead for v1.26 here: this Feature Blog PR is confirmed for the post-release Feature Blog series. We will add the publishing date in the next days. Thank you for your work!

@harshitasao
Copy link
Contributor

Hello, Comms Shadow for v1.26 here. The publication order and date for the Feature Blog series has been finalized and the tracking board updated (cf. kubernetes/sig-release#2105).
The publication date for this article is 02-01-2023 (January 02).
Thank you!

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Thanks

Comment on lines 11 to 13
Kubernetes v1.26, released earlier this month, introduced an enable the usage of
cross namespace volume data source to allow you to specify a namespace
in the `dataSourceRef` field of a PersistentVolumeClaim.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Kubernetes v1.26, released earlier this month, introduced an enable the usage of
cross namespace volume data source to allow you to specify a namespace
in the `dataSourceRef` field of a PersistentVolumeClaim.
Kubernetes v1.26, released earlier this month, introduced an alpha feature that
lets you specify a data source for a PersistentVolumeClaim, even where the source
data belong to a different namespace.
With the new feature enabled, you specify a namespace in the `dataSourceRef` field of
a new PersistentVolumeClaim. Once Kubernetes checks that access is OK, the new
PersistentVolume can populate its data from the storage source specified in that other
namespace.

cross namespace volume data source to allow you to specify a namespace
in the `dataSourceRef` field of a PersistentVolumeClaim.
Before Kubernetes v1.26, by using `AnyVolumeDataSource` feature,
users can provision volumes from data source in the same namespace.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
users can provision volumes from data source in the same namespace.
you could already provision new volumes from a data source in the **same**
namespace.

namespace: prod
volumeMode: Filesystem
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Any summary here?

For example: “Kubernetes creates a PersistentVolume and the CSI driver populates it with data from the snapshot”.

@fsmunoz
Copy link
Contributor

fsmunoz commented Dec 6, 2022

Holding until the release day.
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 6, 2022
@fsmunoz
Copy link
Contributor

fsmunoz commented Dec 7, 2022

@ttakahashi21 if you can go through the comments/suggestions above it would be great, with the release date being tomorrow we're doing our best to have feature blogs in a ready to publish state. Many thanks!

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

An important date fix, plus less critical other feedback.


The following things are required to use cross namespace volume provisioning:

* Enable the `AnyVolumeDataSource` and `CrossNamespaceVolumeDataSource` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the kube-apiserver and kube-controller-manager
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit)

Suggested change
* Enable the `AnyVolumeDataSource` and `CrossNamespaceVolumeDataSource` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the kube-apiserver and kube-controller-manager
* Enable the `AnyVolumeDataSource` and `CrossNamespaceVolumeDataSource` [feature gates](/docs/reference/command-line-tools-reference/feature-gates/) for the kube-apiserver and kube-controller-manager

@sftim
Copy link
Contributor

sftim commented Dec 8, 2022

The important bit that still needs attention is #37628 (comment)

@sftim
Copy link
Contributor

sftim commented Dec 8, 2022

Thanks

/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 Dec 8, 2022
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: cf79d15a0a569c9a07b2e58946b4aea75deff3f6

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sftim

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2022
@sftim
Copy link
Contributor

sftim commented Dec 11, 2022

/remove-label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot removed the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Dec 11, 2022
@fsmunoz
Copy link
Contributor

fsmunoz commented Dec 13, 2022

v1.26 was released and everything else is in place, removing hold.

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8240103 into kubernetes:main Dec 13, 2022
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. area/blog Issues or PRs related to the Kubernetes Blog subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Published
Development

Successfully merging this pull request may close these issues.

9 participants