Skip to content

Conversation

@ttakahashi21
Copy link
Contributor

@ttakahashi21 ttakahashi21 commented Nov 9, 2022

Add document 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 this to the 1.26 milestone Nov 9, 2022
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 9, 2022
@netlify
Copy link

netlify bot commented Nov 9, 2022

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit e837f0f
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/6384b02d18486600080cdef8

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 9, 2022
@k8s-ci-robot k8s-ci-robot requested a review from kbhawkey November 9, 2022 02:31
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Nov 9, 2022
@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Nov 9, 2022
@ttakahashi21 ttakahashi21 force-pushed the dev-1.26-KEP-3294-doc branch from d5e3277 to 9eb5a89 Compare November 9, 2022 02:52
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. Please also update https://kubernetes.io/docs/concepts/storage/volume-snapshots/#provisioning-volumes-from-snapshots to document the new optional / alpha feature.

This feature gate guards *a group* of CPUManager options whose quality level is beta.
This feature gate will never graduate to stable.
- `CPUManagerPolicyOptions`: Allow fine-tuning of CPUManager policies.
- `CrossNamespaceVolumeDataSource`: Enable usage of Provision of PVCs from VolumeSnasphot in other namespaces.
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
- `CrossNamespaceVolumeDataSource`: Enable usage of Provision of PVCs from VolumeSnasphot in other namespaces.
- `CrossNamespaceVolumeDataSource`: Enable provisioning a {{< glossary_tooltip text="PersistentVolumeClaim" term_id="persistent-volume-claim" >}}
(PVC) that is based on VolumeSnapshot in a different namespace from the PVC.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sftim
Copy link
Contributor

sftim commented Nov 9, 2022

BTW:
if this PR is still draft, that's OK - please mark the PR as draft by, eg, editing its title. If it's not draft, please write a PR description.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 10, 2022
@ttakahashi21 ttakahashi21 changed the title Add document for Provision volumes from cross namespace snapshot [WIP]Add document for Provision volumes from cross namespace snapshot Nov 11, 2022
@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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 11, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 14, 2022
@ttakahashi21 ttakahashi21 changed the title [WIP]Add document for Provision volumes from cross namespace snapshot Add document for Provision volumes from cross namespace snapshot Nov 14, 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 14, 2022
@ttakahashi21
Copy link
Contributor Author

/assign msau42


## Provision of PersistentVolumeClaims from VolumeSnasphot in other namespaces

{{< feature-state for_k8s_version="v1.26" state="alpha" >}}
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be good to incorporate this section into the "Data source references" above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. Fixed ae77a57

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 17, 2022
resources:
requests:
storage: 1Gi
dataSourceRef2:
Copy link
Contributor

Choose a reason for hiding this comment

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

dataSourceRef2 -> dataSourceRef

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.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see the fix. Did you reupload?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I mistake. I fixed now.


* While the `dataSource` field only allows two specific types of objects, the `dataSourceRef` field allows any non-core object, as well as PersistentVolumeClaim objects.
* While the `dataSource` field ignores disallowed values (dropping them), the `dataSourceRef` field preserves all values, and generates an error if a disallowed value is specified.
* While the `dataSource`field only allows local objects, the `dataSourceRef` field allows objects in any namespaces.
Copy link
Member

Choose a reason for hiding this comment

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

I think the first 2 are repeats of L979-L983.

Probably can reword this to say something like

When the CrossNamespaceVolumeDataSource feature is enabled, there are additional differences:
 
* The `dataSource`field only allows local objects, while the `dataSourceRef` field allows objects in any namespaces.  
* `dataSource` and `dataSourceRef` are not synced.

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 suggestion. Fixed 7cfe0a3

same namespace, except for core objects other than PVCs. For clusters that have the feature
gate enabled, use of the `dataSourceRef` is preferred over `dataSource`.

## Cross Namespace Volume Data Source and data sources
Copy link
Member

Choose a reason for hiding this comment

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

Reword to "Cross namespace data sources"

resources:
requests:
storage: 1Gi
dataSourceRef2:
Copy link
Member

Choose a reason for hiding this comment

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

I don't see the fix. Did you reupload?

the process.

### Using Cross Namespace Volume Data Source

Copy link
Member

