{"id":286986,"date":"2017-05-29T10:50:08","date_gmt":"2017-05-29T06:50:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286986"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2017-05-29T06:50:08","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286986","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441 provisioning \u0432 Kubernetes \u043d\u0430 \u0431\u0430\u0437\u0435 Ceph"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/a0b\/8ca\/ad7\/a0b8caad7cb449ff8655bf584a68ca8b.png\"\/><br \/>  <i><b>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/b>: \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044e Ceph \u0432 Kubernetes, \u043d\u0430\u0448\u043b\u0438 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0438, \u0447\u0442\u043e \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u043e, \u0441\u0432\u0435\u0436\u0443\u044e (\u043e\u0442 \u0430\u043f\u0440\u0435\u043b\u044f 2017 \u0433\u043e\u0434\u0430) \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <a href=\"https:\/\/crondev.com\/\">Cron<\/a> (\u0438\u0437 \u0411\u043e\u0441\u043d\u0438\u0438 \u0438 \u0413\u0435\u0440\u0446\u0435\u0433\u043e\u0432\u0438\u043d\u044b) \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0423\u0431\u0435\u0434\u0438\u0432\u0448\u0438\u0441\u044c \u0432 \u0435\u0451 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438, \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u00ab\u043a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb, \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442.<\/i><\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0431\u0438\u0440\u0430\u044e\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u0422\u0430\u043a\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0430 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0438\u0437 \u043d\u0438\u0445 \u2014 Ceph. \u0415\u0441\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 Ceph \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443 \u0432\u0430\u0441, \u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0432 Kubernetes \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u043e\u043c\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f (volume provisioning) \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Kubernetes <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/storage\/persistent-volumes\/#storageclasses\">StorageClasses<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 Ceph.<a name=\"habracut\"><\/a> <i>(\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 Kubernetes, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 kubeadm, \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/crondev.com\/kubernetes-installation-kubeadm\/\">\u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435<\/a> \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.)<\/i><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0430\u043c \u0442\u0430\u043a\u0436\u0435 [\u043f\u043e\u043c\u0438\u043c\u043e \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 Kubernetes] \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 Ceph \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <code>rbd<\/code> \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445 Kubernetes. <i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: RBD \u0438\u043b\u0438 RADOS Block Device \u2014 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Linux-\u044f\u0434\u0440\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b Ceph \u043a\u0430\u043a \u0431\u043b\u043e\u0447\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/i> \u0410\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 Ceph \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"http:\/\/ceph.com\/releases\/v10-2-0-jewel-released\/\">Jewel<\/a> \u0438 Linux-\u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 Ubuntu 16.04 \u043d\u0430 \u0443\u0437\u043b\u0430\u0445 Kubernetes, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Ceph <i>(\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 <code>rbd<\/code>)<\/i> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"bash\">$ sudo apt-get install ceph-common<\/code><\/pre>\n<p>  \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0437\u0435 <code>kube-controller-manager<\/code> \u043d\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <code>rbd<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0431\u0440\u0430\u0437. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u043c\u044f \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 <code>\/etc\/kubernetes\/manifests\/kube-controller-manager.yaml<\/code> \u043d\u0430 <code>quay.io\/attcomdev\/kube-controller-manager:v1.6.1<\/code> <i>(\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f 1.6.3, \u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 1.5.3 \u0438 1.6.1 \u2014 <b>\u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>)<\/i> \u0438 \u0434\u043e\u0436\u0434\u0438\u0442\u0435\u0441\u044c, \u043f\u043e\u043a\u0430 <code>kube-controller-manager<\/code> \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0441 \u043d\u043e\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b <code>kube-controller-manager<\/code> \u043c\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c provisioning \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u0435\u043c\u0443 \u043d\u0443\u0436\u0435\u043d \u043a\u043b\u044e\u0447 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u0437 Ceph. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u044e\u0447 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">$ sudo ceph --cluster ceph auth get-key client.admin<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e \u0432 \u0441\u0435\u043a\u0440\u0435\u0442\u044b Kubernetes:<\/p>\n<pre><code class=\"bash\">$ kubectl create secret generic ceph-secret --type=&quot;kubernetes.io\/rbd&quot; \\   --from-literal=key='AQBwruNY\/lEmCxAAKS7tzZHSforkUE85htnA\/g==' --namespace=kube-system<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0443\u0437\u043b\u043e\u0432 Kubernetes \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Ceph \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043b \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 rbd \u043d\u0430 \u0443\u0437\u043b\u0430\u0445:<\/p>\n<pre><code class=\"bash\">$ sudo ceph --cluster ceph osd pool create kube 1024 1024<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u043a\u043b\u044e\u0447 (\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Ceph \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f cephx):<\/p>\n<pre><code class=\"bash\">$ sudo ceph --cluster ceph auth get-or-create client.kube mon 'allow r' osd 'allow rwx pool=kube'<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u043c\u0438 \u0438\u043c\u0451\u043d \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes. \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043b\u044e\u0447 <code>client.kube<\/code>:<\/p>\n<pre><code class=\"bash\">$ sudo ceph --cluster ceph auth get-key client.kube<\/code><\/pre>\n<p>  \u0418 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u043a\u0440\u0435\u0442 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"bash\">$ kubectl create secret generic ceph-secret-kube --type=&quot;kubernetes.io\/rbd&quot; \\   --from-literal=key='AQC\/c+dYsXNUNBAAMTEW1\/WnzXdmDZIBhcw6ug==' --namespace=default<\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043e\u0431\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 StorageClass:<\/p>\n<pre><code class=\"bash\">$ cat &gt; ceph-storage-fast_rbd.yml &lt;&lt;EOF<\/code><\/pre>\n<p>  <\/p>\n<pre><code>apiVersion: storage.k8s.io\/v1 kind: StorageClass metadata:   name: fast_rbd provisioner: kubernetes.io\/rbd parameters:   monitors: &lt;monitor-1-ip&gt;:6789, &lt;monitor-2-ip&gt;:6789, &lt;monitor-3-ip&gt;:6789   adminId: admin   adminSecretName: ceph-secret   adminSecretNamespace: &quot;kube-system&quot;   pool: kube   userId: kube   userSecretName: ceph-secret-kube<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">EOF<\/code><\/pre>\n<p>  <i>(<b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432<\/b>.: \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0438 \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u0440\u0443 \u043e\u0431 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u043c \u0443\u043f\u0443\u0449\u0435\u043d\u0438\u0438.)<\/i><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u00ab\u0437\u0430\u044f\u0432\u043a\u0443 \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0442\u043e\u043c\u00bb (<a href=\"https:\/\/kubernetes.io\/docs\/concepts\/storage\/persistent-volumes\/#persistentvolumeclaims\">PersistentVolumeClaim<\/a>) \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e StorageClass \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>fast_rbd<\/code>:<\/p>\n<pre><code class=\"bash\">$ cat &gt; ceph-vc.yml &lt;&lt;EOF<\/code><\/pre>\n<p>  <\/p>\n<pre><code>apiVersion: v1 kind: PersistentVolumeClaim metadata:   name: claim1 spec:   accessModes:     - ReadWriteOnce   resources:     requests:       storage: 3Gi   storageClassName: fast_rbd<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">EOF $ kubectl create -f ceph-vc.yml --namespace=default<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e:<\/p>\n<pre><code class=\"bash\">$ kubectl describe pvc Name:\t\tclaim1 Namespace:\tdefault StorageClass:\tfast_rbd Status:\t\tBound Volume:\t\tpvc-c1ffa983-1b8f-11e7-864f-0243fc58af9d Labels:\t\t Annotations:\tpv.kubernetes.io\/bind-completed=yes \t\tpv.kubernetes.io\/bound-by-controller=yes \t\tvolume.beta.kubernetes.io\/storage-provisioner=kubernetes.io\/rbd Capacity:\t3Gi Access Modes:\tRWO Events:   FirstSeen\tLastSeen\tCount\tFrom\t\t\t\tSubObjectPath\tType\t \u2026   ---------\t--------\t-----\t----\t\t\t\t-------------\t-------- \u2026   3m\t\t3m\t\t1\tpersistentvolume-controller\t\t\tNormal\t \u2026  \u2026 Reason\t\t\tMessage \u2026 ------\t\t\t------- \u2026 ProvisioningSucceeded\tSuccessfully provisioned volume pvc-c1ffa983-\u2026 using kubernetes.io\/rbd   $ kubectl describe pv Name:\t\tpvc-c1ffa983-1b8f-11e7-864f-0243fc58af9d Labels:\t\t Annotations:\tpv.kubernetes.io\/bound-by-controller=yes \t\tpv.kubernetes.io\/provisioned-by=kubernetes.io\/rbd StorageClass:\tfast_rbd Status:\t\tBound Claim:\t\tdefault\/claim1 Reclaim Policy:\tDelete Access Modes:\tRWO Capacity:\t3Gi Message: Source:     Type:\t\tRBD (a Rados Block Device mount on the host that shares a pod's lifetime)     CephMonitors:\t[192.168.42.10:6789]     RBDImage:\t\tkubernetes-dynamic-pvc-c201abb5-1b8f-11e7-84a4-0243fc58af9d     FSType:     RBDPool:\t\tkube     RadosUser:\t\tkube     Keyring:\t\t\/etc\/ceph\/keyring     SecretRef:\t\t&{ceph-secret-kube}     ReadOnly:\t\tfalse Events:<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e PersistentVolumeClaim (<code>claim1<\/code>):  <\/p>\n<pre><code class=\"bash\">$ cat &gt; pod.yml &lt;&lt;EOF<\/code><\/pre>\n<p>  <\/p>\n<pre><code>apiVersion: v1 kind: ReplicationController metadata:   name: nginx spec:   replicas: 1   selector:     app: nginx   template:     metadata:       name: nginx       labels:         app: nginx     spec:       containers:       - name: nginx         image: nginx         ports:         - containerPort: 80         volumeMounts:           - mountPath: \/var\/lib\/www\/html             name: mypvc       volumes:         - name: mypvc           persistentVolumeClaim:             claimName: claim1<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">EOF $ kubectl create -f pod.yml --namespace=default<\/code><\/pre>\n<p>  \u0412\u0441\u0451: \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0437 Ceph, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (PersistentVolumeClaim).<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/329666\/\"> https:\/\/habrahabr.ru\/post\/329666\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/a0b\/8ca\/ad7\/a0b8caad7cb449ff8655bf584a68ca8b.png\"\/><br \/>  <i><b>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/b>: \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044e Ceph \u0432 Kubernetes, \u043d\u0430\u0448\u043b\u0438 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0438, \u0447\u0442\u043e \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u043e, \u0441\u0432\u0435\u0436\u0443\u044e (\u043e\u0442 \u0430\u043f\u0440\u0435\u043b\u044f 2017 \u0433\u043e\u0434\u0430) \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <a href=\"https:\/\/crondev.com\/\">Cron<\/a> (\u0438\u0437 \u0411\u043e\u0441\u043d\u0438\u0438 \u0438 \u0413\u0435\u0440\u0446\u0435\u0433\u043e\u0432\u0438\u043d\u044b) \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0423\u0431\u0435\u0434\u0438\u0432\u0448\u0438\u0441\u044c \u0432 \u0435\u0451 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438, \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u00ab\u043a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb, \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442.<\/i><\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0431\u0438\u0440\u0430\u044e\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u0422\u0430\u043a\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0430 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0438\u0437 \u043d\u0438\u0445 \u2014 Ceph. \u0415\u0441\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 Ceph \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443 \u0432\u0430\u0441, \u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0432 Kubernetes \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u043e\u043c\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f (volume provisioning) \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Kubernetes <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/storage\/persistent-volumes\/#storageclasses\">StorageClasses<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 Ceph.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-286986","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=286986"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286986\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}