首页 > 其他分享 >local-volume-provisioner 挂载本地目录

local-volume-provisioner 挂载本地目录

时间:2022-10-20 10:47:50浏览次数:66  
标签:name provisioner mnt volume sdc local

#创建目录

mkdir -p /mnt/sdc/vol1
mkdir -p /mnt/sdc/vol2
mkdir -p /mnt/sdc/vol3
mkdir -p /mnt/sdc/vol4

mkdir -p /mnt/ssd/sdc_vol
mkdir -p /mnt/sharedssd/sdc_vol
mkdir -p /mnt/backup/sdc_vol
mkdir -p /mnt/monitoring/sdc_vol

mount --bind /mnt/sdc/vol1 /mnt/ssd/sdc_vol
mount --bind /mnt/sdc/vol2 /mnt/sharedssd/sdc_vol
mount --bind /mnt/sdc/vol3 /mnt/backup/sdc_vol
mount --bind /mnt/sdc/vol4 /mnt/monitoring/sdc_vol

#####################################################

#helm template ./helm/provisioner > deployment/kubernetes/provisioner_generated.yaml

参考tidb operator,添加volumeMounts,volumes

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: local-volume-provisioner
namespace: kube-system
labels:
app: local-volume-provisioner
spec:
selector:
matchLabels:
app: local-volume-provisioner
template:
metadata:
labels:
app: local-volume-provisioner
spec:
serviceAccountName: local-storage-admin
containers:
- image: "quay.io/external_storage/local-volume-provisioner:v2.3.4"
name: provisioner
securityContext:
privileged: true
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: JOB_CONTAINER_IMAGE
value: "quay.io/external_storage/local-volume-provisioner:v2.3.4"
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 100m
memory: 100Mi
volumeMounts:
- mountPath: /etc/provisioner/config
name: provisioner-config
readOnly: true
- mountPath: /mnt/ssd
name: local-ssd
mountPropagation: "HostToContainer"
- mountPath: /mnt/sharedssd
name: local-sharedssd
mountPropagation: "HostToContainer"
- mountPath: /mnt/backup
name: local-backup
mountPropagation: "HostToContainer"
- mountPath: /mnt/monitoring
name: local-monitoring
mountPropagation: "HostToContainer"
volumes:
- name: provisioner-config
configMap:
name: local-provisioner-config
- name: local-ssd
hostPath:
path: /mnt/ssd
- name: local-sharedssd
hostPath:
path: /mnt/sharedssd
- name: local-backup
hostPath:
path: /mnt/backup
- name: local-monitoring
hostPath:
path: /mnt/monitoring

 

kubectl get pv

 

标签:name,provisioner,mnt,volume,sdc,local
From: https://www.cnblogs.com/52shaidan/p/16808885.html

相关文章