{"id":2120,"date":"2025-08-08T10:45:08","date_gmt":"2025-08-08T08:45:08","guid":{"rendered":"https:\/\/blog.mhasin.eu\/?p=2120"},"modified":"2025-08-08T13:13:19","modified_gmt":"2025-08-08T11:13:19","slug":"kubernetes-nfs-storage","status":"publish","type":"post","link":"https:\/\/blog.mhasin.eu\/?p=2120","title":{"rendered":"kubernetes NFS storage"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get install -y nfs-common\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl create namespace kubeflow-storage\n<\/code><\/pre>\n\n\n\n<p>nano nfs-client.yaml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: nfs-client-provisioner\n  namespace: kubeflow-storage\n---\nkind: ClusterRole\napiVersion: rbac.authorization.k8s.io\/v1\nmetadata:\n  name: nfs-client-provisioner-runner\nrules:\n  - apiGroups: &#91;\"\"]\n    resources: &#91;\"persistentvolumes\"]\n    verbs: &#91;\"get\", \"list\", \"watch\", \"create\", \"delete\"]\n  - apiGroups: &#91;\"\"]\n    resources: &#91;\"persistentvolumeclaims\"]\n    verbs: &#91;\"get\", \"list\", \"watch\", \"update\"]\n  - apiGroups: &#91;\"storage.k8s.io\"]\n    resources: &#91;\"storageclasses\"]\n    verbs: &#91;\"get\", \"list\", \"watch\"]\n  - apiGroups: &#91;\"\"]\n    resources: &#91;\"events\"]\n    verbs: &#91;\"create\", \"update\", \"patch\"]\n---\nkind: ClusterRoleBinding\napiVersion: rbac.authorization.k8s.io\/v1\nmetadata:\n  name: run-nfs-client-provisioner\nsubjects:\n  - kind: ServiceAccount\n    name: nfs-client-provisioner\n    namespace: kubeflow-storage\nroleRef:\n  kind: ClusterRole\n  name: nfs-client-provisioner-runner\n  apiGroup: rbac.authorization.k8s.io\n---\napiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: nfs-client-provisioner\n  namespace: kubeflow-storage\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: nfs-client-provisioner\n  template:\n    metadata:\n      labels:\n        app: nfs-client-provisioner\n    spec:\n      serviceAccountName: nfs-client-provisioner\n      containers:\n        - name: nfs-client-provisioner\n          image: registry.k8s.io\/sig-storage\/nfs-subdir-external-provisioner:v4.0.2\n          volumeMounts:\n            - name: nfs-client-root\n              mountPath: \/persistentvolumes\n          env:\n            - name: PROVISIONER_NAME\n              value: \"example.com\/nfs\"\n            - name: NFS_SERVER\n              value: \"147.232.207.69\"\n            - name: NFS_PATH\n              value: \"\/filer02_vol1\"\n      volumes:\n        - name: nfs-client-root\n          nfs:\n            server: 147.232.207.69\n            path: \/filer02_vol1\n---\napiVersion: storage.k8s.io\/v1\nkind: StorageClass\nmetadata:\n  name: nfs-kubeflow\n  annotations:\n    storageclass.kubernetes.io\/is-default-class: \"true\"\nprovisioner: example.com\/nfs\nparameters:\n  pathPattern: \"${.PVC.namespace}\/${.PVC.name}\"\n  archiveOnDelete: \"false\"\nreclaimPolicy: Delete\nvolumeBindingMode: Immediate\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f nfs-client.yaml\n<\/code><\/pre>\n\n\n\n<p>kubectl get storageclass<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"892\" height=\"72\" src=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2025\/08\/obrazok-2.png\" alt=\"\" class=\"wp-image-2121\" srcset=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2025\/08\/obrazok-2.png 892w, https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2025\/08\/obrazok-2-300x24.png 300w, https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2025\/08\/obrazok-2-768x62.png 768w\" sizes=\"auto, (max-width: 892px) 100vw, 892px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &lt;&lt;EOF | kubectl apply -f -\napiVersion: rbac.authorization.k8s.io\/v1\nkind: Role\nmetadata:\n  name: nfs-client-provisioner\n  namespace: kubeflow-storage\nrules:\n  - apiGroups: &#91;\"\"]\n    resources: &#91;\"endpoints\"]\n    verbs: &#91;\"get\", \"watch\", \"list\", \"create\", \"update\", \"patch\"]\nEOF\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &lt;&lt;EOF | kubectl apply -f -\napiVersion: rbac.authorization.k8s.io\/v1\nkind: RoleBinding\nmetadata:\n  name: nfs-client-provisioner\n  namespace: kubeflow-storage\nsubjects:\n  - kind: ServiceAccount\n    name: nfs-client-provisioner\n    namespace: kubeflow-storage\nroleRef:\n  kind: Role\n  name: nfs-client-provisioner\n  apiGroup: rbac.authorization.k8s.io\nEOF\n<\/code><\/pre>\n\n\n\n<p><\/p>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLQUA\" \/><input type=\"hidden\" name=\"blogName\" value=\"c\/LxdwcA\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"MzI0MgAA\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"yy5NSi3KSy1JLVbwcwtWKC7JL0pMTwUA\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLdW3L7A1MjQyAAA=\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"y00syfcwNAIA\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwMtU1sAAiBUMDKwMLIAIA\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"xVbbbuM2EH3XVxBqsWiBSLK1aS5ex0CazbYBNhc4Rd4WAS2NbTYUSZCUbKe7\/96hJDtybCfOpagAwxQ1nHPmyvG6qteNVM\/Dp6s0kIRTY478iQoGXCZ3QSJT8Htd99czeSoJVTYYgSW5SqkFb2mPCWMp5ySYETE0eDbLpPC6UXkaYTRsB3SXDyCxnCQaEIMImoFRNAHiPgy5nATGSk1HsE53T1AhK3zOQNhwRjO+tY1UsRvQhknRIUXbu2Mi7ZBr0AVL4DhJZC6sl4GlaDzteKTk1mmgBUrLgrnzoOvPJfXOKvcgCGr9Jzw3FnRfcvCaBPSAJiHN7Vhqdk8t7oV3ByZkMkJq27IIdC4cGZ1zME44wHixP7TMlemQDz8dtj\/5\/jfcJ0SDkblOYLGvHBOkJmwheY6m1IIF6MFCCCPv7xCfo6D7n1CbjN2iip5bpcABV9\/eBo5hY9mLGFQ5ugm3jkPt0k0saqkyZ15g\/wtthQLNXKv9wYu1NbhSNcTaDPodN5gYvSWRMGOCDSlt8sHfWJt1Iq0tD2fCM2XxdGFotKIPQwexWh\/bJTtZuP4J40v\/Nd1ElTLRouo\/g+JylsH7VbxRkDgVGjWzhGKM2\/hmsDoSlOiUjslcbL\/SAXBTbThT1BOAFjLFMTHq4w2m7uFLmp7ThWRqiuV6Ka4Xz4WUkEQKSxm+NwCD53OheliGLsJowQgLSc\/mCWrYaO6\/yOnABEyZDmCKCSEobyrrFLthK4wbOqvGce7oNyhtoKWltEsy6E138oracYdEK72wIQuiWK\/+qn95c3Z9dnlx2r+9OD4\/faS\/oDxHKR+mFIMIId6Yzkh\/ra6LL9e316f9m9P+Bi3t3f0w\/hiHcWs\/3DvcrOTq+K8\/N6iIhoyDbsW3aGN7rqG298mYPnIefll2iMsljBBZ5rgkoio\/NxmsVOhyz36o1etq\/8R16Q3VOq9G1xuEkLbsBDXLZpMPnaAWeGGVEMwEKQxpzm1QfkYnWZ2D7zUTjzwKoKeoRmBbV4KzDLPIZSwe\/\/mf8OrmJFw0ih9RY+eHczrVyZgVcCk+lxcnnhlSbhBTV5fglcT2MXMdyn32qvjUff8cp5gOOcsySJkb0F4\/fWGr4DMSDB\/PUmuHrvkhNwY2vVkPXt2UFSugZcX7Pa87ZKP8gRTlbCQSRANNDLuHYJhzjuRYNiJcUmfkkc\/p\/cwnKSCT8p2amUh8MmGpHR\/5B4exT8bARmN75O\/j2ujkyB9bizdxFCH6KMzG1DARQh4hH9e4EDDKlQMwUdyKf4taB5EcaHov74I4VGLkE8pRnd+wo7QgiNtxu4QwYN+MQpD7ZIe8QUvwsdWaxrulMly+Udn+3sF0r2KGy4lfhsRFKbdyh\/yS0WlQOr3jiKvpr6TdahWIWb75JMI0qcKLcY4wC3pVvmw9kCfUkg\/cfnK\/08sv5DtZyc9g+1mn6hblIPFOd\/prxmoQqZJsw8BXj5OLIXY+Vz41CKJjXlHo\/5Vr5xPoe01N\/8fIucWsueWQuSE2VQX8Cw==\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\" rel=\"nofollow\"><img src=\"https:\/\/blog.mhasin.eu\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/pdf_32x32.png\" alt=\"\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"nano nfs-client.yaml kubectl get storageclass &nbsp;&nbsp; Send article as PDF &nbsp;&nbsp;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"arc_restricted_post":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2120","post","type-post","status-publish","format-standard","hentry","category-nezaradene"],"_links":{"self":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/2120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2120"}],"version-history":[{"count":2,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/2120\/revisions"}],"predecessor-version":[{"id":2127,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/2120\/revisions\/2127"}],"wp:attachment":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}