ceph中的rbd支持动态预配,但kubeadm部署的k8s集群,却不支持该功能,原因在于kube-controller-manager镜像内部未内置ceph客户端工具。

需要自己手动重打kube-controller-manager镜像将ceph客户端工具打入后,重新运行

1
2
3
4
5
6
7
8
9
ARG KUBE_VERSION="v1.19.4"
FROM registry.aliyuncs.com/google_containers/kube-controller-manager:${KUBE_VERSION}
RUN apt update && apt install -y wget gnupg lsb-release
ARG CEPH_VERSION="octopus"
RUN wget -q -O - https://mirrors.aliyun.com/ceph/keys/release.asc | apt-key add - && \
echo deb https://mirrors.aliyun.com/ceph/debian-${CEPH_VERSION}/ $(lsb_release -sc) main > /etc/apt/sources.list.d/ceph.list && \
apt update && \
apt install -y ceph-common ceph-fuse
RUN rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*