{"id":1610,"date":"2017-07-23T11:07:03","date_gmt":"2017-07-23T08:07:03","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=1610"},"modified":"2017-12-11T21:50:56","modified_gmt":"2017-12-11T18:50:56","slug":"asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/","title":{"rendered":"ASP.NET Core Serisi 03: RESTful API&#8217;\u0131 Containerize Edip Azure Container Service ile Kubernetes&#8217;e Deploy Etmek"},"content":{"rendered":"<p>Merhaba .NET Core severler.<\/p>\n<p>Daha \u00f6nce <strong>ASP.NET Core<\/strong> serisinin 1. b\u00f6l\u00fcm\u00fcnde bir <span style=\"text-decoration: underline;\"><em>RESTful API<\/em><\/span> geli\u015ftirip,\u00a0<em>Azure App Services<\/em>\u2019e deploy i\u015flemini ger\u00e7ekle\u015ftirmi\u015ftik. \u015eimdi bu 3. b\u00f6l\u00fcm\u00fcnde ise, daha \u00f6nce geli\u015ftirmi\u015f oldu\u011fumuz bu\u00a0<em>RESTful API<\/em>&#8216;\u0131, nas\u0131l containerize edebilece\u011fimizi ve ard\u0131ndan\u00a0<em>Azure Container Service<\/em> ile <em>Kubernetes<\/em>&#8216;e nas\u0131l deploy edebiliriz gibi konulara, \u00e7al\u0131\u015fmakta oldu\u011fum firmada\u00a0<strong>.NET Core<\/strong> transformation s\u00fcrecinde elde edebildi\u011fim tecr\u00fcbeler do\u011frultusunda de\u011finmeye \u00e7al\u0131\u015faca\u011f\u0131m.<\/p>\n<p>Konu ba\u015fl\u0131klar\u0131 s\u0131ras\u0131yla:<\/p>\n<ol>\n<li>Docker Image&#8217;i Olu\u015fturma ve Docker Hub \u00dczerine Push Etmek<\/li>\n<li>Azure Container Service Kullanarak Kubernetes Cluster&#8217;\u0131 Olu\u015fturmak\n<ol>\n<li>SSH RSA Public Key Olu\u015fturma<\/li>\n<li>Service Principal Client ID and Secret Olu\u015fturma<\/li>\n<li>Kubernetes Cluster&#8217;\u0131 Olu\u015fturma<\/li>\n<li>Kubernetes Cluster&#8217;\u0131na Ba\u011flanmak<\/li>\n<li>Kubernetes Cluster&#8217;\u0131 \u0130\u00e7erisindeki Bir Pod&#8217;da ASP.NET Core RESTful API&#8217;\u0131n\u0131 \u00c7al\u0131\u015ft\u0131rma<\/li>\n<li>Kubernetes Service ile Pod&#8217;u Expose Etmek<\/li>\n<li>Kubernetes Deployment Controller&#8217;\u0131 Olu\u015fturma ve Expose Etme<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1612 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg\" alt=\"\" width=\"750\" height=\"381\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg 750w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service-300x152.jpg 300w\" data-sizes=\"(max-width: 750px) 100vw, 750px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 750px; --smush-placeholder-aspect-ratio: 750\/381;\" \/><\/a><\/p>\n<blockquote><p><strong>NOT<\/strong>: Bu makale i\u00e7erisinde detayl\u0131 olarak\u00a0<em>Docker<\/em> nedir, neden ihtiya\u00e7 duyar\u0131z gibi konulara de\u011finmeyece\u011fim. Bu makale i\u00e7in\u00a0<em>Docker<\/em> hakk\u0131nda biraz bilgiye sahip olman\u0131z gerekmektedir.<\/p><\/blockquote>\n<p>Bildi\u011fimiz gibi container image&#8217;i\u00a0<strong>lightweight<\/strong>,\u00a0<strong>stand-alone<\/strong>\u00a0ve <strong>her an \u00e7al\u0131\u015fmaya haz\u0131r\u00a0<\/strong>application par\u00e7alar\u0131d\u0131r. Container&#8217;lar ile uygulamalar\u0131m\u0131z, ayn\u0131 infrastructure alt\u0131nda birbirlerinden izole bir \u015fekilde \u00a0\u00e7al\u0131\u015fabilmektedir. B\u00f6ylece development ve\u00a0staging ortam farkl\u0131l\u0131klar\u0131 birbirlerinden ayr\u0131labilece\u011fi i\u00e7in, olu\u015fabilecek\u00a0conflict&#8217;lerin azalt\u0131lmas\u0131na da yard\u0131mc\u0131 olmaktad\u0131r.<\/p>\n<p>Containerizing i\u015flemi i\u00e7in &#8220;<a href=\"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/\" target=\"_blank\" rel=\"noopener\"><em>ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services\u2019e Deploy<\/em><\/a>&#8221; isimli makale i\u00e7erisinde geli\u015ftirdi\u011fimiz \u00f6rnek projeyi kullanaca\u011f\u0131z. \u00d6rnek projeyi <em><a href=\"https:\/\/github.com\/GokGokalp\/aspnetcore-rest-api-with-dapper\" target=\"_blank\" rel=\"noopener\">GitHub<\/a><\/em> \u00fczerinden download edelim ve masa\u00fcst\u00fcne unzip i\u015flemini ger\u00e7ekle\u015ftirelim.<\/p>\n<h5>1. B\u00f6l\u00fcm &#8211; Docker Image&#8217;i Olu\u015fturma ve Docker Hub \u00dczerine Push Etmek<\/h5>\n<blockquote><p><strong>NOT<\/strong>: Ger\u00e7ekle\u015ftirece\u011fim i\u015flemler i\u00e7in, <em><strong>Windows<\/strong> <\/em>platformu \u00fczerinde <em><strong>DockerToolbox<\/strong> <\/em>kullanmaktay\u0131m.<\/p><\/blockquote>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/Containers_ProductDetail_Banner.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1621 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/Containers_ProductDetail_Banner.png\" alt=\"\" width=\"857\" height=\"150\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/Containers_ProductDetail_Banner.png 857w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/Containers_ProductDetail_Banner-300x53.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/Containers_ProductDetail_Banner-768x134.png 768w\" data-sizes=\"(max-width: 857px) 100vw, 857px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 857px; --smush-placeholder-aspect-ratio: 857\/150;\" \/><\/a><\/p>\n<p>Bu a\u015famada ilk olarak, bir image build edebilmemiz i\u00e7in unzip yapt\u0131\u011f\u0131m\u0131z projenin root dizininde, a\u015fa\u011f\u0131daki gibi bir <strong>Dockerfile<\/strong> olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">FROM microsoft\/aspnetcore:1.1\r\nENTRYPOINT [\"dotnet\", \"aspnetcore-rest-api-with-dapper.dll\"]\r\nARG source=.\r\nWORKDIR \/app\r\nEXPOSE 5000\r\nCOPY $source .<\/pre>\n<p>Dockerfile i\u00e7erisinde base olarak offical compiled <em>ASP.NET Core<\/em> image&#8217;ini kullanaca\u011f\u0131m\u0131z\u0131 ve &#8220;<em>5000<\/em>&#8221; port&#8217;u \u00fczerinden ise expose edece\u011fimizi tan\u0131mlad\u0131k. Entrypoint olarak ise, projeyi publish ettikten sonra elde edecek oldu\u011fumuz &#8220;<em>aspnetcore-rest-api-with-dapper.dll<\/em>&#8221; dosyas\u0131n\u0131 belirttik. \u00a0\u015eimdi projenin root dizinine herhangi bir command tool&#8217;u ile girelim ve projeyi a\u015fa\u011f\u0131daki gibi build edelim.<\/p>\n<pre class=\"lang:default decode:true\">dotnet build<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/dotnet-build.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1623 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/dotnet-build.jpg\" alt=\"\" width=\"746\" height=\"346\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/dotnet-build.jpg 746w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/dotnet-build-300x139.jpg 300w\" data-sizes=\"(max-width: 746px) 100vw, 746px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 746px; --smush-placeholder-aspect-ratio: 746\/346;\" \/><\/a><\/p>\n<blockquote><p><strong>NOT<\/strong>: &#8220;<em>dotnet restore<\/em>&#8221; komutu ile package&#8217;lar\u0131 restore etmeyi unutmay\u0131n.<\/p><\/blockquote>\n<p>Build i\u015fleminin ba\u015far\u0131yla ger\u00e7ekle\u015fmesinden sonra, a\u015fa\u011f\u0131daki komutu kullanarak projeyi publish edelim.<\/p>\n<pre class=\"lang:default decode:true \">dotnet publish -c release<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/dotnet-core-publish.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1625 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/dotnet-core-publish.jpg\" alt=\"\" width=\"818\" height=\"210\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/dotnet-core-publish.jpg 818w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/dotnet-core-publish-300x77.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/dotnet-core-publish-768x197.jpg 768w\" data-sizes=\"(max-width: 818px) 100vw, 818px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 818px; --smush-placeholder-aspect-ratio: 818\/210;\" \/><\/a><\/p>\n<p>Art\u0131k, publish i\u015fleminin ard\u0131ndan Dockerfile&#8217;\u0131 kullanarak bir image build edebiliriz. Image build edebilmemiz i\u00e7in a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131rmam\u0131z yeterli olacakt\u0131r.<\/p>\n<pre class=\"lang:default decode:true\">docker build bin\\Release\\netcoreapp1.1\\publish -t aspnetcorerestapionlinux<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/build-dockerfile-dotnet-core.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1626 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/build-dockerfile-dotnet-core.jpg\" alt=\"\" width=\"778\" height=\"516\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/build-dockerfile-dotnet-core.jpg 778w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/build-dockerfile-dotnet-core-300x199.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/build-dockerfile-dotnet-core-768x509.jpg 768w\" data-sizes=\"(max-width: 778px) 100vw, 778px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 778px; --smush-placeholder-aspect-ratio: 778\/516;\" \/><\/a><\/p>\n<p>Publish sonras\u0131 elde etti\u011fimiz &#8220;<em>bin\\Release\\netcoreapp1.1\\publish<\/em>&#8221; path&#8217;ini kullanarak, &#8220;<em>aspnetcorerestapionlinux<\/em>&#8221; isminde bir image build ettik. A\u015fa\u011f\u0131daki komutu kullanarak, olu\u015fturulan image&#8217;leri g\u00f6rebiliriz.<\/p>\n<pre class=\"lang:default decode:true \">docker images<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/docker-images.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1629 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/docker-images.jpg\" alt=\"\" width=\"762\" height=\"193\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/docker-images.jpg 762w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/docker-images-300x76.jpg 300w\" data-sizes=\"(max-width: 762px) 100vw, 762px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 762px; --smush-placeholder-aspect-ratio: 762\/193;\" \/><\/a><\/p>\n<p>Yukar\u0131daki resimde, &#8220;<em>aspnetcorerestapionlinux<\/em>&#8221; ismi ile image&#8217;in olu\u015ftu\u011funu g\u00f6rebiliriz.<\/p>\n<p>\u015eimdi, yapt\u0131\u011f\u0131m\u0131z i\u015flemlerin do\u011fru gitti\u011finden emin olabilmek i\u00e7in olu\u015fturmu\u015f oldu\u011fumuz image&#8217;i, bir container i\u00e7erisinde a\u015fa\u011f\u0131daki gibi \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true \">docker run -d -p 5000:5000 aspnetcorerestapionlinux<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-run.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1631 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-run.jpg\" alt=\"\" width=\"754\" height=\"142\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-run.jpg 754w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-run-300x56.jpg 300w\" data-sizes=\"(max-width: 754px) 100vw, 754px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 754px; --smush-placeholder-aspect-ratio: 754\/142;\" \/><\/a><\/p>\n<p>Olu\u015fturmu\u015f oldu\u011fumuz &#8220;<em>aspnetcorerestapionlinux<\/em>&#8221; image&#8217;ini, bir container i\u00e7erisinde &#8220;<em>5000<\/em>&#8221; port&#8217;u \u00fczerinden expose ederek \u00e7al\u0131\u015ft\u0131rd\u0131k. \u015eimdi browser \u00fczerinden &#8220;<em>http:\/\/192.168.99.100:5000\/swagger<\/em>&#8221; URL&#8217;ine girelim ve projenin \u00e7al\u0131\u015ft\u0131\u011f\u0131ndan emin olal\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/swagger-ui-on-docker.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1632 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/swagger-ui-on-docker.jpg\" alt=\"\" width=\"1002\" height=\"432\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/swagger-ui-on-docker.jpg 1002w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/swagger-ui-on-docker-300x129.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/swagger-ui-on-docker-768x331.jpg 768w\" data-sizes=\"(max-width: 1002px) 100vw, 1002px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1002px; --smush-placeholder-aspect-ratio: 1002\/432;\" \/><\/a><\/p>\n<p>Tadaa! Olu\u015fturmu\u015f oldu\u011fumuz image, container i\u00e7erisinde ba\u015far\u0131l\u0131 bir \u015fekilde \u00e7al\u0131\u015fmaktad\u0131r. Buraya kadar olan k\u0131s\u0131mda, <em>ASP.NET Core<\/em> ile geli\u015ftirmi\u015f oldu\u011fumuz RESTful bir API&#8217;\u0131n containerizing i\u015flemini tamamlad\u0131k.<\/p>\n<p>\u015eimdi ise olu\u015fturmu\u015f oldu\u011fumuz bu &#8220;<em>aspnetcorerestapionlinux<\/em>&#8221; image&#8217;ini,\u00a0<em>Docker Hub<\/em> \u00fczerine push edece\u011fiz. Bu sayede <em>Azure Container Service<\/em> i\u00e7erisinde bu image&#8217;i pull ederek, <em>Kubernetes<\/em> cluster&#8217;\u0131 i\u00e7erisinde \u00e7al\u0131\u015ft\u0131raca\u011f\u0131z. \u00d6ncelikle push i\u015flemini ger\u00e7ekle\u015ftirebilmemiz i\u00e7in, <em>Docker Hub<\/em> account&#8217;\u0131na sahip olmam\u0131z gerekmektedir. E\u011fer account&#8217;a sahip de\u011filsek, <em><a href=\"https:\/\/hub.docker.com\/\" target=\"_blank\" rel=\"noopener\">buradan<\/a><\/em> olu\u015fturabiliriz.<\/p>\n<p>\u0130lk olarak olu\u015fturmu\u015f oldu\u011fumuz image&#8217;e, a\u015fa\u011f\u0131daki gibi bir tag eklememiz gerekmektedir.<\/p>\n<pre class=\"lang:default decode:true \">docker tag aspnetcorerestapionlinux gokgokalp\/aspnetcorerestapionlinux<\/pre>\n<blockquote><p><strong>NOT<\/strong>: &#8220;<em>gokgokalp<\/em>&#8221; olan k\u0131sm\u0131, kendi <em>Docker Hub<\/em> kullan\u0131c\u0131 ad\u0131n\u0131z ile de\u011fi\u015ftirmeyi unutmay\u0131n.<\/p><\/blockquote>\n<p>\u015eimdi ise <em>Docker Hub<\/em> \u00fczerine login olmam\u0131z gerekmektedir.<\/p>\n<pre class=\"lang:default decode:true\">docker login<\/pre>\n<p>Login olma i\u015flemi ba\u015far\u0131yla ger\u00e7ekle\u015ftikten sonra a\u015fa\u011f\u0131daki gibi olu\u015fturmu\u015f oldu\u011fumuz image&#8217;i, <em>Docker Hub<\/em> \u00fczerine push edelim.<\/p>\n<pre class=\"lang:default decode:true \">docker push gokgokalp\/aspnetcorerestapionlinux<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-hub-push-image.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1636 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-hub-push-image.jpg\" alt=\"\" width=\"1388\" height=\"849\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-hub-push-image.jpg 1388w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-hub-push-image-300x184.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-hub-push-image-768x470.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/aspnet-core-docker-hub-push-image-1024x626.jpg 1024w\" data-sizes=\"(max-width: 1388px) 100vw, 1388px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1388px; --smush-placeholder-aspect-ratio: 1388\/849;\" \/><\/a><\/p>\n<h5>2. B\u00f6l\u00fcm &#8211; Azure Container Service Kullanarak Kubernetes Cluster&#8217;\u0131 Olu\u015fturmak<\/h5>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/azure-container-service.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1647 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/azure-container-service.jpg\" alt=\"\" width=\"700\" height=\"416\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-service.jpg 700w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-service-300x178.jpg 300w\" data-sizes=\"(max-width: 700px) 100vw, 700px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 700px; --smush-placeholder-aspect-ratio: 700\/416;\" \/><\/a><\/p>\n<p><em>Azure Container Service<\/em>,\u00a0containerize hale getirdi\u011fimiz uygulamalar i\u00e7in basit ve h\u0131zl\u0131 bir \u015fekilde sanal makineler olu\u015fturabilmemizi, yap\u0131land\u0131rabilmemizi ve cluster yap\u0131m\u0131z\u0131 y\u00f6netebilmemizi kolayla\u015ft\u0131rmak i\u00e7in \u00e7\u00f6z\u00fcmler sunmaktad\u0131r. <em>Microsoft<\/em>&#8216;un bir ka\u00e7 ay \u00f6nce\u00a0<em>Kubernetes<\/em> container\u00a0orchestration service&#8217;ini de tamamen available hale getirmesiyle beraber, efficiently bir \u015fekilde containerize edilmi\u015f uygulamalar\u0131m\u0131z\u0131 deploy ve on the fly olarak scale edebilmek kolay bir hal alm\u0131\u015ft\u0131r.<\/p>\n<p>\u015eimdi <em>Azure Container Service<\/em>&#8216;ini kullanarak, basic bir \u015fekilde <em>Kubernetes<\/em> cluster&#8217;\u0131 olu\u015fturaca\u011f\u0131z. Cluster olu\u015fturabilmek i\u00e7in \u00f6ncelikle a\u015fa\u011f\u0131daki maddelere ihtiya\u00e7 duymaktay\u0131z:<\/p>\n<ul>\n<li><strong>Azure subscription<\/strong> &#8211; &#8220;<a href=\"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/\" target=\"_blank\" rel=\"noopener\"><em>ASP.NET Core Serisi 01<\/em><\/a>&#8221; makalesinde, nas\u0131l elde edece\u011fimizden bahsetmi\u015ftim.<\/li>\n<li><strong>SSH RSA public key<\/strong> &#8211; Virtual machine&#8217;lere authenticate olabilmek i\u00e7in olu\u015fturmam\u0131z gerekmektedir.<\/li>\n<li><strong>Service Principal client ID and secret<\/strong> &#8211;\u00a0Orchestrator olarak <em>Kubernetes<\/em> kullanaca\u011f\u0131m\u0131z i\u00e7in &#8220;Azure Active Directory service principal client ID&#8221; ye ve &#8220;secret&#8221; a ihtiyac\u0131m\u0131z var.<\/li>\n<\/ul>\n<p>Haydi ozaman ba\u015flayal\u0131m.<\/p>\n<p><strong>2.1 SSH RSA Public Key Olu\u015fturma<\/strong><\/p>\n<blockquote><p><em>Windows<\/em> \u00fczerinde olu\u015fturabilmek i\u00e7in, <em>Git for Windows<\/em>&#8216;un kurulu olmas\u0131 gerekmektedir. E\u011fer kurulu de\u011filse:\u00a0<a href=\"https:\/\/git-for-windows.github.io\/\" target=\"_blank\" rel=\"noopener\"><em>https:\/\/git-for-windows.github.io\/<\/em><\/a><\/p><\/blockquote>\n<p><em>Git Bash<\/em>&#8216;i a\u00e7al\u0131m ve a\u015fa\u011f\u0131daki komut sat\u0131r\u0131 ile &#8220;<em>openssl.exe<\/em>&#8221; yi kullanarak, &#8220;<em>myPrivateKey<\/em>&#8221; ve &#8220;<em>myCert<\/em>&#8221;\u00a0certificate&#8217;ini olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">openssl.exe req -x509 -nodes -days 365 -newkey rsa:2048 \\-keyout myPrivateKey.key -out myCert.pem<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/ssh-rsa-public-key-create.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1656 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/ssh-rsa-public-key-create.jpg\" alt=\"\" width=\"721\" height=\"214\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/ssh-rsa-public-key-create.jpg 721w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/ssh-rsa-public-key-create-300x89.jpg 300w\" data-sizes=\"(max-width: 721px) 100vw, 721px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 721px; --smush-placeholder-aspect-ratio: 721\/214;\" \/><\/a><\/p>\n<p>Bu i\u015flem s\u0131ras\u0131nda size &#8220;Country Name, State, E-mail, Organization Name&#8221; gibi bir ka\u00e7 bilgi soracakt\u0131r. Gerekli bilgileri girdikten sonra,\u00a0&#8220;<em>myPrivateKey<\/em>&#8221; ve &#8220;<em>myCert<\/em>&#8221;\u00a0certificate&#8217;i, ilgili path alt\u0131nda olu\u015facakt\u0131r.<\/p>\n<p>\u015eimdi ise a\u015fa\u011f\u0131daki komutu kullanarak, olu\u015fturmu\u015f oldu\u011fumuz private key ile &#8220;<em>myPublicKey<\/em>&#8221; ad\u0131nda bir public key olu\u015fturaca\u011f\u0131z.<\/p>\n<pre class=\"lang:default decode:true\">openssl.exe rsa -pubout -in myPrivateKey.key -out myPublicKey.key<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/create-public-rsa-key.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1657 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/create-public-rsa-key.jpg\" alt=\"\" width=\"721\" height=\"70\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-public-rsa-key.jpg 721w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-public-rsa-key-300x29.jpg 300w\" data-sizes=\"(max-width: 721px) 100vw, 721px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 721px; --smush-placeholder-aspect-ratio: 721\/70;\" \/><\/a><\/p>\n<p><em>PuTTY<\/em> SSH client&#8217;\u0131n\u0131 kullanabilmemiz i\u00e7in, ek bir key daha olu\u015fturmam\u0131z gerekmektedir. Bunun i\u00e7in:ddddddd<\/p>\n<pre class=\"lang:default decode:true\">openssl rsa -in .\/myPrivateKey.key -out myPrivateKey_rsa<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/create-putty-private-key.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1658 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/create-putty-private-key.jpg\" alt=\"\" width=\"721\" height=\"70\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-putty-private-key.jpg 721w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-putty-private-key-300x29.jpg 300w\" data-sizes=\"(max-width: 721px) 100vw, 721px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 721px; --smush-placeholder-aspect-ratio: 721\/70;\" \/><\/a><\/p>\n<p>Bununla birlikte &#8220;<em>myPrivateKey_rsa<\/em>&#8221; isminde bir\u00a0private key daha elde ettik.<\/p>\n<p>\u015eimdi olu\u015fturmu\u015f oldu\u011fumuz bu &#8220;<em>myPrivateKey_rsa<\/em>&#8221;\u00a0key&#8217;ini kullanarak, <em>Azure<\/em> portal \u00fczerinde <em>Linux<\/em> VM yarat\u0131rken kullanaca\u011f\u0131m\u0131z public key&#8217;i olu\u015fturaca\u011f\u0131z. Bunun i\u00e7in \u00f6ncelikle <em><a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\" target=\"_blank\" rel=\"noopener\">buradan<\/a><\/em>,\u00a0<em>PuTTY<\/em>\u00a0&#8216;i indirelim ve kural\u0131m. Kurulum i\u015fleminin ard\u0131ndan &#8220;PuTTYgen&#8221; uygulamalas\u0131n\u0131 \u00e7al\u0131\u015ft\u0131ral\u0131m ve &#8220;Load&#8221; k\u0131sm\u0131ndan olu\u015fturmu\u015f oldu\u011fumuz\u00a0&#8220;<em>myPrivateKey_rsa<\/em>&#8221; key&#8217;ini se\u00e7elim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/save-public-key.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1661 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/save-public-key.png\" alt=\"\" width=\"480\" height=\"473\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/save-public-key.png 480w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/save-public-key-300x296.png 300w\" data-sizes=\"(max-width: 480px) 100vw, 480px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 480px; --smush-placeholder-aspect-ratio: 480\/473;\" \/><\/a><\/p>\n<p>Yukar\u0131daki resimde g\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi &#8220;ssh-rsa&#8221; prefix&#8217;i ile ba\u015flayan bir public key daha elde etmi\u015f olduk. Makalenin ilerleyen b\u00f6l\u00fcm\u00fcnde kullanabilmek i\u00e7in, bu key bilgisini de kaydedelim.<\/p>\n<p><strong>2.2\u00a0Service Principal Client ID and Secret Olu\u015fturma<\/strong><\/p>\n<p>Bu noktada <em>Azure AD (Active Directory)<\/em>\u00a0service principal olu\u015fturma i\u015flemini, portal \u00fczerindeki terminal&#8217;den<i>\u00a0<\/i>ger\u00e7ekle\u015ftirece\u011fiz. <em><a href=\"https:\/\/portal.azure.com\/\" target=\"_blank\" rel=\"noopener\">Azure portal<\/a><\/em>&#8216;a login olduktan sonra, sa\u011f \u00fcst men\u00fcde bulunan &#8220;<em>Cloud Shell<\/em>&#8221; i a\u00e7al\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/azure-cloud-shell.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1662 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/azure-cloud-shell.jpg\" alt=\"\" width=\"690\" height=\"82\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-cloud-shell.jpg 690w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-cloud-shell-300x36.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\/82;\" \/><\/a><\/p>\n<p>&#8220;<em>Cloud Shell<\/em>&#8221; i a\u00e7t\u0131ktan sonra, \u00f6ncelikle a\u015fa\u011f\u0131daki komut ile &#8220;<em>aspnetcore-test-restapi<\/em>&#8221; ad\u0131nda bir resource group olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">az group create -n \"aspnetcore-test-restapi\" -l \"westeurope\"<\/pre>\n<p>Resource group&#8217;u olu\u015fturman\u0131n ard\u0131ndan, a\u015fa\u011f\u0131daki komut i\u00e7erisindeki &#8220;<em>mySubscriptionID<\/em>&#8221; b\u00f6l\u00fcm\u00fcne kendi subscription ID bilgimizi girelim \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">az ad sp create-for-rbac --role=\"Contributor\" --scopes=\"\/subscriptions\/mySubscriptionID\/resourceGroups\/aspnetcore-test-restapi\"<\/pre>\n<p>Bu i\u015flemin ard\u0131ndan a\u015fa\u011f\u0131daki gibi bir output elde edece\u011fiz.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/service-principal-creds.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1664 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/service-principal-creds.png\" alt=\"\" width=\"773\" height=\"192\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/service-principal-creds.png 773w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/service-principal-creds-300x75.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/service-principal-creds-768x191.png 768w\" data-sizes=\"(max-width: 773px) 100vw, 773px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 773px; --smush-placeholder-aspect-ratio: 773\/192;\" \/><\/a><\/p>\n<p>Buradaki &#8220;appId&#8221; yi principal client ID olarak, &#8220;password&#8221; u ise secret olarak kullanaca\u011f\u0131z.<\/p>\n<p><strong>2.3 Kubernetes Cluster&#8217;\u0131 Olu\u015fturma<\/strong><\/p>\n<ol>\n<li><em><a href=\"https:\/\/portal.azure.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Azure portal<\/a><\/em>\u00a0\u00fczerine login olal\u0131m.<\/li>\n<li>Sol \u00fcst men\u00fcden \u201c<strong><em>New<\/em><\/strong>\u201d k\u0131sm\u0131na t\u0131klayal\u0131m.<\/li>\n<li>A\u00e7\u0131lan men\u00fcden a\u015fa\u011f\u0131daki gibi \u201c<em><strong>Containers &gt; Azure Container Service<\/strong><\/em>\u201d k\u0131sm\u0131n\u0131 se\u00e7elim.<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/07\/azure-container-portal.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1659 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/azure-container-portal.jpg\" alt=\"\" width=\"690\" height=\"758\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-portal.jpg 690w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-portal-273x300.jpg 273w\" data-sizes=\"(max-width: 690px) 100vw, 690px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 690px; --smush-placeholder-aspect-ratio: 690\/758;\" \/><br \/>\n<\/a><\/li>\n<li>&#8220;<em>Basics<\/em>&#8221; k\u0131sm\u0131nda, resource group alt\u0131ndaki &#8220;Use existing&#8221;\u00a0butonuna t\u0131klayal\u0131m ve daha \u00f6nce olu\u015fturmu\u015f oldu\u011fumuz resource group olan &#8220;<em>aspnetcore-test-restapi<\/em>&#8221; \u0131 se\u00e7elim ve di\u011fer alanlar\u0131 da a\u015fa\u011f\u0131daki gibi doldural\u0131m. (Sizler de kendinize uygun doldurabilirsiniz)<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/07\/azure-container-portal-22.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1730 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/azure-container-portal-22.jpg\" alt=\"\" width=\"687\" height=\"430\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-portal-22.jpg 687w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-portal-22-300x188.jpg 300w\" data-sizes=\"(max-width: 687px) 100vw, 687px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 687px; --smush-placeholder-aspect-ratio: 687\/430;\" \/><\/a><\/li>\n<li>\u015eimdi ise &#8220;<em>Master configuration<\/em>&#8221; k\u0131sm\u0131ndan orchestrator gibi \u00f6nemli bilgileri tan\u0131mlayaca\u011f\u0131z. &#8220;<em>Orchestrator<\/em>&#8221; olarak &#8220;<em>Kubernetes<\/em>&#8221; i se\u00e7elim ve ard\u0131ndan &#8220;<em>DNS name prefix<\/em>&#8221; gibi field&#8217;lar\u0131 a\u015fa\u011f\u0131daki gibi doldural\u0131m.<a href=\"\/wp-content\/uploads\/2017\/07\/master-azure-container-service.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1667 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/master-azure-container-service.jpg\" alt=\"\" width=\"1199\" height=\"587\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/master-azure-container-service.jpg 1199w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/master-azure-container-service-300x147.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/master-azure-container-service-768x376.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/master-azure-container-service-1024x501.jpg 1024w\" data-sizes=\"(max-width: 1199px) 100vw, 1199px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1199px; --smush-placeholder-aspect-ratio: 1199\/587;\" \/><\/a><br \/>\nDevam\u0131nda ise &#8220;<em>SSH public key<\/em>&#8221; ve &#8220;<em>Service principal<\/em>&#8221; b\u00f6l\u00fcmlerini yukar\u0131da elde etti\u011fimiz bilgiler do\u011frultusunda tamamlayal\u0131m.<\/li>\n<li>&#8220;<em>Agent configuration<\/em>&#8221; b\u00f6l\u00fcm\u00fc \u00fczerinden de demo oldu\u011fu i\u00e7in &#8220;<em>Agent count<\/em>&#8221; olarak &#8220;1&#8221; ve &#8220;<em>Standard DS2<\/em>&#8221; se\u00e7iyorum.<a href=\"\/wp-content\/uploads\/2017\/07\/agent-configuration.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1666 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/agent-configuration.jpg\" alt=\"\" width=\"1203\" height=\"701\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/agent-configuration.jpg 1203w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/agent-configuration-300x175.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/agent-configuration-768x448.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/agent-configuration-1024x597.jpg 1024w\" data-sizes=\"(max-width: 1203px) 100vw, 1203px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1203px; --smush-placeholder-aspect-ratio: 1203\/701;\" \/><\/a><\/li>\n<\/ol>\n<p>Art\u0131k bir <em>Kubernetes<\/em> cluster&#8217;\u0131na sahibiz.<\/p>\n<p><strong>2.4 Kubernetes Cluster&#8217;\u0131na Ba\u011flanmak<\/strong><\/p>\n<p>Local makinemizden <em>Kubernetes<\/em> cluster&#8217;\u0131na ba\u011flanabilmemiz i\u00e7in, &#8220;<em>kubectl<\/em>&#8221; i kurmam\u0131z gerekmektedir. Bunun i\u00e7in <em><a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/install-azure-cli\" target=\"_blank\" rel=\"noopener\">buradan<\/a><\/em>, ilgili i\u015fletim sistemimize g\u00f6re <em>Azure CLI<\/em>&#8216;\u0131 indirelim ve kural\u0131m. Kurulum i\u015fleminin ard\u0131ndan, command tool a\u00e7al\u0131m ve a\u015fa\u011f\u0131daki komut ile &#8220;<em>kubectl<\/em>&#8221; in kurulumunu ger\u00e7ekle\u015ftirelim.<\/p>\n<pre class=\"lang:default decode:true\">az acs kubernetes install-cli<\/pre>\n<h6><a href=\"\/wp-content\/uploads\/2017\/07\/kubectl-azure.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1670 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubectl-azure.jpg\" alt=\"\" width=\"1388\" height=\"298\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-azure.jpg 1388w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-azure-300x64.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-azure-768x165.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-azure-1024x220.jpg 1024w\" data-sizes=\"(max-width: 1388px) 100vw, 1388px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1388px; --smush-placeholder-aspect-ratio: 1388\/298;\" \/><\/a><\/h6>\n<p>\u015eimdi ise <em>Kubernetes<\/em> cluster configuration bilgilerini download etmemiz gerekmektedir. \u00d6ncelikle a\u015fa\u011f\u0131daki komut ile, portal bilgilerimizi kullanarak <em>Azure<\/em> \u00fczerine login olal\u0131m.<\/p>\n<pre class=\"lang:default decode:true \">az login<\/pre>\n<p>Login olduktan sonra, a\u015fa\u011f\u0131daki komut \u00fczerinde gerekli de\u011fi\u015fiklikleri yapal\u0131m ve \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">az acs kubernetes get-credentials --resource-group=aspnetcore-test-restapi --name=aspnetcore-container-service --ssh-key-file=C:\\Users\\GOKGOKALP\\myPrivateKey_rsa<\/pre>\n<p>Cluster configuration bilgilerinin ba\u015far\u0131yla download edildi\u011finden emin olabilmek i\u00e7in, a\u015fa\u011f\u0131daki komutu da \u00e7al\u0131\u015ft\u0131ral\u0131m ve node listesini g\u00f6relim.<\/p>\n<pre class=\"lang:default decode:true\">kubectl get nodes<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/kubectl-get-nodes.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1671 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubectl-get-nodes.jpg\" alt=\"\" width=\"1430\" height=\"443\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-get-nodes.jpg 1430w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-get-nodes-300x93.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-get-nodes-768x238.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubectl-get-nodes-1024x317.jpg 1024w\" data-sizes=\"(max-width: 1430px) 100vw, 1430px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1430px; --smush-placeholder-aspect-ratio: 1430\/443;\" \/><\/a><\/p>\n<p><strong>2.5 Kubernetes Cluster&#8217;\u0131 \u0130\u00e7erisindeki Bir Pod&#8217;da ASP.NET Core RESTful API&#8217;\u0131n\u0131 \u00c7al\u0131\u015ft\u0131rma<\/strong><\/p>\n<p>Dok\u00fcmantasyonunda da oldu\u011fu gibi, Pod&#8217;u tek bir c\u00fcmle ile tan\u0131mlamak gerekirse e\u011fer:<\/p>\n<blockquote><p><em>Kubernetes<\/em> i\u00e7erisindeki k\u00fc\u00e7\u00fck, deployable\u00a0computing birimleridir.<\/p><\/blockquote>\n<p>Pod, bir veya birden fazla application container&#8217;lar\u0131n\u0131 i\u00e7erebilmektedir. \u015eimdi\u00a0<em>Kubernetes<\/em> cluster&#8217;\u0131 i\u00e7erisinde bir pod olu\u015fturabilmemiz i\u00e7in, projenin root klas\u00f6r\u00fc alt\u0131nda &#8220;<em>aspnetcore-rest-api-pod.yaml<\/em>&#8221; ad\u0131nda a\u015fa\u011f\u0131daki gibi bir <em>YAML<\/em> file&#8217;\u0131 tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:yaml decode:true\">apiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n name: aspnetcore-restapi\r\n labels:\r\n   app: aspnetcore-restapi\r\nspec:\r\n containers:\r\n - name: aspnetcore-container\r\n   image: \"gokgokalp\/aspnetcorerestapionlinux\"\r\n   ports:\r\n   - containerPort: 5000<\/pre>\n<p>Yukar\u0131da tan\u0131mlam\u0131\u015f oldu\u011fumuz\u00a0<em>YAML<\/em> file&#8217;\u0131 i\u00e7erisindeki &#8220;<em>image<\/em>&#8221; k\u0131sm\u0131na, <em>Docker<\/em> repo&#8217;ya push yapt\u0131\u011f\u0131m\u0131z image&#8217;i belirtiyoruz. Hat\u0131rlarsak <em>API<\/em>&#8216;\u0131 container i\u00e7erisinde de &#8220;<em>5000<\/em>&#8221; port&#8217;u \u00fczerinden expose etmi\u015ftik.<\/p>\n<p>\u015eimdi a\u015fa\u011f\u0131daki komutu, projenin root dizini alt\u0131nda command tool&#8217;u \u00fczerinden \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">kubectl create -f aspnetcore-rest-api-pod.yaml<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/create-pod-kubernetes.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1673 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/create-pod-kubernetes.jpg\" alt=\"\" width=\"1276\" height=\"211\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-pod-kubernetes.jpg 1276w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-pod-kubernetes-300x50.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-pod-kubernetes-768x127.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/create-pod-kubernetes-1024x169.jpg 1024w\" data-sizes=\"(max-width: 1276px) 100vw, 1276px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1276px; --smush-placeholder-aspect-ratio: 1276\/211;\" \/><\/a><\/p>\n<p>G\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi pod&#8217;u ba\u015far\u0131yla olu\u015fturduk. \u015eimdi a\u015fa\u011f\u0131daki komut ile olu\u015fturmu\u015f oldu\u011fumuz pod&#8217;a bir bakal\u0131m.,<\/p>\n<pre class=\"lang:default decode:true\">kubectl get pods<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1674 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods.jpg\" alt=\"\" width=\"1276\" height=\"240\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods.jpg 1276w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods-300x56.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods-768x144.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods-1024x193.jpg 1024w\" data-sizes=\"(max-width: 1276px) 100vw, 1276px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1276px; --smush-placeholder-aspect-ratio: 1276\/240;\" \/><\/a><\/p>\n<p>Yukar\u0131daki resimde olu\u015fturmu\u015f oldu\u011fumuz <em>&#8220;aspnetcore-restapi&#8221;<\/em> pod&#8217;unun, &#8220;<em>running<\/em>&#8221; stat\u00fcs&#8217;\u00fcnde \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131 g\u00f6rebiliriz. Bu pod i\u00e7erisinde, demo projemiz olan ASP.NET Core RESTful API&#8217;\u0131 \u00e7al\u0131\u015fmaktad\u0131r. Art\u0131k yapmam\u0131z gereken tek \u015fey, bu pod&#8217;u d\u0131\u015far\u0131ya <em>Kubernetes Service<\/em> ile expose etmek olacakt\u0131r.<\/p>\n<p><strong>2.6 Kubernetes Service ile Pod&#8217;u Expose Etmek<\/strong><\/p>\n<p><em>Kubernetes Service<\/em>, logical pod&#8217;lar seti tan\u0131mlayabilmek ve policy&#8217;ler olu\u015fturabilmek i\u00e7in olan bir abstraction&#8217;d\u0131r. Detayl\u0131 bilgiye ise, <em><a href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/service\/\" target=\"_blank\" rel=\"noopener\">buradan<\/a><\/em> ula\u015fabilirsiniz.<\/p>\n<p>\u015eimdi <em>Kubernetes Service<\/em> i\u00e7in &#8220;<em>aspnetcore-rest-api-ks.yaml<\/em>&#8221; ad\u0131nda bir\u00a0<em>YAML<\/em> file daha olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:yaml decode:true\">apiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: aspnetcore-restapi-service\r\n  labels:\r\n   app: aspnetcore-restapi-service\r\nspec:\r\n  selector:\r\n    app: aspnetcore-restapi\r\n  ports:\r\n    - port: 80\r\n      targetPort: 5000\r\n      protocol: TCP\r\n  type: LoadBalancer<\/pre>\n<p>Yukar\u0131daki <em>YAML<\/em> file&#8217;\u0131 ile &#8220;<em>aspnetcore-restapi-service<\/em>&#8221; ad\u0131nda, target <em>TCP<\/em> port&#8217;u &#8220;<em>5000<\/em>&#8221; olan bir <em>Kubernetes Service<\/em>&#8216;i olu\u015fturaca\u011f\u0131z. Ayr\u0131ca &#8220;<em>selector<\/em>&#8221; k\u0131sm\u0131nda bulunan &#8220;<em>app: aspnetcore-restapi<\/em>&#8221; de\u011ferinin, olu\u015fturmu\u015f oldu\u011fumuz pod&#8217;un label&#8217;\u0131 ile ayn\u0131 oldu\u011funa dikkat edelim. \u015eimdi service&#8217;i olu\u015fturabilmek i\u00e7in, a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">kubectl create -f aspnetcore-rest-api-ks.yaml<\/pre>\n<p>Service olu\u015fturma i\u015fleminin ard\u0131ndan, a\u015fa\u011f\u0131daki komut ile de service listesine bir bakal\u0131m.<\/p>\n<pre class=\"lang:default decode:true \">kubectl get services<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/kubernetes-get-services-1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1688 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubernetes-get-services-1.jpg\" alt=\"\" width=\"754\" height=\"159\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-services-1.jpg 754w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-services-1-300x63.jpg 300w\" data-sizes=\"(max-width: 754px) 100vw, 754px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 754px; --smush-placeholder-aspect-ratio: 754\/159;\" \/><\/a><\/p>\n<p>Yukar\u0131daki resme dikkat edersek &#8220;<em>aspnetcore-restapi-service<\/em>&#8221; adl\u0131 service&#8217;in, otomatik olarak assign edilen &#8220;<em>52.232.119.105<\/em>&#8221; external <em>IP<\/em>&#8216;si ile expose oldu\u011funu g\u00f6rebiliriz.<\/p>\n<blockquote><p><strong>NOT<\/strong>:\u00a0<em>IP<\/em> assign edilme i\u015flemi, bir ka\u00e7 dakika s\u00fcrebilir.<\/p><\/blockquote>\n<p>Browser \u00fczerinden eri\u015fti\u011fimizde ise, a\u015fa\u011f\u0131daki gibi <em>Swagger UI<\/em> kar\u015f\u0131m\u0131za gelecektir.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/azure-container-service-docker-expose-2.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1691 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/azure-container-service-docker-expose-2.jpg\" alt=\"\" width=\"981\" height=\"433\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-service-docker-expose-2.jpg 981w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-service-docker-expose-2-300x132.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/azure-container-service-docker-expose-2-768x339.jpg 768w\" data-sizes=\"(max-width: 981px) 100vw, 981px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 981px; --smush-placeholder-aspect-ratio: 981\/433;\" \/><\/a><\/p>\n<p>\u015eimdi geriye sadece <em>Deployment Controller<\/em>&#8216;\u0131 olu\u015fturmak kald\u0131.<\/p>\n<p><strong>2.7 Kubernetes Deployment Controller&#8217;\u0131 Olu\u015fturma ve Expose Etme<\/strong><\/p>\n<p>Bu noktaya kadar <em>Azure Container Service<\/em>&#8216;i kullanarak bir <em>Kubernetes<\/em> cluster&#8217;\u0131 olu\u015fturduk ve i\u00e7erisinde RESTful API&#8217;\u0131m\u0131z\u0131n container&#8217;\u0131n\u0131n \u00e7al\u0131\u015ft\u0131\u011f\u0131 bir pod tan\u0131mlad\u0131k. Daha sonra bir <em>Kubernetes Service<\/em>&#8216;i tan\u0131mlayarak, <em>Load Balancer<\/em> ile &#8220;<em>80<\/em>&#8221; port&#8217;u \u00fczerinden d\u0131\u015far\u0131ya expose ettik.<\/p>\n<p>Buraya kadar her \u015fey yolunda. E\u011fer pod&#8217;larla ilgili <em><a href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/pod\/\" target=\"_blank\" rel=\"noopener\">buradan<\/a>\u00a0<\/em>&#8220;<em>Durability of pods (or lack thereof)<\/em>&#8221; ba\u015fl\u0131\u011f\u0131n\u0131 okursak: pod&#8217;lar\u0131n\u00a0<strong>durable<\/strong> entities olmad\u0131klar\u0131n\u0131 ve\u00a0<strong>scheduling failures<\/strong>, <strong>node failures<\/strong> gibi durumlarda yeniden kullan\u0131lamad\u0131klar\u0131n\u0131 g\u00f6rebiliriz. Buda demek oluyor ki ilgili pod \u00f6ld\u00fc\u011f\u00fcnde, ilgili service ula\u015f\u0131lamaz olacakt\u0131r. Production ready olup bu gibi durumlara maruz kalmamam\u0131z i\u00e7in, <em>Kubernetes Controller<\/em>&#8216;lar\u0131 kullanmal\u0131y\u0131z. <em>Kubernetes<\/em> i\u00e7erisinde,\u00a0<em>Deployments<\/em> ve\u00a0<em>Replication Controller<\/em> gibi controller&#8217;lar mevcuttur. Biz burada\u00a0<em>Replication Controller<\/em>&#8216;\u0131n yeni nesli olan <em>Deployments<\/em>&#8216;\u0131 kullanaca\u011f\u0131z. <em>Deployments<\/em>\u00a0genel olarak self-healing, rollout management, scaling gibi \u00f6nemli i\u015flemleri sa\u011flamaktad\u0131r.<\/p>\n<p>\u015eimdi, a\u015fa\u011f\u0131daki gibi &#8220;<em>aspnetcore-rest-api-deployment.yaml<\/em>&#8221; ad\u0131nda bir deployment <em>YAML<\/em> file&#8217;\u0131 tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:yaml decode:true\">apiVersion: extensions\/v1beta1\r\nkind: Deployment\r\nmetadata:\r\n  name: aspnetcore-restapi-deployment\r\nspec:\r\n  replicas: 3\r\n  selector:\r\n    matchLabels:\r\n      app: aspnetcore-restapi\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: aspnetcore-restapi\r\n    spec:\r\n      containers:\r\n      - name: aspnetcore-container\r\n        image: \"gokgokalp\/aspnetcorerestapionlinux\"\r\n        ports:\r\n        - containerPort: 5000<\/pre>\n<p>Dikkat edersek &#8220;<em>replicas<\/em>&#8221; b\u00f6l\u00fcm\u00fcn\u00fc &#8220;<em>3<\/em>&#8221; olarak tan\u0131mlad\u0131k ve ard\u0131ndan &#8220;<em>containers<\/em>&#8221; b\u00f6l\u00fcm\u00fc alt\u0131nda ise t\u0131pk\u0131 pod olu\u015fturma <em>YAML <\/em>file&#8217;\u0131nda\u00a0oldu\u011fu gibi, ilgili image bilgilerini ve port bilgilerini belirttik. Art\u0131k bu template do\u011frultusunda <em>Deployment<\/em>, scheduling failures ve node failures gibi durumlar kar\u015f\u0131s\u0131nda bizim i\u00e7in &#8220;<em>3<\/em>&#8221; adet replika&#8217;n\u0131n var oldu\u011fundan emin olacakt\u0131r.<\/p>\n<p>A\u015fa\u011f\u0131daki komut ile deployment&#8217;\u0131<i>\u00a0<\/i>olu\u015fturmadan \u00f6nce, daha \u00f6nce olu\u015fturmu\u015f oldu\u011fumuz &#8220;<em>aspnetcore-rest-api-pod.yaml<\/em>&#8221; pod&#8217;unu ve &#8220;<em>aspnetcore-rest-api-ks.yaml<\/em>&#8221; service&#8217;ini silelim.<\/p>\n<pre class=\"lang:default decode:true \">kubectl delete -f aspnetcore-rest-api-pod.yaml<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/pod-delete.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1684 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/pod-delete.jpg\" alt=\"\" width=\"746\" height=\"125\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/pod-delete.jpg 746w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/pod-delete-300x50.jpg 300w\" data-sizes=\"(max-width: 746px) 100vw, 746px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 746px; --smush-placeholder-aspect-ratio: 746\/125;\" \/><\/a><\/p>\n<pre class=\"lang:default decode:true \">kubectl delete -f aspnetcore-rest-api-ks.yaml<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/service-delete.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1685 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/service-delete.jpg\" alt=\"\" width=\"746\" height=\"125\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/service-delete.jpg 746w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/service-delete-300x50.jpg 300w\" data-sizes=\"(max-width: 746px) 100vw, 746px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 746px; --smush-placeholder-aspect-ratio: 746\/125;\" \/><\/a><\/p>\n<p>\u015eimdi deployment&#8217;\u0131 olu\u015fturabiliriz. Bunun i\u00e7in:<\/p>\n<pre class=\"lang:default decode:true \">kubectl create -f aspnetcore-rest-api-deployment.yaml<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/kubernetes-deployment-create.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1686 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubernetes-deployment-create.jpg\" alt=\"\" width=\"754\" height=\"125\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-deployment-create.jpg 754w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-deployment-create-300x50.jpg 300w\" data-sizes=\"(max-width: 754px) 100vw, 754px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 754px; --smush-placeholder-aspect-ratio: 754\/125;\" \/><\/a><\/p>\n<p>ve deployment olu\u015fmu\u015f durumda. Hemen olu\u015fan pod&#8217;lara bir bakal\u0131m:<\/p>\n<pre class=\"lang:default decode:true \">kubectl get pods<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods-1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1687 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods-1.jpg\" alt=\"\" width=\"754\" height=\"176\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods-1.jpg 754w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-get-pods-1-300x70.jpg 300w\" data-sizes=\"(max-width: 754px) 100vw, 754px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 754px; --smush-placeholder-aspect-ratio: 754\/176;\" \/><\/a><\/p>\n<p>Yukar\u0131da g\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi deployment, 3 adet &#8220;<em>running<\/em>&#8221; stat\u00fcs&#8217;\u00fcnde pod olu\u015fturmu\u015f durumdad\u0131r. Ayr\u0131ca deployment ile daha fazla y\u00fck\u00fc otomatik olarak scale edebilmekte m\u00fcmk\u00fcnd\u00fcr. Bunun i\u00e7in detayl\u0131 bilgiye, <em><a href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/controllers\/deployment\/#scaling-a-deployment\" target=\"_blank\" rel=\"noopener\">buradan<\/a><\/em> eri\u015febilirsiniz.<\/p>\n<p>\u015eimdi ise geriye kalan tek \u015fey, bir service olu\u015fturarak bu 3 pod&#8217;u d\u0131\u015far\u0131ya tekrardan expose etmek olacakt\u0131r. Bu i\u015flem i\u00e7in daha \u00f6nce kullanm\u0131\u015f oldu\u011fumuz &#8220;<em>aspnetcore-rest-api-ks.yaml<\/em>&#8221; file&#8217;\u0131n\u0131 tekrardan kullanaca\u011f\u0131z. Hat\u0131rlarsak deployment controller ile pod&#8217;lar\u0131 olu\u015fturabilmek i\u00e7in service&#8217;i silmi\u015ftik.<\/p>\n<pre class=\"lang:default decode:true\">apiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: aspnetcore-restapi-service\r\n  labels:\r\n   app: aspnetcore-restapi-service\r\nspec:\r\n  selector:\r\n    app: aspnetcore-restapi\r\n  ports:\r\n    - port: 80\r\n      targetPort: 5000\r\n      protocol: TCP\r\n  type: LoadBalancer<\/pre>\n<p>Bu service &#8220;<em>app: aspnetcore-restapi<\/em>&#8221; label&#8217;\u0131na sahip olan 3 pod&#8217;u, &#8220;<em>80<\/em>&#8221; port&#8217;u \u00fczerinden d\u0131\u015far\u0131ya expose edecektir.<\/p>\n<pre class=\"lang:default decode:true \">kubectl create -f aspnetcore-rest-api-ks.yaml<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/kubernetes-service-create.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1692 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubernetes-service-create.jpg\" alt=\"\" width=\"754\" height=\"125\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-service-create.jpg 754w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-service-create-300x50.jpg 300w\" data-sizes=\"(max-width: 754px) 100vw, 754px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 754px; --smush-placeholder-aspect-ratio: 754\/125;\" \/><\/a><\/p>\n<p>Sonunda haz\u0131r\u0131z. :) Yukar\u0131daki resimler g\u00f6rebildi\u011fimiz gibi bu 3 pod&#8217;u d\u0131\u015far\u0131ya bir <em>Load Balancer<\/em>\u00a0service&#8217;i ile expose ettik. Hangi endpoint&#8217;leri expose etti\u011fine bakmak gerekirse e\u011fer, a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131rmam\u0131z yeterli olacakt\u0131r.<\/p>\n<pre class=\"lang:default decode:true \">kubectl describe services aspnetcore-restapi-service<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/07\/kubernetes-describe-service.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1693 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/07\/kubernetes-describe-service.jpg\" alt=\"\" width=\"762\" height=\"465\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-describe-service.jpg 762w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/kubernetes-describe-service-300x183.jpg 300w\" data-sizes=\"(max-width: 762px) 100vw, 762px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 762px; --smush-placeholder-aspect-ratio: 762\/465;\" \/><\/a><\/p>\n<p>Yukar\u0131daki komutu \u00e7al\u0131\u015ft\u0131rman\u0131n ard\u0131ndan\u00a0<em>Load Balancer\u00a0<\/em>service&#8217;inin\u00a0&#8220;<em>10.244.1.7:5000<\/em>&#8220;, &#8220;<em>10.244.1.8:5000<\/em>&#8221; ve &#8220;<em>10.244.1.9:5000<\/em>&#8221; pod&#8217;lar\u0131n\u0131 &#8220;<em>http:\/\/52.232.119.105<\/em>&#8221; URL&#8217;i \u00fczerinden expose etti\u011fini g\u00f6rebiliriz.<\/p>\n<p>Biraz uzun bir makale oldu ama ger\u00e7ekten zevkli ve \u00f6nemli bir konu. \u015euan \u00e7al\u0131\u015fmakta oldu\u011fum firmada, baz\u0131 projeler i\u00e7in\u00a0<em>.NET Core<\/em> transformation&#8217;\u0131 ile birlikte\u00a0<em>Containerizing<\/em> ve <em>Kubernetes<\/em>\u00a0konular\u0131 \u00fczerinde yo\u011fun bir \u015fekilde \u00e7al\u0131\u015fmaktay\u0131m. Bu makale umar\u0131m ihtiyac\u0131 olanlara yard\u0131mc\u0131 olur.<\/p>\n<p>Bir sonraki .NET Core makale serisinde ise, Jenkins kullanarak\u00a0<strong>CI<\/strong> pipeline s\u00fcre\u00e7lerine nas\u0131l dahil edebiliriz konusunu ele almaya \u00e7al\u0131\u015faca\u011f\u0131m.<\/p>\n<p>Takip de kal\u0131n!<\/p>\n<p><em><a href=\"https:\/\/github.com\/GokGokalp\/containerizing-and-kubernetes-sample-files\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/GokGokalp\/containerizing-and-kubernetes-sample-files<\/a><\/em><\/p>\n<h6>Baz\u0131 Referanslar ve Kaynaklar<\/h6>\n<blockquote><p>https:\/\/github.com\/MicrosoftDocs\/azure-docs\/blob\/master\/articles\/container-service\/container-service-tutorial-kubernetes-prepare-app.md<br \/>\nhttps:\/\/github.com\/MicrosoftDocs\/azure-docs\/blob\/master\/articles\/container-service\/container-service-tutorial-kubernetes-prepare-acr.md<br \/>\nhttps:\/\/github.com\/MicrosoftDocs\/azure-docs\/blob\/master\/articles\/container-service\/container-service-tutorial-kubernetes-deploy-cluster.md<br \/>\nhttps:\/\/github.com\/MicrosoftDocs\/azure-docs\/blob\/master\/articles\/container-service\/container-service-tutorial-kubernetes-deploy-application.md<br \/>\nhttps:\/\/www.docker.com\/what-container<br \/>\nhttps:\/\/docs.microsoft.com\/tr-tr\/azure\/container-service\/container-service-intro<br \/>\nhttps:\/\/kubernetes.io\/docs\/concepts\/overview\/what-is-kubernetes<br \/>\nhttps:\/\/docs.microsoft.com\/en-us\/azure\/container-service\/container-service-deployment<br \/>\nhttps:\/\/docs.microsoft.com\/en-us\/azure\/virtual-machines\/linux\/ssh-from-windows<br \/>\nhttps:\/\/docs.microsoft.com\/en-us\/azure\/container-service\/container-service-kubernetes-walkthrough<br \/>\nhttp:\/\/www.c-sharpcorner.com\/blogs\/containerizing-a-net-core-application-using-docker-acs-and-kubernetespart-4<br \/>\nhttps:\/\/kubernetes.io\/docs\/concepts\/services-networking\/service\/<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Merhaba .NET Core severler. Daha \u00f6nce ASP.NET Core serisinin 1. b\u00f6l\u00fcm\u00fcnde bir RESTful API geli\u015ftirip,\u00a0Azure App Services\u2019e deploy i\u015flemini ger\u00e7ekle\u015ftirmi\u015ftik. \u015eimdi bu 3. b\u00f6l\u00fcm\u00fcnde ise, daha \u00f6nce geli\u015ftirmi\u015f oldu\u011fumuz bu\u00a0RESTful API&#8216;\u0131, nas\u0131l containerize edebilece\u011fimizi ve ard\u0131ndan\u00a0Azure Container Service ile Kubernetes&#8216;e nas\u0131l deploy edebiliriz gibi konulara,&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">ASP.NET Core Serisi 03: RESTful API&#8217;\u0131 Containerize Edip Azure Container Service ile Kubernetes&#8217;e Deploy Etmek<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":1612,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[417,418,434],"tags":[438,445,421,419,437,444,448,446,447,322,435,436,439,440,443,442,441],"class_list":["post-1610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net-core","category-azure","category-containerizing","tag-net-core-docker","tag-net-core-kubernetes","tag-asp-net-core-restful-api","tag-asp-net-core","tag-asp-net-core-docker","tag-asp-net-core-kubernetes","tag-asp-net-docker-image-build","tag-azure-container-service","tag-azure-container-service-kubernetes","tag-docker","tag-docker-image","tag-docker-image-build","tag-dotnet-docker","tag-kubernetes","tag-kubernetes-deployment","tag-kubernetes-kullanimi","tag-kubernetes-nedir","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}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ASP.NET Core Serisi 03: RESTful API&#039;\u0131 Containerize Edip Azure Container Service ile Kubernetes&#039;e Deploy Etmek - G\u00f6khan G\u00f6kalp<\/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:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET Core Serisi 03: RESTful API&#039;\u0131 Containerize Edip Azure Container Service ile Kubernetes&#039;e Deploy Etmek - G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/\" \/>\n<meta property=\"og:site_name\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-23T08:07:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-11T18:50:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"381\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"26 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/\"},\"author\":{\"name\":\"G\u00f6khan G\u00f6kalp\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"headline\":\"ASP.NET Core Serisi 03: RESTful API&#8217;\u0131 Containerize Edip Azure Container Service ile Kubernetes&#8217;e Deploy Etmek\",\"datePublished\":\"2017-07-23T08:07:03+00:00\",\"dateModified\":\"2017-12-11T18:50:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/\"},\"wordCount\":4890,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/asp.net-core-kubernetes-azure-cloud-service.jpg\",\"keywords\":[\".net core docker\",\".net core kubernetes\",\"asp net core restful api\",\"asp.net core\",\"asp.net core docker\",\"asp.net core kubernetes\",\"asp.net docker image build\",\"azure container service\",\"azure container service kubernetes\",\"docker\",\"docker image\",\"docker image build\",\"dotnet docker\",\"kubernetes\",\"kubernetes deployment\",\"kubernetes kullan\u0131m\u0131\",\"kubernetes nedir\"],\"articleSection\":[\"ASP.NET Core\",\"Azure\",\"Containerizing\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/\",\"name\":\"ASP.NET Core Serisi 03: RESTful API'\u0131 Containerize Edip Azure Container Service ile Kubernetes'e Deploy Etmek - G\u00f6khan G\u00f6kalp\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/asp.net-core-kubernetes-azure-cloud-service.jpg\",\"datePublished\":\"2017-07-23T08:07:03+00:00\",\"dateModified\":\"2017-12-11T18:50:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/asp.net-core-kubernetes-azure-cloud-service.jpg\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/asp.net-core-kubernetes-azure-cloud-service.jpg\",\"width\":750,\"height\":381},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET Core Series 03: Containerizing a RESTful API and Deploying to Kubernetes Using Azure Container Service\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"description\":\"C# &amp; Python lover\",\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gokhan-gokalp.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"pronouns\":\"he\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"caption\":\"G\u00f6khan G\u00f6kalp\"},\"logo\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\"},\"sameAs\":[\"https:\\\/\\\/gokhan-gokalp.com\"],\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/tr\\\/author\\\/gok-gokalp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASP.NET Core Serisi 03: RESTful API'\u0131 Containerize Edip Azure Container Service ile Kubernetes'e Deploy Etmek - G\u00f6khan G\u00f6kalp","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:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/","og_locale":"tr_TR","og_type":"article","og_title":"ASP.NET Core Serisi 03: RESTful API'\u0131 Containerize Edip Azure Container Service ile Kubernetes'e Deploy Etmek - G\u00f6khan G\u00f6kalp","og_url":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/","og_site_name":"G\u00f6khan G\u00f6kalp","article_published_time":"2017-07-23T08:07:03+00:00","article_modified_time":"2017-12-11T18:50:56+00:00","og_image":[{"width":750,"height":381,"url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg","type":"image\/jpeg"}],"author":"G\u00f6khan G\u00f6kalp","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"G\u00f6khan G\u00f6kalp","Tahmini okuma s\u00fcresi":"26 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#article","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/"},"author":{"name":"G\u00f6khan G\u00f6kalp","@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"headline":"ASP.NET Core Serisi 03: RESTful API&#8217;\u0131 Containerize Edip Azure Container Service ile Kubernetes&#8217;e Deploy Etmek","datePublished":"2017-07-23T08:07:03+00:00","dateModified":"2017-12-11T18:50:56+00:00","mainEntityOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/"},"wordCount":4890,"commentCount":2,"publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg","keywords":[".net core docker",".net core kubernetes","asp net core restful api","asp.net core","asp.net core docker","asp.net core kubernetes","asp.net docker image build","azure container service","azure container service kubernetes","docker","docker image","docker image build","dotnet docker","kubernetes","kubernetes deployment","kubernetes kullan\u0131m\u0131","kubernetes nedir"],"articleSection":["ASP.NET Core","Azure","Containerizing"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/","url":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/","name":"ASP.NET Core Serisi 03: RESTful API'\u0131 Containerize Edip Azure Container Service ile Kubernetes'e Deploy Etmek - G\u00f6khan G\u00f6kalp","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#primaryimage"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg","datePublished":"2017-07-23T08:07:03+00:00","dateModified":"2017-12-11T18:50:56+00:00","breadcrumb":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#primaryimage","url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/07\/asp.net-core-kubernetes-azure-cloud-service.jpg","width":750,"height":381},{"@type":"BreadcrumbList","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-03-restful-api-containerize-edip-azure-container-service-ile-kubernetese-deploy-etmek\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gokhan-gokalp.com\/"},{"@type":"ListItem","position":2,"name":"ASP.NET Core Series 03: Containerizing a RESTful API and Deploying to Kubernetes Using Azure Container Service"}]},{"@type":"WebSite","@id":"https:\/\/gokhan-gokalp.com\/#website","url":"https:\/\/gokhan-gokalp.com\/","name":"G\u00f6khan G\u00f6kalp","description":"C# &amp; Python lover","publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gokhan-gokalp.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe","name":"G\u00f6khan G\u00f6kalp","pronouns":"he","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","url":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","caption":"G\u00f6khan G\u00f6kalp"},"logo":{"@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659"},"sameAs":["https:\/\/gokhan-gokalp.com"],"url":"https:\/\/gokhan-gokalp.com\/tr\/author\/gok-gokalp\/"}]}},"_links":{"self":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1610","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=1610"}],"version-history":[{"count":75,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1610\/revisions"}],"predecessor-version":[{"id":2004,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1610\/revisions\/2004"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media\/1612"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=1610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=1610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=1610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}