当前位置:网站首页>Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
2022-06-27 02:39:00 【pythonxxoo】
High quality resource sharing
| Learning route guidance ( Click unlock ) | Knowledge orientation | Crowd positioning |
|---|---|---|
| 🧡 Python Actual wechat ordering applet 🧡 | Progressive class | This course is python flask+ Perfect combination of wechat applet , From the deployment of Tencent to the launch of the project , Create a full stack ordering system . |
| Python Quantitative trading practice | beginner | Take you hand in hand to create an easy to expand 、 More secure 、 More efficient quantitative trading system |
| Read the directory |
Back to the top ## Text
R & D test scenario , The general pursuit is to quickly start the environment with one click , Horizontal dynamic replication , One person, one set , Use as you go , Go as soon as you use it . As the user , It doesn't care what the actual physical resources are , Where does the environment start , Just declare your own usage requirements . But as a solution builder and infrastructure brace , But we know , To provide a better solution , There are still many problems , And it's not easy .
For example, in the past , I was once puzzled by how to gracefully release the local physical disk for business use , Especially local HDD Data disk .
There is a background , our Kubernetes The R & D test cluster is built with the over guaranteed machines that have retired online , Then qiniu started cloud storage , So many of our machines are multi disk storage intensive machines ( Like hanging 12 block 4T Disk ). So how to make better use of these disks , It's a question .
One solution is to make these disks into network storage , And then through qiniu's own cloud service or ceph Wait for the system to provide , It's certainly possible . However, some businesses just want to use physical disks , So what should we do ?
throughout Kubernetes At present, several native solutions are provided , The author found that they are not perfect :
- Emptydir Non persistent scheme ,Pod Delete ,EmptyDir It will be emptied . in addition Emptydir It uses rootfs Storage space , This space may be on the system disk , Therefore, it should be used with caution .
- HostPath Persistence scheme , But the security risks are high , The government does not recommend . in addition , It is also inconvenient from the point of view of use . For example, as a user , You must first know the situation of the target system , Only after you know the specific drive letter and directory location can you HostPath Quote correctly in . But the reality is from the perspective of cluster security , The user may not have the right to log in to the machine directly . And even if your Pod Occupied the directory of a host computer , Nor can we rule out the second occupation by others , Or misoperation . therefore HostPath The usage scenarios for are actually very limited .
- Local Persistent Volume Persistence scheme , With PVC/PV To use local storage . Good idea. , But it cannot be created dynamically PV, about PV For providers , The mental burden is high . Of course, the community now offers Local Static Provisioner, To some extent, it simplifies the mental burden of this piece , But you still need to plan directories or partitions in advance , It's not enough .
I think , Ideal local disk usage , Should be Apply on demand , Spatial isolation , And automated lifecycle management . In this way, it is convenient for the end user to use , It can also reduce operation and maintenance support , Increase of efficiency . There are three key technical points here :
- Apply on demand It means that it is best to PVC+StorageClass To provide services , Achieve PV Dynamically create . And to achieve that , Capacity aware Is the key , Because it is obviously unreasonable to schedule to nodes with insufficient space . It's better to combine PVC Capacity requested +Node Remaining capacity on , Comprehensively select the best node to bind .
- Spatial isolation Make sure that the space requested by the user is sufficient , Free from encroachment . From here , Simply use the directory of the file system as PV But it is obviously inappropriate not to isolate each other in capacity .
- Automated lifecycle management dynamic Provisioning Is a strong demand .
Synthesize the above three points , We will find that based on LVM Or partition technology +CSI The implementation of the , When it is more in line with the above user experience , and TopoLVM It's such a project .
Address : https://github.com/topolvm/topolvm
TopoLVM Is based on LVM Of Kubernetes Localized disk solutions , With CSI The form is provided to users for use . Currently, the following functions are supported :
- dynamic Provisioning
- Support native block volumes (Raw Block Volume)
- Volume Telescopic
The overall structure is as follows :
It is worth noting that , In earlier versions , In order to dynamically perceive the remaining storage capacity on the node ,TopoLVM Designed a custom extension scheduler ( Upper figure topolvm-scheduler part ), Convenient in Scheduling Stage is Pod Bind appropriate Node. And in the Kubernetes 1.21 after ,Kubernete Native support already Storage Capacity Tracking The ability of , The whole implementation of this piece becomes much more elegant ,topolvm-Scheduler It's no longer necessary .
Of course , To realize TopoLVM The core principle of , Besides understanding CSI Write out of specification , The most important thing is to understand LVM Related technology . And it is precisely because through LVM Can dynamically create LV, Dynamic expansion and contraction ,TopoLVM To support dynamic Provisioning Related capabilities .
however , Although as an open source project TopoLVM Basically enough , But the richness is slightly insufficient . Recently, Boyun has also opened its cloud native local disk management solution Carina, It looks more perfect .
Project address : https://github.com/carina-io/carina
Carina In addition to providing based on LVM Out of the plan , It also supports raw disk partition , as well as IOPS Limit etc. , More features . The code organization specification is also more suitable for the cloud native community , The whole is worth exploring .
Reference link
- Volume: https://kubernetes.io/docs/concepts/storage/volumes/
- PV: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
- Storage Capacity: https://kubernetes.io/docs/concepts/storage/storage-capacity/
- LVM: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)
Back to the top ## Previous recommendation
- Talk about leadership and team leadership
- Chat Kubernetes Pod or Namespace Stuck in Terminating State scene
- Build efficiently Presubmit Checkpoint , Landing test left shift best practice
- Talk about test environment management and practice
- How we do it go System coverage collection ?
- Chat Go Code coverage technology and best practices
边栏推荐
- Dameng database installation
- Getting started with bluecms code auditing
- Flink学习1:简介
- SQLite reader plug-in tests SQLite syntax
- 学习太极创客 — MQTT 第二章(二)ESP8266 QoS 应用
- 人群模拟
- D's appendto packaging
- Paddlepaddle 20 implementation and use of exponentialmovingaverage (EMA) (support static graph and dynamic graph)
- Oracle/PLSQL: Ltrim Function
- Precautions for using sneakemake
猜你喜欢

