In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Target
Currently in Kuberentes, the volume plug-in only supports configuring empty storage volumes. With the introduction of new storage capabilities, including volume snapshots and volume clones, there is a need to support data population while configuring volumes. For example, volumes can be created from snapshot sources or cloned from other volume sources. Depending on where the volume was created, there are two scenarios:
Volume configurators can identify data sources and create volumes directly from data sources (for example, restore snapshots to volumes or clone volumes).
Volume configurator fails to recognize data source and creates empty storage volume. Another external component (data populator) can monitor volume creation and can populate/import data to configured volumes. PVC can only be used after filling the volume with data.
Given that there are many different types of data sources that can be used to populate a volume, we recommend adding a generic "DataSource" field to PersistentVolumeClaimSpec to represent different types of data sources.
PVC API Change
We will add a DataSource field to the PVC to represent the data source prepopulated to the preconfigured volume. For the DataSource field, we define a new type "TypedLocalObjectReference." It is similar to the LocalObjectReference type with an additional Kind field to support multiple data source types. In alpha versions, this data source should be in the same namespace as PVC. This data source is restricted to the same namespace as PVC.
design details
In the first alpha release, we only supported data sources from Snapshot. Therefore, Kind in DataSource must be "VolumeSnapshot." In this case, the provisioner should configure the volume and populate the data in one step. We don't need external data populators yet.
For other types of data sources that require an external data populator, volume creation and data population are two separate steps. PVC / PV can only be marked as ready (bound) when the data is ready and users can start using them. We are working on a separate proposal to address this issue using similar ideas from "Pod Ready ++"(https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md).
Note: In order to use this data source feature, the user/administrator needs to update to a new external provisioner that recognizes the snapshot data source. Otherwise, the data source is ignored and an empty storage volume is created.
example
This example is based on the local-up environment started with kubernetes version 1.12 and uses csi-hostpath as a test plug-in to demonstrate snapshot creation and restore of data volumes from snapshots. The yaml used in the example can be found at https://github.com/wackxu/csi-snapshot-test.
Step 1: Download version 1.12 of kubernetes and modify the hack/local-up-cluster.sh script as follows:
Line 26 is modified to allow containers to be started in privileged form.
Line 131 adds the following to turn on the VolumeSnapshotDataSource property switch.
Then we can start the local-up cluster.
Step 2: Deploy sidecar containers such as external-provisioner, external-snapshooter, external-attacher, driver-registrar, hostpathplugin, etc. The deployment script contains all the resources needed for serviceaccount, clusterrole, and so on.
Check csi-pod, containers are all running.
Step 3: Create storageClass and pvc, check pvc and pv status created, all are in bound state.
Step 4: Create pod, use pv, and write data to pv at the same time.
Step 5: Create a volumeSnapshotClass, then create a snapshot of csi-pvc
See details of the created volumeSnapshotContent.
Verify snapshot was created successfully.
Step 6: Create csi-restore-pvc and add the snapshot we created earlier as the data source.
View PVC, PV status
For pv details, volumeHandle is 93119a08-b754-11e8-97ca-0242ac110003,
Verify that pv data is pre-populated, we can see that pv created has data populated.
For related services, please visit support.huaweicloud.com/cce/index.html? utm_content=cce_helpcenter_2019
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.