k8s volume plugin FlexVolume 开发
来源:互联网 发布:中国不成熟的网络环境 编辑:程序博客网 时间:2024/06/10 15:39
Kubernetes的卷插件分两种,一种是要随同kubelet一起编译的插件,比如azure,cephfs这些,一种是独立的可执行程序插件(如果网络插件exec或者cni),这种插件只要满足kubelet的FlexVolume框架接口规则就可以被kublet调用。
FlexVolume框架把kublet对他的调用转化为对可执行程序命令行的调用,FlexVolume框架接口规则要求插件是一个可执行程序,且可处理以下参数
init
unmount <mount dir>
以cifs为例子,参考代码https://github.com/sigma/cifs_k8s_plugin/blob/master/cifs.sh
使用插件
pod.yml:
apiVersion: v1
kind: Pod
metadata:
name: cc
spec:
containers:
- name: cc
image: nginx
volumeMounts:
- name: test
mountPath: /data
ports:
- containerPort: 80
volumes:
- name: test
flexVolume:
driver: "hodique.info/cifs" #/usr/libexec/kubernetes/kubelet-plugins/volume/exec/hodique.info/cifs
secretRef:
name: cifscreds
readOnly: true
options:
source: "//192.168.56.101/TEST"
mountOptions: "dir_mode=0700,file_mode=0600"
FlexVolume框架把kublet对他的调用转化为对可执行程序命令行的调用,FlexVolume框架接口规则要求插件是一个可执行程序,且可处理以下参数
init
attach <json params>
detach <mount device>
mount <mount dir> <mount device> <json params>unmount <mount dir>
以cifs为例子,参考代码https://github.com/sigma/cifs_k8s_plugin/blob/master/cifs.sh
使用插件
pod.yml:
apiVersion: v1
kind: Pod
metadata:
name: cc
spec:
containers:
- name: cc
image: nginx
volumeMounts:
- name: test
mountPath: /data
ports:
- containerPort: 80
volumes:
- name: test
flexVolume:
driver: "hodique.info/cifs" #/usr/libexec/kubernetes/kubelet-plugins/volume/exec/hodique.info/cifs
secretRef:
name: cifscreds
readOnly: true
options:
source: "//192.168.56.101/TEST"
mountOptions: "dir_mode=0700,file_mode=0600"
阅读全文
0 0
- k8s volume plugin FlexVolume 开发
- Docker Volume Plugin 开发及Golang实现
- 工作日志——k8s gitRepo volume
- No Volume Control GStreamer plugin
- Docker容器对存储的定义 Volume 与 Volume Plugin
- docker plugin插件-----卷插件 volume plugin(convoy)
- k8s
- K8S中pod在挂载volume时出现FailedMount错误(exit status 32)
- 有容云——窥探Docker中的Volume Plugin内幕
- DockOne技术分享(五十七):Docker容器对存储的定义(Volume 与 Volume Plugin)
- K8S云管平台开发实践
- K8S云管平台开发实践
- volume
- volume
- Gaim Plugin开发
- 开源Mozilla plugin 开发
- Eclipse plugin开发总结
- Maven plugin 开发
- UITableView刷新某一部分或某一行
- jsp页面导出成excel(局限于Chrome和FireFox)
- Connections in Galaxy War并查集+set+脑洞
- OC语言学习01-类与对象
- mysql --时间日期函数总结
- k8s volume plugin FlexVolume 开发
- bootstrap-table 搜索框 中文乱码问题解决
- sails开发之配置MongoDB数据库连接
- [C/C++]_[macOS-Windows]_[原子操作2]
- C# 使用SSL访问webservice(自用)
- 利用js实现 禁用浏览器后退
- 趟过(1062
- Activity生命周期
- 设计模式