Choose a reason for hiding this comment

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

Can you add the feature gate tag here, and also add an example of the ReferenceGrant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add feature gate tag and example.

* The `dataSourceRef` field may contain different types of objects, while the `dataSource` field
only allows PVCs and VolumeSnapshots.

When the CrossNamespaceVolumeDataSource feature is enabled, there are additional differences:
Copy link
Member

Choose a reason for hiding this comment

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

Add the backtick, ie CrossNamespaceVolumeDataSource

When the CrossNamespaceVolumeDataSource feature is enabled, there are additional differences:

* The `dataSource` field only allows local objects, while the `dataSourceRef` field allows objects in any namespaces.
* `dataSource` and `dataSourceRef` are not synced.
Copy link
Member

Choose a reason for hiding this comment

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

Oh one more clarification: "When namespace is specified, dataSource and dataSourceRef are not synced"

apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: bar
Copy link
Member

Choose a reason for hiding this comment

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

a more descriptive name may be "allow-ns1-pvc"

@msau42
Copy link
Member

msau42 commented Nov 22, 2022

tech review lgtm, just some minor nits. Looks like the PR needs to be rebased as well.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2022
When the `CrossNamespaceVolumeDataSource` feature is enabled, there are additional differences:

* The `dataSource` field only allows local objects, while the `dataSourceRef` field allows objects in any namespaces.
* When namespace is specified, dataSource and dataSourceRef are not synced.
Copy link
Member

Choose a reason for hiding this comment

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

Add the backticks for dataSource and dataSourceRef

@ttakahashi21 ttakahashi21 force-pushed the dev-1.26-KEP-3294-doc branch 3 times, most recently from 6b17ed0 to c97489e Compare November 27, 2022 06:42
@leonardpahlke
Copy link
Contributor

cc @krol3

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.

For beta, we must make sure mention ReferenceGrants in the authorization documentation - see https://kubernetes.io/docs/reference/access-authn-authz/

A mention in https://kubernetes.io/docs/concepts/security/ would be nice-to-have for beta, too.

It'd be even better to make those changes early, for alpha, but it's not mandatory.

## Cross namespace data sources
{{< feature-state for_k8s_version="v1.26" state="alpha" >}}

Kubernetes supports cross namespace volume data source.
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
Kubernetes supports cross namespace volume data source.
Kubernetes supports cross namespace volume data sources.

Comment on lines 959 to 960
To use cross namespace volume datasource, you must enable the `AnyVolumeDataSource` and `CrossNamespaceVolumeDataSource`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for
Copy link
Contributor

@sftim sftim Nov 28, 2022

Choose a reason for hiding this comment

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

(nit)

Suggested change
To use cross namespace volume datasource, you must enable the `AnyVolumeDataSource` and `CrossNamespaceVolumeDataSource`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for
To use cross namespace volume data sources, you must enable the `AnyVolumeDataSource` and `CrossNamespaceVolumeDataSource`
[feature gates](/docs/reference/command-line-tools-reference/feature-gates/) for

To use cross namespace volume datasource, you must enable the `AnyVolumeDataSource` and `CrossNamespaceVolumeDataSource`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for
the kube-apiserver, kube-controller-manager.
Also, you must enable the `CrossNamespaceVolumeDataSource` feature gate for csi-provisioner.
Copy link
Contributor

@sftim sftim Nov 28, 2022

Choose a reason for hiding this comment

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

(nit)

Suggested change
Also, you must enable the `CrossNamespaceVolumeDataSource` feature gate for csi-provisioner.
Also, you must enable the `CrossNamespaceVolumeDataSource` feature gate for the csi-provisioner.

Also, you must enable the `CrossNamespaceVolumeDataSource` feature gate for csi-provisioner.

