QingCloud Volume External Storage Plugins for Kubernetes Provisoners
English|中文
qingcloud-volume-provisioner is a volume plugin deployed on QingCloud. This plugin will handle the volume operations requested from Kubernetes API server. Support IaaS: QingCloud.
- Download the volume plugin file qingcloud-flex-volume.tar.gz
- Extract the package and grant the extracted file with excuting access:
chmod +x * - Run command as this:
./qingcloud-flex-volume --install=true - Go to QingCloud console and create an API access key
- Create the config file /etc/qingcloud/client.yaml, which is used to access QingCloud IaaS resource, example as below:
qy_access_key_id: "your access key"
qy_secret_access_key: "your secret key"
zone: "your zone"
log_level: warn
connection_retries: 1
connection_timeout: 5
host: "api.ks.qingcloud.com"
port: 80
protocol: "http"
make sure api.ks.qingcloud.com could be accessed in private cloud, otherwise, please contact support team of QingCloud - Modify kubelet config file and config volume plugin, example as below:
KUBELET_EXTRA_ARGS="--node-labels=role={{getv "/host/role"}},node_id={{getv "/host/node_id"}} --max-pods 60 --feature-gates=AllAlpha=true,DynamicKubeletConfig=false,RotateKubeletServerCertificate=false,RotateKubeletClientCertificate=false --root-dir=/data/var/lib/kubelet --cert-dir=/data/var/run/kubernetes --enable-controller-attach-detach=true --volume-plugin-dir=/usr/libexec/kubernetes/kubelet-plugins/volume/exec/", please make sure KUBELET_EXTRA_ARGS is added into your kubelet.service file - Modify the config file of controller manager, and enable flex volume plugin and related mount configuraiton, refer to kube-controller-manager.yaml, you could search with key word 'flex', replace ${HYPERKUBE_VERSION} with proper version value
- Download and deploy volume plugin pod by this config file qingcloud-volume-provisioner.yaml, please modify image version to v1.3.2
- Download and deploy config file for QingCloud storage class as addons: qingcloud-storage-class-capacity.yaml and qingcloud-storage-class.yaml
- create logrotatte config file for this volume plugin /etc/logrotate.d/flex-volume
/var/log/qingcloud-flex-volume/* {
rotate 1
copytruncate
missingok
notifempty
compress
maxsize 10M
daily
create 0644 root root
}
Note: steps 1, 2, 3, 5, 6 and 10 are for all k8s nodes