-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
vm/ansible/playbooks/roles/k8s-master/files/storage/kodo.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
metadata: | ||
name: kodo-csi-pv-secret | ||
kind: Secret | ||
type: Opaque | ||
data: | ||
accesskey: "<Qiniu Access Key>" # 必填, 必须是 BASE64 格式 | ||
secretkey: "<Qiniu Secret Key>" # 必填, 必须是 BASE64 格式 | ||
stringData: | ||
bucketname: "alomerry" # 必填 | ||
ucendpoint: "https://kodo-config.qiniuapi.com" # 必填 在公有云中,该字段可以填写为 https://kodo-config.qiniuapi.com | ||
storageclass: "STANDARD" # 可选 默认为 STANDARD,可选值为 STANDARD,LINE,GLACIER,DEEP_ARCHIVE | ||
region: "z0" # 可选 默认为 z0 代表华东区 | ||
subdir: "" # 可选 仅挂载子目录,适用于通过 Bucket Policy 授权子目录的用户 | ||
s3forcepathstyle: "false" # 可选 是否仅使用 Path Style 调用 S3 API,适用于私有云环境 |
56 changes: 56 additions & 0 deletions
56
vm/ansible/playbooks/roles/k8s-master/files/storage/mysql/kodo.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: kodo-csi-pv-mysql # PV 名称,可以修改 | ||
labels: | ||
kodo-pvname: kodo-csi-pv-mysql # PVC 匹配用的标签,可以修改 | ||
spec: | ||
capacity: | ||
storage: 5Gi # 空间大小,可以修改 | ||
accessModes: | ||
- ReadWriteMany | ||
persistentVolumeReclaimPolicy: Retain # 无需修改,Kodo CSI 驱动只支持 Retain 策略 | ||
csi: | ||
driver: kodoplugin.storage.qiniu.com | ||
volumeHandle: kodo-csi-pv # 指定为上面的 PV 名称 | ||
volumeAttributes: | ||
uploadcutoff: "209715200" # 分片上传阈值,大于该阈值的文件将自动使用分片的形式上传,单位为字节。默认为 200 MB,最小值为 0,最大不能超过 5 GB。 | ||
uploadchunksize: "5242880" # 分片大小,单位为字节,默认为 5 MB。对于大文件而言,适当提高分片大小将有效提升上传效率。 | ||
uploadconcurrency: "4" # 分片上传并发度,默认为 4。 | ||
vfscachemode: "off" # 本地缓存模式,可选值为 off,minimal,writes,full。 | ||
dircacheduration: "5m0s" # 目录缓存时长,默认为 5m0s。当列举目录时,如果目录没有缓存或缓存已经失效,则会从云存储列举,然后刷新缓存。 | ||
buffersize: "16777216" # 文件内存缓冲区最大尺寸,单位为字节,默认为 16 MB。当文件被下载时,数据将被读入内存缓冲区等待读请求来获取。 | ||
vfsreadahead: "0" # 额外预读取大小,单位为字节,默认为 0。仅在 vfscachemode 为 full 时,当文件被下载时,buffersize 大小的数据将被读取到内存缓冲区等待读取,之后的 vfsreadahead 大小的数据则被读取到本地缓存中等待读取。 | ||
vfscachemaxage: "1h0m0s" # 本地缓存时长,默认为 1h0m0s。当本地缓存被启用时,缓存的数据最长有效期,超过有效期的数据将被自动删除。 | ||
vfscachemaxsize: "off" # 最大本地缓存尺寸,默认为 off。 | ||
vfscachepollinterval: "1m0s" # 清理缓存频率,默认为 1m0s。 | ||
vfswriteback: "5s" # 本地缓存上传延迟时长,默认为 5s。 当本地写缓存被启用时,被写入的文件仅在被关闭后,且在延迟时长内没有被再打开的数据才会被上传到云存储。 | ||
vfsreadchunksize: "134217728" # 首次下载分片大小,单位为字节,默认为 128 MB。 当 vfsreadchunksize 大于 0 时,文件总是以分片的形式被下载,且每次下载的分片被读取完毕后,下次下载的分片大小是前一次的两倍,直到分片大小达到 vfsreadchunksizelimit 或文件被下载完毕为止。 | ||
vfsreadchunksizelimit: "off" # 最大下载分片大小,单位为字节,默认为 off。当下载的分片大小不断翻倍直到大于等于 vfsreadchunksizelimit 后,之后每次下载的分片大小总是等于 vfsreadchunksizelimit,直到文件被下载完毕为止。 | ||
nochecksum: "no" # 上传下载时不再校验数据,默认为总是校验数据。 | ||
nomodtime: "no" # 不再读写文件修改时间,默认为总是读写文件修改时间。禁止读写文件修改时间可以提升文件系统的性能。 | ||
noseek: "no" # 禁止文件寻址,默认为允许文件寻址。统。 | ||
readonly: "no" # 只读文件系统,默认为可以修改文件系 | ||
transfers: "4" # 本地缓存上传并发度,默认为 4。当本地写缓存被启用时,异步上传文件的并发度。 | ||
nodePublishSecretRef: | ||
name: kodo-csi-pv-secret # 指定 Secret 名称 | ||
namespace: default | ||
``` | ||
pvc | ||
```yml | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: kodo-pvc # PVC 名称,可以修改 | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
storageClassName: '' | ||
resources: | ||
requests: | ||
storage: 5Gi # 申请空间大小,可以修改 | ||
selector: | ||
matchLabels: | ||
kodo-pvname: kodo-csi-pv # 匹配 PV 的标签 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# qiniu oss | ||
|
||
```shell | ||
. | ||
├── website # 网站静态文件 | ||
│ ├── docs | ||
│ └── blog | ||
├── xxx | ||
│ └── xxx | ||
└── database # 数据库文件 | ||
├── mysql | ||
├── mongodb | ||
├── influxdb | ||
├── xxx | ||
│ ├── xxx | ||
│ └── xxx | ||
└── xxx | ||
└── xxx | ||
``` |