More Related Content Similar to 20190410 cnjp rancher-flexvolume Similar to 20190410 cnjp rancher-flexvolume (20) 20190410 cnjp rancher-flexvolume2. 自己紹介
• 名 前 :Takahiro Kobayashi
• 勤務先 :SIer
• 出没場所 :Oracle、PostgreSQL、k8s関連に色々と
• キャリア :DB、ストレージを中心にインフラ
• 好きなもの:速いDB 、太い帯域、小さいレイテンシ
6. こんなときあるよね?
• 某githubで ↓な記述が。
• 「あれ、Rancherでkubeletパラメータいじれるの?」
• 「もしかして、Rancher使ってると無理ゲー?」
Installing
You must set the --enable-controller-attach-detach=false option
on all kubelets. For systemd managed kubelets this can be set in
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
9. じゃあ、driver書いてみるか。
• https://github.com/tzkoba/postgres-on-k8s/blob/develop/postgres-install/pg-drbd/drbd.sh
#!/bin/bash
# (一部抜粋です)
domount() {
MNTPATH=$1
DMDEV=$2
FSTYPE=$(echo $3|jq -r '.["kubernetes.io/fsType"]')
if [ ! -b "${DMDEV}" ]; then
err "{¥"status¥": ¥"Failure¥", ¥"message¥": ¥"${DMDEV} does not exist¥"}"
exit 1
fi
if [ $(ismounted) -eq 1 ] ; then
log "{¥"status¥": ¥"Success¥"}"
exit 0
fi
VOLFSTYPE=`blkid -o udev ${DMDEV} 2>/dev/null|grep "ID_FS_TYPE"|cut -d"=" -f2`
if [ "${VOLFSTYPE}" == "" ]; then
mkfs -t ${FSTYPE} ${DMDEV}
if [ $? -ne 0 ]; then
err "{ ¥"status¥": ¥"Failure¥", ¥"message¥": ¥"Failed to create fs ${FSTYPE} on device ${DMDEV}¥"}"
exit 1
fi
fi
mkdir -p ${MNTPATH} &> /dev/null
mount ${DMDEV} ${MNTPATH} &> /dev/null
if [ $? -ne 0 ]; then
err "{ ¥"status¥": ¥"Failure¥", ¥"message¥": ¥"Failed to mount device ${DMDEV} at ${MNTPATH}¥"}"
exit 1
fi
log "{¥"status¥": ¥"Success¥"}"
exit 0
}