{"id":15594,"date":"2019-07-03T14:36:01","date_gmt":"2019-07-03T11:36:01","guid":{"rendered":"https:\/\/fatihboy.com\/?p=15594"},"modified":"2021-06-16T21:52:40","modified_gmt":"2021-06-16T18:52:40","slug":"kubernetes-persistent-volume","status":"publish","type":"post","link":"https:\/\/fatihboy.com\/en\/kubernetes-persistent-volume\/","title":{"rendered":"Kubernetes Persistent Volume"},"content":{"rendered":"<p>\u00d6nceki makalede Kubernetes Volume kavram\u0131n\u0131 ele alm\u0131\u015f ve volume\u2019leri kabaca gruplam\u0131\u015ft\u0131k. Bu makalede \u00f6zellikle Kubernetes\u2019e yeni ba\u015flayanlar taraf\u0131ndan kolayl\u0131kla kar\u0131\u015ft\u0131r\u0131labilecek \u00f6nemli bir kavram olarak <strong>Persistent Volume (PV)<\/strong> ele alaca\u011f\u0131m. Kubernetes tasar\u0131m\u0131 pek \u00e7ok kavramda ger\u00e7ek hayattaki i\u015f ak\u0131\u015flar\u0131n\u0131 modellemi\u015ftir. Persistent Volume kavram\u0131 da bunun \u00f6rneklerinden birisidir. Dolay\u0131s\u0131yla Persistent Volume\u2019\u00fc anlamak i\u00e7in \u00f6ncelikle Kubernetes&nbsp; \u00f6ncesi depolama alan\u0131 nas\u0131l olu\u015fturulur bilmekte fayda var.<\/p>\n\n\n\n<p>IT ekipleri operasyonel olarak depolama alanlar\u0131n\u0131 y\u00f6netirken 3 a\u015famadan ge\u00e7mektedir;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li> Depo alan\u0131n\u0131n sa\u011flanmas\u0131 <\/li><li> Depo alan\u0131n\u0131n ihtiya\u00e7lar do\u011frultusunda yap\u0131land\u0131r\u0131lmas\u0131 <\/li><li> Depo alan\u0131n hedefe ba\u011flanmas\u0131 <\/li><\/ol>\n\n\n\n<p>Operasyonel bak\u0131\u015f a\u00e7\u0131s\u0131yla depolama alan\u0131 verilmesi s\u00fcreci genelde fiziksel diskin bir sunucuya ba\u011flanmas\u0131 ile ba\u015flamaktad\u0131r. Disk genellikle Storage Area Network (SAN) \u00fcyesi bir sunucuya ba\u011flan\u0131r. SAN\u2019a dahil olmas\u0131yla birlikte disk art\u0131k ba\u011fl\u0131 oldu\u011fu sunucunun de\u011fil a\u011fa ba\u011fl\u0131 sunucular\u0131n ortak mal\u0131 haline gelmi\u015f olur. A\u011fa ba\u011fl\u0131 sunucular bu depolama alan\u0131n\u0131 ihtiya\u00e7lar\u0131 kapsam\u0131nda kullanabilirler. \u00d6te yandan Disk\u2019in SAN\u2019a ba\u011fl\u0131 sunucuya tak\u0131lmas\u0131 ile birlikte do\u011frudan kullan\u0131ma haz\u0131r hale gelmez. \u00d6rne\u011fin, bu diske eri\u015fim i\u00e7in Local Unit Number (LUN) atanmas\u0131 gerekmektedir. Gerekli yap\u0131land\u0131rmalar\u0131n tamamlanmas\u0131 ard\u0131ndan depo alan\u0131 hedef sunucuya ba\u011flan\u0131r ve uygulamalar\u0131n kullan\u0131m\u0131na sunulur.<\/p>\n\n\n\n<p>Bu k\u0131sa bilgilendirme ard\u0131nda yukar\u0131da sayd\u0131\u011f\u0131m 3 ad\u0131m\u0131n Kubernetes\u2019e yans\u0131mas\u0131n\u0131 inceledi\u011fimizde kar\u015f\u0131m\u0131za a\u015fa\u011f\u0131daki tablo \u00e7\u0131kacakt\u0131r;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td><span style=\"font-size: small;\">Depo alan\u0131n\u0131n Sa\u011flanmas\u0131<\/span><\/td><td><strong><span style=\"font-size: small;\">Persistent Volume<\/span><\/strong><\/td><\/tr><tr><td><span style=\"font-size: small;\">Depo alan\u0131n\u0131n yap\u0131land\u0131r\u0131mas\u0131<\/span><\/td><td><strong><span style=\"font-size: small;\">Storage Class<\/span><\/strong><\/td><\/tr><tr><td><span style=\"font-size: small;\">Depo alan\u0131n\u0131n hedefe ba\u011flanmas\u0131<\/span><\/td><td><strong><span style=\"font-size: small;\">Persistent Volume Claim<\/span><\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Kubernetes y\u00f6neticisi uygulamalar\u0131n ihtiya\u00e7lar\u0131 do\u011frultusunda kal\u0131c\u0131 alan ihtiya\u00e7lar\u0131n\u0131 inceleyerek bir planlama yapar. Planlama neticesinde bir ya da birden fazla kaynak \u00fczerinde haz\u0131rlanm\u0131\u015f depolaman\u0131n s\u0131n\u0131fland\u0131rmas\u0131 yap\u0131larak depolama sa\u011flay\u0131c\u0131s\u0131, dosya sistemi, block boyutu, alan boyutu v.b. bilgileri <strong>Storage Class (SC)<\/strong> yard\u0131m\u0131yla bildirilir. Bu seviyede yer alan bilgi arkaplandaki kal\u0131c\u0131 saklama alan\u0131 ile bu alana ait dosya sistemi, boyut ve depolama alan\u0131 \u00f6zelindeki di\u011fer gerekli detaylar\u0131n\u0131 bar\u0131nd\u0131rmaktad\u0131r. Bu haliyle depolama alan\u0131 hen\u00fcz Pod\u2019lar\u0131n kullan\u0131m\u0131na haz\u0131r de\u011fildir.<\/p>\n\n\n\n<p>Geli\u015ftiriciler uygulamalar\u0131n\u0131n gereksinimi g\u00f6z \u00f6n\u00fcne alarak kal\u0131c\u0131 bir depolama alan\u0131 talebinde bulunurlar. <strong>Persistent Volume Claim<\/strong>&nbsp; <strong>(PVC)<\/strong> olarak yap\u0131lan bu talep gereksinim duyulan depolama boyutu ve depolama karakteristiklerini bar\u0131nd\u0131rmaktad\u0131r.<\/p>\n\n\n\n<p>Dinamik atama kapsam\u0131nda, Persistent Volume Claim\u2019ler Kubernetes taraf\u0131ndan de\u011ferlendirilerek talebe uygun bir <strong>Persistent Volume<\/strong> aranarak atanmaya \u00e7al\u0131\u015f\u0131l\u0131r. Uygun bir Persistent Volume bulunmas\u0131 durumunda talebe istinaden pod\u2019a atanmas\u0131 yap\u0131l\u0131r. Uygun bir Persistent Volume bulunamamas\u0131 durumunda sistem kaynaklar\u0131 incelenerek yeni bir Persistent Volume olu\u015fturulmaya \u00e7al\u0131\u015f\u0131l\u0131r. Statik atama kapsam\u0131nda ise, Persistent Volume&#8217;ler Kubernetes y\u00f6neticilerince kontrol edilir, olu\u015fturulur ve atan\u0131r. Kimi senaryolarda, talebe uygun bir Persistent Volume bulunamaz ya da olu\u015fturulamaz. Bu durumda Kubernetes talebi yerine getirene kadar Pod\u2019u aya\u011fa kald\u0131rmayacakt\u0131r. Bu sebeple sistem kaynak kullan\u0131m\u0131n\u0131n yak\u0131ndan takip edilmesi \u00f6nemlidir. Bu i\u015fleyi\u015ften de anla\u015f\u0131laca\u011f\u0131 \u00fczere Persistent Volume&#8217;leri sanal depolama alanlar\u0131\/volume olarak d\u00fc\u015f\u00fcnebiliriz. Zaten Persistent Volume&#8217;ler ayn\u0131 <a href=\"https:\/\/fatihboy.com\/en\/post\/kubernetes-volumes\/\">bir \u00f6nceki makalede payla\u015ft\u0131\u011f\u0131m Volume&#8217;ler<\/a> gibi bir Kubernetes Volume eklentisidirler.<\/p>\n\n\n\n<p>Programc\u0131 bak\u0131\u015f a\u00e7\u0131s\u0131yla konuya yakla\u015f\u0131rsak; Persistent Volume Claim\u2019lerin Pod ile volume\u2019\u00fc birbirine ba\u011flayan tutkal ya da e\u015fle\u015ftirme tablosu oldu\u011funu s\u00f6yleyebiliriz. Persistent Volume Claim ile Persistent Volume bire bir ba\u011flant\u0131ya sahiptir.<\/p>\n\n\n\n<p>Toparlayacak olursak; Persistent Volume Claim&#8217;ler sadece bir ka\u011f\u0131da yazd\u0131\u011f\u0131m\u0131z dilek\u00e7edir, yerine getirecek biri olmad\u0131\u011f\u0131 s\u00fcrece rafta beklerler. Bu taleplerin ger\u00e7ekle\u015fmi\u015f hali Persistent Volume&#8217;lerdir.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Persistent Volume Politikas\u0131<\/h2>\n\n\n\n<p>Bir Persistent Volume Claim (PVC) olu\u015fturulurken bu talebe istinaden olu\u015fturulacak Persistent Volume i\u00e7in de bir politika belirlenir. Persistent Volume ya\u015fam d\u00f6ng\u00fcs\u00fcn\u00fc de etkileyen bu politika a\u015fa\u011f\u0131daki de\u011ferlere sahip olabilir;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> <strong>Retain<\/strong>: Talep silinse de olu\u015fturulan Persistent Volume\u2019un saklanmas\u0131 gerekti\u011fini belirtir. Bu politikada Persistent Volume verisinin elle kurtar\u0131labilecek \u015fekilde saklanarak gelen yeni bir Persistent Volume Claim talebi ile bir Pod\u2019a ba\u011flanmaz. Elle temizleme i\u015flemi ard\u0131ndan yeni taleplerde kullan\u0131labilir. <\/li><li> <strong>Recycle<\/strong>: Arkaplandaki volume eklentisinin destekledi\u011fi senaryolarda kullan\u0131labilen bu politikada, talebin silinmesi ard\u0131ndan Persistent Volume i\u00e7erisindeki veri otomatik olarak temizlenerek yeni kullan\u0131ma haz\u0131r hale getirilir. Bu politika g\u00fcncel s\u00fcr\u00fcmlerde deprecated status\u00fcne d\u00fc\u015fm\u00fc\u015ft\u00fcr ve dinamik tan\u0131mlama kullan\u0131m\u0131 tavsiye edilmektedir. <\/li><li> <strong>Delete<\/strong>: Talebin silinmesiyle birlikte Persistent Volume\u2019\u00fcn de silinece\u011fini belirtir. <\/li><\/ul>\n\n\n\n<p>Bu politikalardan da anla\u015f\u0131laca\u011f\u0131 \u00fczere Persistent Volume&#8217;ler pod&#8217;lar\u0131n \u00fczerinde ve pod&#8217;lardan farkl\u0131 bir ya\u015fam d\u00f6ng\u00fcs\u00fcne sahiptirler.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Veri Korumas\u0131<\/h2>\n\n\n\n<p>Persistent Volume Claim ve Persistent Volume tan\u0131mlar\u0131 olas\u0131 bir veri kayb\u0131na kar\u015f\u0131 Kubernetes taraf\u0131ndan korunmaktad\u0131r. Aktif bir Pod\u2019a ba\u011fl\u0131 olan Persistent Volume Claim tan\u0131m\u0131 silinmek istenirse, Pod kullan\u0131m\u0131 sonlanana kadar PVC tan\u0131m\u0131 silinmeyecektir. Benzer bir durum Persistent Volume i\u00e7in de ge\u00e7erlidir. Ba\u011fl\u0131 bir PVC kayd\u0131 varsa bu kay\u0131t silinene kadar Persistent Volume Kubernetes taraf\u0131ndan silinmeyecektir.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Alan Artt\u0131r\u0131m\u0131<\/h2>\n\n\n\n<p>Depolama alan\u0131n\u0131n destekledi\u011fi senaryolarda, Storage Class\u2019ta verilecek <strong>allowVolumeExpansion<\/strong> parametresi sayesinde bu Storage Class ile olu\u015fturulan Persistent Volume Claim\u2019ler daha sonradan yeniden d\u00fczenlenerek daha geni\u015f alan talep edilmesi m\u00fcmk\u00fcn olabilir. Talep Kubernetes taraf\u0131ndan incelenerek ba\u011fl\u0131 Persistent Volume geni\u015fletilmeye \u00e7al\u0131\u015f\u0131l\u0131r.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kubernetes Volume vs Persistent Volume<\/h2>\n\n\n\n<p>\u015eimdiye kadar payla\u015ft\u0131klar\u0131ma k\u0131sa bir es vererek bir konuya dikkatinizi \u00e7ekmek istiyorum. Kubernetes<strong> Persistent Volume ya\u015fam d\u00f6ng\u00fcs\u00fc Pod\u2019dan tamamen ba\u011f\u0131ms\u0131z bir \u015fekilde ilerlemektedir<\/strong>. Bu da verilerin Pod\u2019lardan ba\u011f\u0131ms\u0131z olarak sakland\u0131\u011f\u0131, yani ba\u011fland\u0131klar\u0131 Pod\u2019lar\u0131n ya\u015fam d\u00f6ng\u00fclerinin sona ermesi ard\u0131ndan da kendi ya\u015fam d\u00f6ng\u00fcleri do\u011frultusunda verilerini korumaya devam ettikleri anlam\u0131na gelmektedir. Bu \u00f6nemli bir ayr\u0131nt\u0131d\u0131r; \u00e7\u00fcnk\u00fc Kubernetes Volume\u2019leri ile Persistent Volume\u2019leri birbirinden bu ayr\u0131nt\u0131 ay\u0131rmaktad\u0131r. En nihayetinde ortak eklentilerle ayn\u0131 depolama y\u00f6ntemlerini desteklemektedirler.&nbsp; <strong>Kubernetes Volume\u2019lerinin ya\u015fam d\u00f6ng\u00fcs\u00fc ba\u011fl\u0131 olduklar\u0131 Pod ya\u015fam d\u00f6ng\u00fcs\u00fcne ba\u011fl\u0131d\u0131r<\/strong>. Bir Kubernetes Volume\u2019u Pod ile birlikte s\u00f6z konusudur. Pod\u2019un d\u00f6ng\u00fcs\u00fcn\u00fcn sonlanmas\u0131 Kubernetes Volume\u2019\u00fcn de d\u00f6ng\u00fcs\u00fcn\u00fcn sonland\u0131\u011f\u0131 anlam\u0131na gelmektedir.<\/p>\n\n\n\n<p>Yukar\u0131daki bilgiler \u0131\u015f\u0131\u011f\u0131nda Kubernetes Volume ve Persistent Volume kavramlar\u0131n\u0131 inceledi\u011fimizde Persistent Volume\u2019\u00fcn Pod\u2019lardan daha fazla ayr\u0131\u015fm\u0131\u015f, soyutla\u015ft\u0131r\u0131lm\u0131\u015f bir kavram oldu\u011funu g\u00f6rebiliriz. Bunu biraz daha a\u00e7arsak, Pod tan\u0131m\u0131 i\u00e7erisinde bir saklama alan\u0131 i\u00e7in volume kullan\u0131lmas\u0131 durumunda tan\u0131m i\u00e7erisinde saklama alan\u0131na dair detaylar\u0131 belirtmemiz gerekmektedir. Bunu <a href=\"https:\/\/fatihboy.com\/en\/post\/kubernetes-volumes\/\">bir \u00f6nceki makalemde<\/a><\/p>\n\n\n\n<p>yer alan \u00f6rneklerde kolayl\u0131kla g\u00f6rebilirsiniz. Bu durumda genel ge\u00e7er bir da\u011f\u0131t\u0131ma sahip pod\u2019lar olu\u015fturmakta b\u00fcy\u00fck bir engeldir. Geli\u015ftirici olarak gerekli depolama alan\u0131 bilgisine sahip olmam, tan\u0131mlamam, daha da \u00f6nemlisi uygulamam\u0131n ko\u015ftu\u011fu Kubernetes k\u00fcmesinde de bu tan\u0131ma sahip alan\u0131n olmas\u0131 gerekmektedir.<\/p>\n\n\n\n<p>Kubernetes\u2019in do\u011fas\u0131n\u0131n bir \u00f6nceki paragrafta ifade etmeye \u00e7al\u0131\u015ft\u0131\u011f\u0131m ba\u011f\u0131ml\u0131l\u0131kla tezat olu\u015fturdu\u011fu d\u00fc\u015f\u00fcn\u00fcl\u00fcrse Persistent Volume kavram\u0131n\u0131n ortaya \u00e7\u0131kmas\u0131 daha net anla\u015f\u0131lacakt\u0131r. Geli\u015ftirici olarak yapmam gereken \u00e7o\u011funlukla verinin ne \u015fekilde, hangi dosya sistemi \u00fczerinden saklanmas\u0131 gerekti\u011fini belirtmekten \u00e7ok hangi \u015fartlarda saklanmas\u0131n\u0131 istedi\u011fimi belirtmek olmal\u0131. Uygulama en nihayetinde bu \u015fartlar\u0131 sa\u011flayan t\u00fcm ortamlarda \u00e7al\u0131\u015facakt\u0131r. Bu da Kubernetes y\u00f6neticilerinin arka planlandaki saklama alan\u0131 v.b. detaylara odaklan\u0131rken geli\u015ftiricilerin daha \u00e7ok uygulama ve veriye odaklanmalar\u0131n\u0131 sa\u011flayacakt\u0131r. Sonu\u00e7 olarak ta\u015f\u0131nabilir, her ortamda \u00e7al\u0131\u015fabilir uygulamalar ortaya \u00e7\u0131kacakt\u0131r.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Persistent Volume Tan\u0131mlama<\/h2>\n\n\n\n<p>Volume ile Persistent Volume aras\u0131ndaki ayr\u0131m\u0131 ifade edebildi\u011fimi umarak tekrar Persistent Volume \u00f6zeline geri d\u00f6n\u00fcyorum. Art\u0131k s\u0131ra geldi Kubernetes k\u00fcmesinde kullan\u0131m\u0131n\u0131 \u00f6rneklemeye. Statik tan\u0131mlama ile ilerleyece\u011fimiz \u00f6rne\u011fimizde hostPath yard\u0131m\u0131yla sunucu \u00fczerindeki bir klas\u00f6r\u00fc kullanaca\u011f\u0131z. Senaryoyu sade tutabilmek ad\u0131na Kubernetes k\u00fcmesinde tek bir worker node oldu\u011funu varsay\u0131yorum.<\/p>\n\n\n\n<p>\u00d6ncelikle worker node \u00fczerinde Persistent Volume hedefi olacak klas\u00f6r olu\u015fturulur;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mkdir \/mnt\/data<\/pre>\n\n\n\n<p>A\u015fa\u011f\u0131daki komutla bu klas\u00f6rde \u00f6rnek bir <strong>index.html<\/strong> dosyas\u0131 olu\u015fturulur;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo \"Enterprisecoding'den merhaba\" > \/mnt\/data\/index.html<\/pre>\n\n\n\n<p>A\u015fa\u011f\u0131daki i\u00e7eri\u011fe sahip bir <strong>hostpath-pv.yml<\/strong> dosyas\u0131 olu\u015fturulur;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kind: PersistentVolume\napiVersion: v1\nmetadata:\n  name: ornek-volume\n  labels:\n    type: local\nspec:\n  storageClassName: manual\n  capacity:\n    storage: 10Gi\n  accessModes:\n    - ReadWriteOnce\n  hostPath:\n    path: \"\/mnt\/data\"<\/pre>\n\n\n\n<p>Bu dosya Persistent Volume tan\u0131m\u0131n\u0131 bar\u0131nd\u0131rmaktad\u0131r. Statik tan\u0131mlama ile ilerledi\u011fimiz i\u00e7in Persistent Volume \u00fczerinde manual olarak StorageClass bilgileri de yer almaktad\u0131r (son iki sat\u0131ra bak\u0131n\u0131z l\u00fctfen). A\u015fa\u011f\u0131daki komutla haz\u0131rlad\u0131\u011f\u0131m\u0131z tan\u0131mla bir Persistent Volume olu\u015fturulur;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl apply -f hostpath-pv.yml<\/pre>\n\n\n\n<p>Persistent Volume durumu a\u015fa\u011f\u0131daki komutla kontrol edilebilir;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get pv ornek-volume<\/pre>\n\n\n\n<p>A\u015fa\u011f\u0131daki i\u00e7erikle <strong>ornek-pvc.yml<\/strong> ad\u0131nda bir Persistent Volume Claim tan\u0131m dosyas\u0131 olu\u015fturulur;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n  name: ornek-volume-claim\nspec:\n  storageClassName: manual\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: 3Gi<\/pre>\n\n\n\n<p>A\u015fa\u011f\u0131daki komutla haz\u0131rlad\u0131\u011f\u0131m\u0131z talep Kubernetes&#8217;e kay\u0131t edilir;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl apply -f ornek-pvc.yml<\/pre>\n\n\n\n<p>Bu i\u015flem ard\u0131ndan Persistent Volume tekrar sorguland\u0131\u011f\u0131nda talebimizin yerine getirildi\u011fi, Persistent Volume Claim ile Persistent Volume&#8217;\u00fcn birbirine ba\u011fland\u0131\u011f\u0131 g\u00f6r\u00fclecektir;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get pv ornek-volume<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/fatihboy.com\/wp-content\/uploads\/2020\/02\/pv-claimed.png\"><img decoding=\"async\" src=\"https:\/\/fatihboy.com\/wp-content\/uploads\/2020\/02\/pv-claimed_thumb.png\" alt=\"pv-claimed\"\/><\/a><\/figure>\n\n\n\n<p>Benzer \u015fekilde status de\u011feri olarak <strong>Bound<\/strong> g\u00f6r\u00fclecektir.<\/p>\n\n\n\n<p>A\u015fa\u011f\u0131daki komutla da Persistent Volume Claim sorgulanarak durumu teyit edilebilir;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get pvc ornek-volume-claim<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/fatihboy.com\/wp-content\/uploads\/2020\/02\/pvc.png\"><img decoding=\"async\" src=\"https:\/\/fatihboy.com\/wp-content\/uploads\/2020\/02\/pvc_thumb.png\" alt=\"pvc\"\/><\/a><\/figure>\n\n\n\n<p>G\u00f6r\u00fcld\u00fc\u011f\u00fc gibi PVC durumu da <strong>Bound<\/strong> ve ba\u011fl\u0131 volume olarak ornek-volume g\u00f6r\u00fclmekte.<\/p>\n\n\n\n<p>A\u015fa\u011f\u0131daki i\u00e7eri\u011fe sahip&nbsp; <strong>ornek-pod.yml<\/strong> dosyas\u0131 yard\u0131m\u0131yla Persistent Volume Claim\u2019i kullanabilece\u011fimiz bir pod olu\u015fturabiliriz;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kind: Pod\napiVersion: v1\nmetadata:\n  name: ornek-pod\nspec:\n  volumes:\n    - name: ornek-claim\n      persistentVolumeClaim:\n       claimName: ornek-volume-claim\n  containers:\n    - name: ornek-pv-container\n      image: nginx\n      ports:\n        - containerPort: 80\n          name: \"http-server\"\n      volumeMounts:\n        - mountPath: \"\/usr\/share\/nginx\/html\"\n          name: ornek-claim<\/pre>\n\n\n\n<p>A\u015fa\u011f\u0131daki komutla pod olu\u015fturulur;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl apply -f ornek-pod.yml<\/pre>\n\n\n\n<p>Pod\u2019un ba\u015flamas\u0131 ard\u0131ndan a\u015fa\u011f\u0131daki komutla pod ip adresi \u00f6\u011frenilir;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get pod -o wide<\/pre>\n\n\n\n<p>Bu ip adresine yap\u0131lan taleple \u00f6nceki ad\u0131mlarda olu\u015fturdu\u011fumuz ve Persistent Volume\u2019de yer alan i\u00e7eri\u011fimizi g\u00f6rebiliriz;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/fatihboy.com\/wp-content\/uploads\/2020\/02\/curl-get.png\"><img decoding=\"async\" src=\"https:\/\/fatihboy.com\/wp-content\/uploads\/2020\/02\/curl-get_thumb.png\" alt=\"curl-get\"\/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>\u00d6nceki makalede Kubernetes Volume kavram\u0131n\u0131 ele alm\u0131\u015f ve volume\u2019leri kabaca gruplam\u0131\u015ft\u0131k. Bu makalede \u00f6zellikle Kubernetes\u2019e yeni ba\u015flayanlar taraf\u0131ndan kolayl\u0131kla kar\u0131\u015ft\u0131r\u0131labilecek \u00f6nemli bir kavram olarak Persistent Volume (PV) ele alaca\u011f\u0131m. Kubernetes tasar\u0131m\u0131 pek \u00e7ok kavramda ger\u00e7ek hayattaki i\u015f ak\u0131\u015flar\u0131n\u0131 modellemi\u015ftir. Persistent Volume kavram\u0131 da bunun \u00f6rneklerinden birisidir. Dolay\u0131s\u0131yla Persistent Volume\u2019\u00fc anlamak i\u00e7in \u00f6ncelikle Kubernetes&nbsp; \u00f6ncesi depolama&#8230;<\/p>\n<p><a class=\"read-more\" href=\"https:\/\/fatihboy.com\/en\/kubernetes-persistent-volume\/\">Read More<\/a><\/p>","protected":false},"author":1,"featured_media":16860,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[38],"class_list":["post-15594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kubernetes","tag-kubernetes"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kubernetes Persistent Volume - Fatih Boy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihboy.com\/en\/kubernetes-persistent-volume\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kubernetes Persistent Volume - Fatih Boy\" \/>\n<meta property=\"og:description\" content=\"\u00d6nceki makalede Kubernetes Volume kavram\u0131n\u0131 ele alm\u0131\u015f ve volume\u2019leri kabaca gruplam\u0131\u015ft\u0131k. Bu makalede \u00f6zellikle Kubernetes\u2019e yeni ba\u015flayanlar taraf\u0131ndan kolayl\u0131kla kar\u0131\u015ft\u0131r\u0131labilecek \u00f6nemli bir kavram olarak Persistent Volume (PV) ele alaca\u011f\u0131m. Kubernetes tasar\u0131m\u0131 pek \u00e7ok kavramda ger\u00e7ek hayattaki i\u015f ak\u0131\u015flar\u0131n\u0131 modellemi\u015ftir. Persistent Volume kavram\u0131 da bunun \u00f6rneklerinden birisidir. Dolay\u0131s\u0131yla Persistent Volume\u2019\u00fc anlamak i\u00e7in \u00f6ncelikle Kubernetes&nbsp; \u00f6ncesi depolama...Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihboy.com\/en\/kubernetes-persistent-volume\/\" \/>\n<meta property=\"og:site_name\" content=\"Fatih Boy\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-03T11:36:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-16T18:52:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"620\" \/>\n\t<meta property=\"og:image:height\" content=\"310\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fatih Boy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Boy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/\"},\"author\":{\"name\":\"Fatih Boy\",\"@id\":\"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158\"},\"headline\":\"Kubernetes Persistent Volume\",\"datePublished\":\"2019-07-03T11:36:01+00:00\",\"dateModified\":\"2021-06-16T18:52:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/\"},\"wordCount\":1723,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158\"},\"image\":{\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg\",\"keywords\":[\"Kubernetes\"],\"articleSection\":[\"Kubernetes\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/\",\"url\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/\",\"name\":\"Kubernetes Persistent Volume - Fatih Boy\",\"isPartOf\":{\"@id\":\"https:\/\/fatihboy.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg\",\"datePublished\":\"2019-07-03T11:36:01+00:00\",\"dateModified\":\"2021-06-16T18:52:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage\",\"url\":\"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg\",\"contentUrl\":\"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg\",\"width\":620,\"height\":310},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fatihboy.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kubernetes Persistent Volume\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihboy.com\/#website\",\"url\":\"https:\/\/fatihboy.com\/\",\"name\":\"Fatih Boy\",\"description\":\"Ki\u015fisel Web Sitesi\",\"publisher\":{\"@id\":\"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihboy.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158\",\"name\":\"Fatih Boy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fatihboy.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5b3de123ad95a2ffe30b75a54cee98b55f65185c6d6805b35088a3d945f2feb4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5b3de123ad95a2ffe30b75a54cee98b55f65185c6d6805b35088a3d945f2feb4?s=96&d=mm&r=g\",\"caption\":\"Fatih Boy\"},\"logo\":{\"@id\":\"https:\/\/fatihboy.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/fatihboy.com\"],\"url\":\"https:\/\/fatihboy.com\/en\/author\/fatih\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Kubernetes Persistent Volume - Fatih Boy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihboy.com\/en\/kubernetes-persistent-volume\/","og_locale":"en_US","og_type":"article","og_title":"Kubernetes Persistent Volume - Fatih Boy","og_description":"\u00d6nceki makalede Kubernetes Volume kavram\u0131n\u0131 ele alm\u0131\u015f ve volume\u2019leri kabaca gruplam\u0131\u015ft\u0131k. Bu makalede \u00f6zellikle Kubernetes\u2019e yeni ba\u015flayanlar taraf\u0131ndan kolayl\u0131kla kar\u0131\u015ft\u0131r\u0131labilecek \u00f6nemli bir kavram olarak Persistent Volume (PV) ele alaca\u011f\u0131m. Kubernetes tasar\u0131m\u0131 pek \u00e7ok kavramda ger\u00e7ek hayattaki i\u015f ak\u0131\u015flar\u0131n\u0131 modellemi\u015ftir. Persistent Volume kavram\u0131 da bunun \u00f6rneklerinden birisidir. Dolay\u0131s\u0131yla Persistent Volume\u2019\u00fc anlamak i\u00e7in \u00f6ncelikle Kubernetes&nbsp; \u00f6ncesi depolama...Read More","og_url":"https:\/\/fatihboy.com\/en\/kubernetes-persistent-volume\/","og_site_name":"Fatih Boy","article_published_time":"2019-07-03T11:36:01+00:00","article_modified_time":"2021-06-16T18:52:40+00:00","og_image":[{"width":620,"height":310,"url":"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg","type":"image\/jpeg"}],"author":"Fatih Boy","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Fatih Boy","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#article","isPartOf":{"@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/"},"author":{"name":"Fatih Boy","@id":"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158"},"headline":"Kubernetes Persistent Volume","datePublished":"2019-07-03T11:36:01+00:00","dateModified":"2021-06-16T18:52:40+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/"},"wordCount":1723,"commentCount":2,"publisher":{"@id":"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158"},"image":{"@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage"},"thumbnailUrl":"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg","keywords":["Kubernetes"],"articleSection":["Kubernetes"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/","url":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/","name":"Kubernetes Persistent Volume - Fatih Boy","isPartOf":{"@id":"https:\/\/fatihboy.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage"},"image":{"@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage"},"thumbnailUrl":"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg","datePublished":"2019-07-03T11:36:01+00:00","dateModified":"2021-06-16T18:52:40+00:00","breadcrumb":{"@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihboy.com\/kubernetes-persistent-volume\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#primaryimage","url":"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg","contentUrl":"https:\/\/fatihboy.com\/wp-content\/uploads\/2019\/07\/disk.jpg","width":620,"height":310},{"@type":"BreadcrumbList","@id":"https:\/\/fatihboy.com\/kubernetes-persistent-volume\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fatihboy.com\/"},{"@type":"ListItem","position":2,"name":"Kubernetes Persistent Volume"}]},{"@type":"WebSite","@id":"https:\/\/fatihboy.com\/#website","url":"https:\/\/fatihboy.com\/","name":"Fatih Boy","description":"Ki\u015fisel Web Sitesi","publisher":{"@id":"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihboy.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihboy.com\/#\/schema\/person\/6b06a41d42eed36eaa0780fbeb774158","name":"Fatih Boy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fatihboy.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5b3de123ad95a2ffe30b75a54cee98b55f65185c6d6805b35088a3d945f2feb4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5b3de123ad95a2ffe30b75a54cee98b55f65185c6d6805b35088a3d945f2feb4?s=96&d=mm&r=g","caption":"Fatih Boy"},"logo":{"@id":"https:\/\/fatihboy.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/fatihboy.com"],"url":"https:\/\/fatihboy.com\/en\/author\/fatih\/"}]}},"brizy_media":[],"_links":{"self":[{"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/posts\/15594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/comments?post=15594"}],"version-history":[{"count":1,"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/posts\/15594\/revisions"}],"predecessor-version":[{"id":33147,"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/posts\/15594\/revisions\/33147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/media\/16860"}],"wp:attachment":[{"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/media?parent=15594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/categories?post=15594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihboy.com\/en\/wp-json\/wp\/v2\/tags?post=15594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}