Enabling the `CrossNamespaceVolumeDataSource` feature gate allow you to specify a namespace in the dataSourceRef field.
{{< note >}} When a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the [ReferenceGrant documentation](https://gateway-api.sigs.k8s.io/api-types/referencegrant/) for details.
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 >}} When a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the [ReferenceGrant documentation](https://gateway-api.sigs.k8s.io/api-types/referencegrant/) for details.
{{< note >}}
When you specify a namespace for a volume data source, Kubernetes checks for a
ReferenceGrant in the other namespace before accepting the reference.
ReferenceGrant is part of the `gateway.networking.k8s.io` extension APIs.
See [ReferenceGrant](https://gateway-api.sigs.k8s.io/api-types/referencegrant/) in the Gateway API documentation for details.
This means that you must extend your Kubernetes cluster with at least ReferenceGrant from the
Gateway API before you can use this mechanism.
{{< /note >}}

Ideally, we'd also add a glossary entry for ReferenceGrant. We'll definitely need that if this feature moves to beta
and ReferenceGrant is still part of Gateway rather than a general Kubernetes extension.

responsibility of that populator controller to report Events that relate to volume creation and issues during
the process.

### Using Cross Namespace Volume Data Source
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
### Using Cross Namespace Volume Data Source
### Using a cross-namespace volume data source

Even better: add a separate task page, and hyperlink to that task page here. The task can include deploying the CRD for ReferenceGrant.

### Using Cross Namespace Volume Data Source
{{< feature-state for_k8s_version="v1.26" state="alpha" >}}

Create a gateway.networking.k8s.io/ReferenceGrant to allow the namespace owner to accept the reference.
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
Create a gateway.networking.k8s.io/ReferenceGrant to allow the namespace owner to accept the reference.
Create a ReferenceGrant to allow the namespace owner to accept the reference.

The API group is gateway.networking.k8s.io/v1beta1. I don't want to mention gateway.networking.k8s.io as a bare thing for an odd reason: we can't name what this is. I mean, it's a domain name but we don't have a name for “an API group, but just the bit before the slash, no version details”.

namespace: default
spec:
from:
- group: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Optionally, add a comment about why this is blank.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because PersistentVolumeClaim API is core API

Copy link
Contributor

Choose a reason for hiding this comment

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

(don't tell me - tell the readers!)

This feature gate will never graduate to stable.
- `CPUManagerPolicyOptions`: Allow fine-tuning of CPUManager policies.
- `CrossNamespaceVolumeDataSource`: Enable the usage of cross namespace volume data source
to allow you to specify a namespace in the dataSourceRef field.
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
to allow you to specify a namespace in the dataSourceRef field.
to allow you to specify a source namespace in the `dataSourceRef` field of a
PersistentVolumeClaim.

{{< feature-state for_k8s_version="v1.26" state="alpha" >}}

Create a gateway.networking.k8s.io/ReferenceGrant to allow the namespace owner to accept the reference.
Users create a populated volume by referring cross namespace volume data source using the `dataSourceRef` field:
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 create a populated volume by referring cross namespace volume data source using the `dataSourceRef` field:
You define a populated volume by specifying a cross namespace volume data source using the `dataSourceRef` field. You must already have a valid ReferenceGrant in the source namespace:

@krol3
Copy link
Contributor

krol3 commented Nov 28, 2022

Hi @ttakahashi21, This PR needs a doc review by Mon Nov 28th to get this into the release. Please reach out to required SIGs to get their review. Thank you!
cc: @mickeyboxell

@ttakahashi21
Copy link
Contributor Author

@sftim I fixed those that needed fixing.

@ttakahashi21 ttakahashi21 changed the title Add document for Provision volumes from cross namespace snapshot Add document for Provision volumes from cross namespace data sources Nov 28, 2022
@msau42
Copy link
Member

msau42 commented Nov 28, 2022

/lgtm

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

LGTM label has been added.

Git tree hash: 1a00b607ebc0d37c6473d91365cd6ce3a22d5c67

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

/approve

the kube-apiserver, kube-controller-manager.
Also, you must enable the `CrossNamespaceVolumeDataSource` feature gate for the csi-provisioner.

Enabling the `CrossNamespaceVolumeDataSource` feature gate allow you to specify a namespace in the dataSourceRef field.
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
Enabling the `CrossNamespaceVolumeDataSource` feature gate allow you to specify a namespace in the dataSourceRef field.
Enabling the `CrossNamespaceVolumeDataSource` feature gate allow you to specify a
namespace in the `dataSourceRef` field of a PersistentVolumeClaim.

@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 Nov 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit 3d4d447 into kubernetes:dev-1.26 Nov 28, 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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants