{"id":9,"date":"2020-09-05T20:33:00","date_gmt":"2020-09-05T20:33:00","guid":{"rendered":"http:\/\/blog.firatyasar.com\/?p=9"},"modified":"2021-03-31T17:49:47","modified_gmt":"2021-03-31T17:49:47","slug":"aks-add-second-node-pool-on-different-subnet","status":"publish","type":"post","link":"https:\/\/blog.firatyasar.com\/?p=9","title":{"rendered":"AKS &#8211; Add second node pool on different subnet"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"945\" height=\"438\" src=\"\/wp-content\/uploads\/2021\/03\/1_eRd_vLThUJ3kcEp49CID4w.png\" alt=\"\" class=\"wp-image-22\" srcset=\"\/wp-content\/uploads\/2021\/03\/1_eRd_vLThUJ3kcEp49CID4w.png 945w, \/wp-content\/uploads\/2021\/03\/1_eRd_vLThUJ3kcEp49CID4w-300x139.png 300w, \/wp-content\/uploads\/2021\/03\/1_eRd_vLThUJ3kcEp49CID4w-768x356.png 768w, \/wp-content\/uploads\/2021\/03\/1_eRd_vLThUJ3kcEp49CID4w-660x306.png 660w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/figure>\n\n\n\n<p>Hi Guys,<\/p>\n\n\n\n<p>If you want to deploy a second nodepool on different subnet in same VNET, you can do it with preview feature. \ud83d\ude42<\/p>\n\n\n\n<p>You can find detaailed information about it using the link below. (Not detailed but enough \ud83d\ude42 )<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/use-multiple-node-pools\">https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/use-multiple-node-pools<\/a><\/p>\n\n\n\n<p>The preview feature has some limitation like ;<\/p>\n\n\n\n<ul><li>All subnets assigned to nodepools must belong to the same virtual network.<\/li><li>System pods must have access to all nodes in the cluster to provide critical functionality such as DNS resolution via coreDNS.<\/li><li>Assignment of a unique subnet per node pool is limited to Azure CNI during preview.<\/li><li>Using network policies with a unique subnet per node pool is not supported during preview.<\/li><\/ul>\n\n\n\n<p>The implementaion is so basic. All you have to do is follow the steps below.<\/p>\n\n\n\n<ul><li>Add a second subnet on the vnet that AKS deployed. The subnet must use same ip range with AKS subnet. If you add a different subnet and try to add second node pool on it, you face the issue like below.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"173\" src=\"\/wp-content\/uploads\/2021\/02\/image-1-1024x173.png\" alt=\"\" class=\"wp-image-11\" srcset=\"\/wp-content\/uploads\/2021\/02\/image-1-1024x173.png 1024w, \/wp-content\/uploads\/2021\/02\/image-1-300x51.png 300w, \/wp-content\/uploads\/2021\/02\/image-1-768x130.png 768w, \/wp-content\/uploads\/2021\/02\/image-1-1536x260.png 1536w, \/wp-content\/uploads\/2021\/02\/image-1-2048x346.png 2048w, \/wp-content\/uploads\/2021\/02\/image-1-660x112.png 660w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul><li>We need subnetid to use nodepool creation. So you can use this command to have it.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>az network vnet subnet show --name newSubnet --resource-group TEST-AKS-CLUSTER --vnet-name TEST-AKS-CLUSTER-vnet<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" src=\"\/wp-content\/uploads\/2021\/02\/image-2-1024x218.png\" alt=\"\" class=\"wp-image-12\" width=\"632\" height=\"134\" srcset=\"\/wp-content\/uploads\/2021\/02\/image-2-1024x218.png 1024w, \/wp-content\/uploads\/2021\/02\/image-2-300x64.png 300w, \/wp-content\/uploads\/2021\/02\/image-2-768x163.png 768w, \/wp-content\/uploads\/2021\/02\/image-2-660x140.png 660w, \/wp-content\/uploads\/2021\/02\/image-2.png 1278w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/figure>\n\n\n\n<ul><li>Finally, you can add the nodepool by running the nodepool add command as follows.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>az aks nodepool add \\\n    --resource-group TEST-AKS-CLUSTER \\\n    --cluster-name aks02 \\\n    --name prxypool \\\n    --node-count 1 \\\n    --node-vm-size standard_d2s_v3 \\\n    --vnet-subnet-id &lt;subnet id&gt;<\/code><\/pre>\n\n\n\n<p>After completing these processes sequentially, the new nodepool will be successfully added to a different subnet in vnet.<\/p>\n\n\n\n<p>I hope it has been a useful article. See you another one.<\/p>\n\n\n\n<p>Cheers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi Guys, If you want to deploy a second nodepool on different subnet in same VNET, you can do it with preview feature. \ud83d\ude42 You can find detaailed information about it using the link below. (Not detailed but enough \ud83d\ude42 ) https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/use-multiple-node-pools The preview feature has some limitation like ; All subnets assigned to nodepools\u2026 <span class=\"read-more\"><a href=\"https:\/\/blog.firatyasar.com\/?p=9\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[4,3,2],"_links":{"self":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts\/9"}],"collection":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":2,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":23,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions\/23"}],"wp:attachment":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}