p5.js死亡星球

企业数字化转型:信息化与数字化

Detailed explanation of ThreadLocal

Sample development of WiFi IOT Hongmeng development kit

I earned 3W yuan a month from my sideline: the industry you despise really makes money!

Cs5213 HDMI to VGA (with audio) single turn scheme, cs5213 HDMI to VGA (with audio) IC

Flink learning 3: data processing mode (stream batch)

"All majors are persuading them to quit." is it actually the most friendly to college students?
![455. distribute biscuits [distribution questions]](/img/51/c7544d0eaa121cd461ffa678079473.jpg)
455. distribute biscuits [distribution questions]

mmdetection ValueError: need at least one array to concatenate解决方案
随机推荐
Oracle/PLSQL: Cast Function
Learning Tai Chi Maker - mqtt (VII) advanced mqtt theme
Learn Tai Chi maker mqtt (IX) esp8266 subscribe to and publish mqtt messages at the same time
TP5 Spreadsheet Excle 表格导出
Flink learning 3: data processing mode (stream batch)
Shell script series (1) getting started
Flink learning 1: Introduction
Oracle/PLSQL: Lower Function
C # check whether the date is in the correct format
Paddlepaddle 20 implementation and use of exponentialmovingaverage (EMA) (support static graph and dynamic graph)
Look! In June, 2022, the programming language ranking list was released! The first place is awesome
Leetcode 785: judgment bipartite graph
Oracle/PLSQL: Translate Function
2022中式面点师(高级)复训题库及在线模拟考试
Sword finger offer 𞓜: stack and queue (simple)
TechSmith Camtasia latest 2022 detailed function explanation Download
[micro service sentinel] degradation rules slow call proportion abnormal proportion abnormal constant
Oracle/PLSQL: NumToYMInterval Function
ORM cache package for laravel
2022茶艺师(高级)上岗证题库模拟考试平台操作