{"id":3049,"date":"2020-01-15T20:30:37","date_gmt":"2020-01-15T19:30:37","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=3049"},"modified":"2020-01-15T20:59:31","modified_gmt":"2020-01-15T19:59:31","slug":"migrate-existing-net-applications-to-azure-kubernetes-service","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/migrate-existing-net-applications-to-azure-kubernetes-service\/","title":{"rendered":"Mevcut .NET Uygulamalar\u0131n\u0131 Azure Kubernetes Service&#8217;e Migrate Etmek"},"content":{"rendered":"<p>G\u00fcn\u00fcm\u00fcz teknoloji \u00e7a\u011f\u0131nda, \u00f6zellikle b\u00fcy\u00fck \u00f6l\u00e7ekli firmalar i\u00e7in uygulamalar\u0131 cloud ortam\u0131nda host etmenin ne kadar da \u00f6nemli oldu\u011funu hepimiz biliyoruz. Bir \u00e7ok anket verilerine g\u00f6re de, \u00f6zellikle ge\u00e7ti\u011fimiz 2 y\u0131l i\u00e7erisinde hem public hem de private cloud kullan\u0131m oranlar\u0131 olduk\u00e7a artm\u0131\u015f durumda.<\/p>\n<p>Ba\u015fl\u0131ca birka\u00e7 sebebi ise, a\u015fa\u011f\u0131daki gibi s\u0131ralayabiliriz:<\/p>\n<ul>\n<li><strong>D\u00fc\u015f\u00fck maliyet<\/strong>: do\u011fru se\u00e7imler ile <em>IT<\/em>\u00a0 ve operasyon maliyetleri olduk\u00e7a azalt\u0131labilmekte.<\/li>\n<li><strong>\u00d6l\u00e7eklenebilirlik<\/strong>: belki de en \u00f6nemli sebeplerden birisi. Kolayl\u0131kla mevcut resource&#8217;lar geni\u015fletilebilmekte.<\/li>\n<li><strong>Esneklik\/Y\u00fcksek Eri\u015filebilirlik<\/strong>: cloud&#8217;a ge\u00e7i\u015f ile birlikte, hata durumlar\u0131na kar\u015f\u0131 sat\u0131n al\u0131nan ekstra donan\u0131m gereksinimleri de ortadan kald\u0131r\u0131labilmekte.<\/li>\n<\/ul>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/cloud-computing.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3052 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/cloud-computing.png\" alt=\"\" width=\"1280\" height=\"800\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/cloud-computing.png 1280w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/cloud-computing-300x188.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/cloud-computing-1024x640.png 1024w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/cloud-computing-768x480.png 768w\" data-sizes=\"(max-width: 1280px) 100vw, 1280px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1280px; --smush-placeholder-aspect-ratio: 1280\/800;\" \/><\/a><br \/>\n<em><code><strong>REF<\/strong>: https:\/\/vmokshagroup.com\/wp-content\/uploads\/2015\/08\/Save-money-date-and-time-using-cloud.png<\/code><\/em><\/p>\n<p>Durum b\u00f6yle olunca, yeni geli\u015ftirdi\u011fimiz uygulamalar\u0131n olabildi\u011fince containerize edilmi\u015f cloud-native uygulamalar\u0131 olmas\u0131na gayret g\u00f6steriyoruz. <strong>Kubernetes<\/strong> gibi container-orchestration platform&#8217;lar\u0131 ile de, uygulamalar\u0131n y\u00f6netim i\u015flemlerini ger\u00e7ekle\u015ftiriyoruz.<\/p>\n<h2>Peki, ya mevcut uygulamalar?<\/h2>\n<p><em>.NET Core<\/em> ile yeni geli\u015ftirdi\u011fimiz uygulamalar i\u00e7in kubernetes gibi platform&#8217;lara migration i\u015flemleri kolayl\u0131kla yap\u0131labiliyorken, bu s\u00fcre\u00e7 <em>.NET Framework<\/em> ile geli\u015ftirilmi\u015f olan mevcut uygulamalar i\u00e7in biraz daha zorlu olabiliyor.<\/p>\n<p>Genelde uygulamalar\u0131n \u00f6ncelikle <em>.NET Core<\/em>&#8216;a transformation i\u015flemi olduk\u00e7a tercih edilen bir se\u00e7enek olabiliyorken, bazen de zaman ve maliyetler g\u00f6z \u00f6n\u00fcnde al\u0131nd\u0131\u011f\u0131nda maalesef bir se\u00e7enek olam\u0131yor.<\/p>\n<p>Bu makale kapsam\u0131nda ise mevcut .<em>NET Framework<\/em> uygulamalar\u0131m\u0131z\u0131, redesign\/redevelopment yapmadan nas\u0131l containerize edilmi\u015f bir \u015fekilde <em><strong>Azure Kubernetes Service<\/strong><\/em> \u00fczerinde host edebiliz konusuna de\u011finmek istiyorum.<\/p>\n<h2>.NET Framework Uygulamalar\u0131n\u0131 AKS&#8217;e Migrate Etmek<\/h2>\n<p><em>Azure Kubernetes Service<\/em> \u00fczerinde mevcut <em>.NET Framework<\/em> uygulamalar\u0131n\u0131, .NET Core&#8217;a port etmeden windows container&#8217;lar olu\u015fturarak host edebilmek m\u00fcmk\u00fcn.<\/p>\n<p>Sadece .<em>NET Core<\/em>&#8216;a oranla base image size&#8217;\u0131, container i\u00e7erisinde <em>Windows Server Core<\/em> image&#8217;i kullan\u0131ld\u0131\u011f\u0131 i\u00e7in olduk\u00e7a b\u00fcy\u00fck durumda. Neyseki 2019 y\u0131l\u0131 sonlar\u0131nda ise bu image size&#8217;\u0131, <strong>%40<\/strong> gibi ciddi bir oranda daha k\u00fc\u00e7\u00fck bir hale getirildi. Bu konu hakk\u0131ndaki detayl\u0131 bilgiye, <em><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/we-made-windows-server-core-container-images-40-smaller\/\" target=\"_blank\" rel=\"noopener noreferrer\">buradan<\/a> <\/em>eri\u015febilirsiniz.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/azure-rehost-aks.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3057 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/azure-rehost-aks.png\" alt=\"\" width=\"2001\" height=\"1168\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/azure-rehost-aks.png 2001w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/azure-rehost-aks-300x175.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/azure-rehost-aks-1024x598.png 1024w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/azure-rehost-aks-768x448.png 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/azure-rehost-aks-1536x897.png 1536w\" data-sizes=\"(max-width: 2001px) 100vw, 2001px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2001px; --smush-placeholder-aspect-ratio: 2001\/1168;\" \/><\/a><\/p>\n<h3>AKS Cluster&#8217;\u0131n\u0131n Olu\u015fturulmas\u0131<\/h3>\n<p>\u00d6ncelikle<em> AKS <\/em>\u00fczerinde<em> Windows Server <\/em>container&#8217;lar olu\u015fturabilmek ve kullanabilmek i\u00e7in, &#8220;<em>aks-preview CLI<\/em>&#8221; extension&#8217;\u0131n\u0131n ve &#8220;<em>WindowsPreview<\/em>&#8221; feature&#8217;\u0131n\u0131n etkinle\u015ftirilmesi gerekiyor.<\/p>\n<p>Bu feature ile node pool i\u00e7erisine, windows server node&#8217;lar ekleyebilece\u011fiz.<\/p>\n<p>Bunun i\u00e7in <em><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/windows-container-cli?WT.mc_id=AZ-MVP-5003382#install-aks-preview-cli-extension\" target=\"_blank\" rel=\"noopener noreferrer\">buraya<\/a><\/em> t\u0131klayarak, &#8220;<em>Install aks-preview CLI extension<\/em>&#8221; ve &#8220;<em>Register Windows preview feature<\/em>&#8221; ba\u015fl\u0131klar\u0131 alt\u0131ndaki i\u015flemleri ger\u00e7ekle\u015ftirelim.<\/p>\n<blockquote><p><em><strong>NOT<\/strong><\/em>: Azure subscription&#8217;\u0131n\u0131n i\u00e7erisinde &#8220;<em>WindowsPreview<\/em>&#8221; feature&#8217;\u0131n\u0131n etkinle\u015ftirilmesi, birka\u00e7 dakika s\u00fcrebilir.<\/p><\/blockquote>\n<p>Extension ve feature&#8217;\u0131n etkinle\u015ftirme i\u015fleminden sonra, a\u015fa\u011f\u0131daki gibi bir resource group olu\u015fturarak i\u00e7erisinde <em>AKS<\/em> cluster olu\u015fturma i\u015flemine <em>CLI<\/em> yard\u0131m\u0131yla ba\u015flayabiliriz.<\/p>\n<blockquote><p><em><strong>NOT<\/strong><\/em>: \u00d6ncesinde <em>CLI<\/em> \u00fczerinden ilgili <em>Azure <\/em>subscription&#8217;a login olmay\u0131 unutmay\u0131n.<\/p><\/blockquote>\n<pre class=\"lang:default decode:true\">az group create -n my-aks-rg -l westeurope<\/pre>\n<pre class=\"lang:batch decode:true\">az aks create \\\r\n --kubernetes-version 1.14.7 \\\r\n --resource-group my-aks-rg \\\r\n --name my-test-aks \\\r\n --node-vm-size Standard_D2_v2 \\\r\n --node-count 1 \\\r\n --max-pods=250 \\\r\n --location westeurope \\\r\n --generate-ssh-keys \\\r\n --windows-admin-username testadmin \\\r\n --windows-admin-password P@ssw0rd1234 \\\r\n --vm-set-type VirtualMachineScaleSets \\\r\n --network-plugin azure\r\n<\/pre>\n<p>AKS cluster olu\u015fturma i\u015flemi ba\u015far\u0131yla tamamland\u0131ktan sonra, a\u015fa\u011f\u0131daki gibi bir response g\u00f6r\u00fcyor olmal\u0131y\u0131z.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/aks-create-cli.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3068 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/aks-create-cli.jpg\" alt=\"\" width=\"897\" height=\"369\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/aks-create-cli.jpg 897w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/aks-create-cli-300x123.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/aks-create-cli-768x316.jpg 768w\" data-sizes=\"(max-width: 897px) 100vw, 897px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 897px; --smush-placeholder-aspect-ratio: 897\/369;\" \/><\/a><\/p>\n<p>\u015eimdi olu\u015fturdu\u011fumuz cluster i\u00e7erisine windows node ekleyebilmek i\u00e7in, a\u015fa\u011f\u0131daki komut sat\u0131r\u0131n\u0131 \u00e7al\u0131\u015ft\u0131rmam\u0131z gerekmektedir.<\/p>\n<pre class=\"lang:default decode:true\">az aks nodepool add \r\n    --resource-group my-aks-rg \\\r\n    --cluster-name my-test-aks \\ \r\n    --os-type Windows\r\n    --name npool2 \\\r\n    --node-vm-size Standard_D2_v2 \\\r\n    --node-count 1 \\\r\n    --kubernetes-version 1.14.7<\/pre>\n<p>Windows node ekleme i\u015flemi tamamland\u0131ktan sonra, cluster&#8217;a ba\u011flanabilmemiz i\u00e7in a\u015fa\u011f\u0131daki gibi kubectl&#8217;i configure edelim.<\/p>\n<pre class=\"lang:default decode:true\">az aks get-credentials --resource-group my-aks-rg --name my-test-aks<\/pre>\n<p>Ard\u0131ndan eklemi\u015f oldu\u011fumuz node&#8217;lar\u0131 &#8220;<em>OS<\/em>&#8221; label&#8217;\u0131 ile g\u00f6rebilmek i\u00e7in ise, a\u015fa\u011f\u0131daki komut sat\u0131r\u0131n\u0131 kullanal\u0131m.<\/p>\n<pre class=\"lang:default decode:true \">kubectl get nodes --label-columns beta.kubernetes.io\/os<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/kubectl-get-nodes.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3070 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/kubectl-get-nodes.jpg\" alt=\"\" width=\"699\" height=\"231\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/kubectl-get-nodes.jpg 699w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/kubectl-get-nodes-300x99.jpg 300w\" data-sizes=\"(max-width: 699px) 100vw, 699px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 699px; --smush-placeholder-aspect-ratio: 699\/231;\" \/><\/a><\/p>\n<p>Yukar\u0131daki resimde de g\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi, windows node ba\u015far\u0131yla eklenmi\u015f durumda. B\u00f6ylece windows node&#8217;lu <em>AKS<\/em> cluster olu\u015fturma i\u015flemini tamamlam\u0131\u015f olduk.<\/p>\n<h3>ASP.NET Framework Web Uygulamas\u0131n\u0131n Containerize Edilmesi<\/h3>\n<p>Ben \u00f6rnek ama\u00e7l\u0131 &#8220;<em>MyOldTodoAPP<\/em>&#8221; ad\u0131nda basit bir <em>ASP.NET Framework Web Application(4.8)<\/em> projesi olu\u015fturaca\u011f\u0131m. Dilerseniz siz mevcut <strong>.NET Framework<\/strong> uygulamalar\u0131n\u0131z\u0131 kullanabilirsiniz.<\/p>\n<p>Uygulamay\u0131 dockerize etmeden \u00f6nce, build ve publish i\u015flemlerini a\u015fa\u011f\u0131daki gibi container d\u0131\u015f\u0131nda ger\u00e7ekle\u015ftirelim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/publish-profile.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3074 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/publish-profile.jpg\" alt=\"\" width=\"706\" height=\"558\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/publish-profile.jpg 706w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/publish-profile-300x237.jpg 300w\" data-sizes=\"(max-width: 706px) 100vw, 706px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 706px; --smush-placeholder-aspect-ratio: 706\/558;\" \/><\/a><\/p>\n<p>Container d\u0131\u015far\u0131s\u0131nda build i\u015flemi, windows container case&#8217;i i\u00e7in daha do\u011fru bir tercih olacakt\u0131r.<\/p>\n<p>Publish i\u015fleminden sonra, ilgili publish folder&#8217;\u0131 alt\u0131nda a\u015fa\u011f\u0131daki gibi bir &#8220;<em>Dockerfile<\/em>&#8221; olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">FROM mcr.microsoft.com\/dotnet\/framework\/aspnet:4.8-20191210-windowsservercore-ltsc2019\r\nCOPY . \/inetpub\/wwwroot<\/pre>\n<p>Burada dikkat etmemiz gereken tek nokta, kullanacak oldu\u011fumuz base image <em>OS<\/em> versiyonunun, host <em>OS<\/em> versiyonu ile uyumlu olmas\u0131d\u0131r. Detayl\u0131 bilgiye ise, <em><a href=\"https:\/\/docs.microsoft.com\/en-us\/virtualization\/windowscontainers\/deploy-containers\/version-compatibility?tabs=windows-server-1909%2Cwindows-10-1909\" target=\"_blank\" rel=\"noopener noreferrer\">buradan<\/a><\/em> eri\u015febilirsiniz.<\/p>\n<p>Windows node&#8217;un <em>OS<\/em> versiyonuna ise, <em>Azure<\/em> portal&#8217;dan veya a\u015fa\u011f\u0131daki komut sat\u0131r\u0131 \u00fczerinden eri\u015filebilmektedir.<\/p>\n<pre class=\"lang:default decode:true\">kubectl get nodes -o wide\r\n\r\nNAME                                STATUS   ROLES   AGE     VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                         KERNEL-VERSION      CONTAINER-RUNTIME\r\naks-nodepool1-42915174-vmss000000   Ready    agent   3d11h   v1.14.7   10.240.0.4             Ubuntu 16.04.6 LTS               4.15.0-1066-azure   docker:\/\/3.0.8\r\naksnpool2000000                     Ready    agent   2d12h   v1.14.7   10.240.0.255           Windows Server 2019 Datacenter   10.0.17763.737      docker:\/\/19.3.2<\/pre>\n<p>Bu base image ile, &#8220;<em>.NET Framework Web<\/em>&#8220;, &#8220;<em>MVC<\/em>&#8220;, &#8220;<em>Web API<\/em>&#8221; ve &#8220;<em>SignalR<\/em>&#8221; uygulamalar\u0131 container i\u00e7erisinde \u00e7al\u0131\u015ft\u0131r\u0131labilmekte.<\/p>\n<p>Ayr\u0131ca &#8220;<em>ASPNET<\/em>&#8221; base image&#8217;i i\u00e7erisinde <em>IIS<\/em> process&#8217;i &#8220;entrypoint&#8221; olarak configure edildi\u011fi i\u00e7in, dockerfile i\u00e7erisinde bir entrypoint configure etmedik.<\/p>\n<p>\u015eimdi uygulamay\u0131 dockerize etmeye ba\u015flayabiliriz. Bunun i\u00e7in, ilgili publish folder path&#8217;ine girerek, <em>CLI<\/em> \u00fczerinden a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">docker build -t my-existing-app .<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/docker-build-command.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3076 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/docker-build-command.jpg\" alt=\"\" width=\"809\" height=\"235\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-build-command.jpg 809w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-build-command-300x87.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-build-command-768x223.jpg 768w\" data-sizes=\"(max-width: 809px) 100vw, 809px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 809px; --smush-placeholder-aspect-ratio: 809\/235;\" \/><\/a><\/p>\n<p><em>AKS<\/em>&#8216;e deploy etmeden \u00f6nce her \u015feyin do\u011fru gitti\u011finden emin olabilmek i\u00e7in, dockerize etti\u011fimiz uygulamay\u0131 &#8220;<em>8080<\/em>&#8221; port&#8217;u \u00fczerinden a\u015fa\u011f\u0131daki gibi \u00e7al\u0131\u015ft\u0131r\u0131p test edelim.<\/p>\n<pre class=\"lang:default decode:true \">docker run -d -p 8080:80 my-existing-app<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/docker-run-command.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3077 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/docker-run-command.jpg\" alt=\"\" width=\"841\" height=\"132\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-run-command.jpg 841w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-run-command-300x47.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-run-command-768x121.jpg 768w\" data-sizes=\"(max-width: 841px) 100vw, 841px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 841px; --smush-placeholder-aspect-ratio: 841\/132;\" \/><\/a><\/p>\n<p>Her \u015fey yolunda gitti ise, a\u015fa\u011f\u0131daki gibi default <em>ASP.NET<\/em> response&#8217;unu g\u00f6r\u00fcyor olmal\u0131y\u0131z.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/netframework-working-dockerized.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3079 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/netframework-working-dockerized.jpg\" alt=\"\" width=\"1037\" height=\"664\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/netframework-working-dockerized.jpg 1037w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/netframework-working-dockerized-300x192.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/netframework-working-dockerized-1024x656.jpg 1024w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/netframework-working-dockerized-768x492.jpg 768w\" data-sizes=\"(max-width: 1037px) 100vw, 1037px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1037px; --smush-placeholder-aspect-ratio: 1037\/664;\" \/><\/a><\/p>\n<p>\u015eimdi container&#8217;\u0131 a\u015fa\u011f\u0131daki gibi tag&#8217;leyip, ard\u0131ndan container registry&#8217;e g\u00f6nderelim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/docker-tag-and-push.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3081 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/docker-tag-and-push.jpg\" alt=\"\" width=\"956\" height=\"345\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-tag-and-push.jpg 956w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-tag-and-push-300x108.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/docker-tag-and-push-768x277.jpg 768w\" data-sizes=\"(max-width: 956px) 100vw, 956px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 956px; --smush-placeholder-aspect-ratio: 956\/345;\" \/><\/a><\/p>\n<h3>Container&#8217;\u0131n AKS&#8217;e Deployment \u0130\u015flemi<\/h3>\n<p>Olu\u015fturmu\u015f oldu\u011fumuz container&#8217;\u0131 <em>AKS<\/em>&#8216;e deploy edebilmek i\u00e7in, a\u015fa\u011f\u0131daki gibi &#8220;<em>deploy-to-aks<\/em>&#8221; ad\u0131nda bir &#8220;<em>yaml<\/em>&#8221; file&#8217;\u0131 olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">apiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: sample\r\n  labels:\r\n    app: sample\r\nspec:\r\n  replicas: 1\r\n  template:\r\n    metadata:\r\n      name: sample\r\n      labels:\r\n        app: sample\r\n    spec:\r\n      nodeSelector:\r\n        \"beta.kubernetes.io\/os\": windows\r\n      containers:\r\n      - name: my-app\r\n        image: mytestaksregistry.azurecr.io\/my-existing-app:1.0\r\n        resources:\r\n          limits:\r\n            cpu: 1\r\n            memory: 800M\r\n          requests:\r\n            cpu: .1\r\n            memory: 300M\r\n        ports:\r\n          - containerPort: 80\r\n  selector:\r\n    matchLabels:\r\n      app: sample\r\n---\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: sample\r\nspec:\r\n  type: LoadBalancer\r\n  ports:\r\n  - protocol: TCP\r\n    port: 80\r\n  selector:\r\n    app: sample<\/pre>\n<p>Burada \u00f6nemli olan nokta ise &#8220;<em>spec<\/em>&#8221; alt\u0131ndaki &#8220;<em>nodeSelector<\/em>&#8221; de\u011ferinin, &#8220;<em>windows<\/em>&#8221; olarak set edilmi\u015f olmas\u0131d\u0131r. B\u00f6ylece container, windows olan node pool i\u00e7erisinde \u00e7al\u0131\u015ft\u0131r\u0131lacakt\u0131r. Ayr\u0131ca &#8220;<em>containers<\/em>&#8221; alt\u0131ndaki &#8220;<em>image<\/em>&#8221; de\u011ferini de, tag&#8217;ledi\u011fimiz container de\u011feri ile g\u00fcncellemeyi unutmayal\u0131m.<\/p>\n<p>\u015eimdi olu\u015fturmu\u015f oldu\u011fumuz bu yaml file&#8217;\u0131n\u0131, <em>CLI<\/em> \u00fczerinden a\u015fa\u011f\u0131daki gibi execute edelim ve deployment i\u015flemini ba\u015flatal\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">kubectl apply -f <em>deploy-to-aks.yaml<\/em><\/pre>\n<p>Ard\u0131ndan a\u015fa\u011f\u0131daki komut ile de ilgili pod&#8217;un, &#8220;<em>Running<\/em>&#8221; durumuna gelmesini bekleyelim. <em>AKS<\/em> ilgili container image&#8217;ini ilk kez \u00e7ekece\u011fi ve ilgili image size&#8217;\u0131 biraz b\u00fcy\u00fck oldu\u011fu i\u00e7in, bu i\u015flem birka\u00e7 dakika s\u00fcrebilir.<\/p>\n<pre class=\"lang:default decode:true \">kubectl get pods -w<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/deploy-to-aks.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3082 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/deploy-to-aks.jpg\" alt=\"\" width=\"690\" height=\"185\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/deploy-to-aks.jpg 690w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/deploy-to-aks-300x80.jpg 300w\" data-sizes=\"(max-width: 690px) 100vw, 690px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 690px; --smush-placeholder-aspect-ratio: 690\/185;\" \/><\/a><\/p>\n<p>Container &#8220;<em>Running<\/em>&#8221; status&#8217;\u00fcne ge\u00e7tikten sonra ise, container&#8217;\u0131n expose oldu\u011fu load-balancer <em>IP<\/em> adresini de a\u015fa\u011f\u0131daki komut vas\u0131tas\u0131yla al\u0131p, browser vas\u0131tas\u0131yla test edelim.<\/p>\n<pre class=\"lang:default decode:true\">kubectl get svc<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/kubectl-get-svc.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3084 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/kubectl-get-svc.jpg\" alt=\"\" width=\"690\" height=\"138\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/kubectl-get-svc.jpg 690w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/kubectl-get-svc-300x60.jpg 300w\" data-sizes=\"(max-width: 690px) 100vw, 690px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 690px; --smush-placeholder-aspect-ratio: 690\/138;\" \/><\/a><\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/01\/aks-svc-running.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3085 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/01\/aks-svc-running.jpg\" alt=\"\" width=\"921\" height=\"742\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/aks-svc-running.jpg 921w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/aks-svc-running-300x242.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/01\/aks-svc-running-768x619.jpg 768w\" data-sizes=\"(max-width: 921px) 100vw, 921px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 921px; --smush-placeholder-aspect-ratio: 921\/742;\" \/><\/a><\/p>\n<p>G\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi external <em>IP<\/em> adresi \u00fczerinden ba\u015far\u0131yla containerize etti\u011fimiz <strong>.NET Framework<\/strong> uygulamas\u0131na <em>AKS<\/em> \u00fczerinden eri\u015febildik.<\/p>\n<h2>Sonu\u00e7<\/h2>\n<p>Windows node \u00f6zelli\u011fi <em>AKS<\/em> i\u00e7in her ne kadar \u015fimdilik preview olsa da, san\u0131r\u0131m \u00f6n\u00fcm\u00fczdeki birka\u00e7 ay i\u00e7erisinde global available hale getirilmesi bekleniyor. Ayr\u0131ca k\u0131smi de olsa, <em>Microsoft<\/em> taraf\u0131ndan m\u00fc\u015fteri deste\u011fi de verilmektedir. Bence, eski uygulamalar\u0131m\u0131z\u0131 herhangi bir ekstra efor sarfetmeden containerize edebilmek i\u00e7in harika bir se\u00e7enek.<\/p>\n<h2>Referanslar<\/h2>\n<blockquote><p><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/windows-container-cli?WT.mc_id=AZ-MVP-5003382\"><em>https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/windows-container-cli?WT.mc_id=AZ-MVP-5003382<\/em><\/a><br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/mvc\/overview\/deployment\/docker-aspnetmvc?WT.mc_id=AZ-MVP-5003382\"><em>https:\/\/docs.microsoft.com\/en-us\/aspnet\/mvc\/overview\/deployment\/docker-aspnetmvc?WT.mc_id=AZ-MVP-5003382<\/em><\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>G\u00fcn\u00fcm\u00fcz teknoloji \u00e7a\u011f\u0131nda, \u00f6zellikle b\u00fcy\u00fck \u00f6l\u00e7ekli firmalar i\u00e7in uygulamalar\u0131 cloud ortam\u0131nda host etmenin ne kadar da \u00f6nemli oldu\u011funu hepimiz biliyoruz. Bir \u00e7ok anket verilerine g\u00f6re de, \u00f6zellikle ge\u00e7ti\u011fimiz 2 y\u0131l i\u00e7erisinde hem public hem de private cloud kullan\u0131m oranlar\u0131 olduk\u00e7a artm\u0131\u015f durumda. Ba\u015fl\u0131ca birka\u00e7 sebebi&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/migrate-existing-net-applications-to-azure-kubernetes-service\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">Mevcut .NET Uygulamalar\u0131n\u0131 Azure Kubernetes Service&#8217;e Migrate Etmek<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":3104,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,106,48,418,434],"tags":[549,537,550,322,440],"class_list":["post-3049","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","category-asp-net-mvc","category-asp-net-web-api","category-azure","category-containerizing","tag-net-framework","tag-azure-kubernetes-service","tag-cloud-migration","tag-docker","tag-kubernetes","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"tr","enabled_languages":["en","tr"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"tr":{"title":true,"content":true,"excerpt":false}}},"_links":{"self":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/3049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/comments?post=3049"}],"version-history":[{"count":5,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/3049\/revisions"}],"predecessor-version":[{"id":3110,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/3049\/revisions\/3110"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media\/3104"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=3049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=3049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=3049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}