<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ketan Joshi on Medium]]></title>
        <description><![CDATA[Stories by Ketan Joshi on Medium]]></description>
        <link>https://medium.com/@joshiketan?source=rss-7de25bcf2e71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2O32UaLUUM7jCw4dKuGfaw.jpeg</url>
            <title>Stories by Ketan Joshi on Medium</title>
            <link>https://medium.com/@joshiketan?source=rss-7de25bcf2e71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:44:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joshiketan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes Security using Network Policy]]></title>
            <link>https://blog.searce.com/kubernetes-security-using-network-policy-bbf94ccce69?source=rss-7de25bcf2e71------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbf94ccce69</guid>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ketan Joshi]]></dc:creator>
            <pubDate>Tue, 13 Jul 2021 11:00:06 GMT</pubDate>
            <atom:updated>2021-07-13T11:00:06.933Z</atom:updated>
            <content:encoded><![CDATA[<h4>This article focuses on how we can implement fine-grained restrictions to network communication within Kubernetes Engine and improve security.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kza7ppYsmfNeIrP_-p8LaQ.png" /></figure><h4>What is Network Policy?</h4><ul><li>We should consider using Kubernetes Network Policies for particular applications in your cluster <strong>control traffic flow</strong> at the IP address or port level.</li><li>Network Policies are an application-centric construct which allow you to <strong>specify how a pod is allowed to communicate</strong> with various network “entities”.</li><li><strong>Entity</strong> in this network can be a combination of the following 3 identifiers:</li></ul><p>1) Other pods</p><p>2) Namespaces</p><p>3) IP blocks</p><h4>Prerequisites</h4><ul><li>Network policies are <strong>implemented by the network plugin</strong>. A networking solution that supports Network Policy must be used in-order to make use of network policy in our cluster.</li><li>Creating a Network Policy resource without a controller implements that it will have no effect.</li><li>Works using Selector — eg. <strong>podSelector</strong> and <strong>namespaceSelector</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bAp1_qbqr_SPTegg" /></figure><p><strong>Network Plugin used — CALICO</strong></p><blockquote>Calico is a container networking solution created by Tigera which offers the functionality of implementing network policy.</blockquote><blockquote>It is an open source solution which helps by providing networking and network security for containers, VMs, and on-prem workloads.</blockquote><h3>Architecture Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/0*FqEoKvFiK40qFqsm" /><figcaption>Source: <a href="https://github.com/GoogleCloudPlatform/gke-network-policy-demo/blob/b11618e3427ee4739189f381e0f3c089e7ab9952/img/architecture.png">LINK</a></figcaption></figure><p>This entire architecture is created using terraform. You can find the terraform code to setup the above architecture <a href="https://github.com/GoogleCloudPlatform/gke-network-policy-demo/tree/master/terraform"><strong>HERE</strong></a></p><p>To enable the Network Policy feature use the CALICO provider in your <strong>main.tf</strong> file as follows:</p><pre>network_policy {<br>    enabled  = <strong>true</strong><br>    provider = &quot;<strong>CALICO</strong>&quot;<br>  }</pre><p>This will only inform the Kubernetes cluster that we are going to use network policy feature. We will need a NetworkPolicy controller where the actual policy or permissions will be defined.</p><p>To deploy the respective pods used in this demo please find the deployment files <a href="https://github.com/GoogleCloudPlatform/gke-network-policy-demo/tree/master/manifests/hello-app"><strong>HERE</strong></a></p><h4>Scenario 1:</h4><p>We have deployed 3 pods in this GKE cluster. One will be the ‘hello-server’ and two clients (one labelled as app=hello and other labelled as app=not-hello) which try to communicate to the hello-server.</p><p>Using Network policy we will try to allow one client and restrict the other from establishing connection with the server.</p><p>We make use of <strong>podSelector </strong>and<strong> labels</strong> as the selection criteria in this case:</p><pre>kind: NetworkPolicy<br>apiVersion: networking.k8s.io/v1<br>metadata:<br>  # Name the network policy<br>  name: hello-server-allow-from-hello-client<br>spec:<br><br>  # restrict access to these set of pods.<br>  policyTypes:<br>  - Ingress<br><br>  # Defines the set of pods to which this policy applies<br>  # In this case, we apply the policy to pods labelled as app=hello-server<br>  podSelector:<br>    matchLabels:<br>      app: hello-server<br><br>  # In this case, we allow ingress from all pods labelled as app=hello<br>  ingress:<br>  - from:<br>    - podSelector:<br>        matchLabels:<br>          app: hello</pre><p>By deploying this controller, we allow ingress from all pods labeled as app=hello.</p><p>As a result, we have restricted any pod not labelled as app=hello from communicating with the server.</p><h4>Scenario 2:</h4><p>In scenario 1, all the 3 pods were deployed in the same default namespace. Now, we have created a new namespace by the name ‘hello-apps’.</p><p>We have deployed the same two client pods in this new namespace. And now our aim is to allow ingress to the server pod from all pods belonging <strong>only</strong> to this new namespace.</p><p>As a result, the client pods present in the default namespace should be restricted from accessing the server. Basically, pods present in any other namespace will be refused connection to the server pod.</p><p>We make use of <strong>namespaceSelector </strong>and<strong> labels</strong> as the selection criteria in this case:</p><pre>kind: Namespace<br>apiVersion: v1<br>metadata:<br>  name: hello-apps<br>  labels:<br>    team: &quot;hello&quot;<br><br>---<br><br>kind: NetworkPolicy<br>apiVersion: networking.k8s.io/v1<br>metadata:<br>  # Name the network policy<br>  name: hello-server-allow-from-hello-client<br>spec:<br>  policyTypes:<br>  - Ingress<br><br>  podSelector:<br>    matchLabels:<br>      app: hello-server<br>      <br>  ingress:<br>  - from:<br>    - namespaceSelector:<br>        matchLabels:<br>          team: hello</pre><p>To deploy the two client pods, simply deploy the <strong>hello-client.yaml</strong> we used earlier again in this namespace.</p><p>As a result, we have restricted any pod not not belonging to this new namespace (i.e. hello-apps) from communicating with the server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbf94ccce69" width="1" height="1" alt=""><hr><p><a href="https://blog.searce.com/kubernetes-security-using-network-policy-bbf94ccce69">Kubernetes Security using Network Policy</a> was originally published in <a href="https://blog.searce.com/">Searce</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Cloud Architecture using VPN between GCP and AWS]]></title>
            <link>https://blog.searce.com/multi-cloud-architecture-using-vpn-between-gcp-and-aws-167a5e739079?source=rss-7de25bcf2e71------2</link>
            <guid isPermaLink="false">https://medium.com/p/167a5e739079</guid>
            <category><![CDATA[hybrid-cloud]]></category>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[multi-cloud]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Ketan Joshi]]></dc:creator>
            <pubDate>Tue, 18 May 2021 13:11:31 GMT</pubDate>
            <atom:updated>2021-05-18T14:57:23.955Z</atom:updated>
            <content:encoded><![CDATA[<h4>Here is a step-by-step guide to build a Multi-cloud architecture using GCP Cloud VPN and BGP dynamic routing.</h4><figure><img alt="This diagram depicts the VPN topology which help us in understanding the connection overview between AWS and GCP." src="https://cdn-images-1.medium.com/max/1024/1*c9i-p-CxGMnNYVuwOuwmNw.png" /><figcaption>Credit: <a href="https://www.linkedin.com/in/ketan-joshi-profile/">KETAN JOSHI</a></figcaption></figure><p><a href="https://www.vmware.com/topics/glossary/content/hybrid-cloud-vs-multi-cloud"><strong>Multi-cloud</strong> and <strong>Hybrid cloud</strong></a> strategies are adopted by organisations to deliver best in class IT solutions, to prevent themselves from being confined to a single cloud provider, or to take advantages of cloud arbitrage.</p><p>A <a href="https://en.wikipedia.org/wiki/Virtual_private_network">VPN</a> enables us to safely access the resources residing across multiple clouds using their private IP addresses over the internet. VPN forms encrypted tunnels between the VPN endpoints using <a href="https://en.wikipedia.org/wiki/IPsec">IPSec</a> protocol to secure the communication channel.</p><p>In this guide, we will use <a href="https://en.wikipedia.org/wiki/Border_Gateway_Protocol">BGP</a> (Border Gateway Protocol) dynamic routing, so that the BGP-advertised routes from your customer/peer gateway are automatically propagated to the route table when the status of this Site-to-Site VPN connection becomes UP and established.</p><p>We will create the following components in the same order to establish an end-to-end VPN connectivity between GCP and AWS:-</p><pre><strong>========<br> In GCP:<br>========<br></strong>Assuming we already have a VPC and a subnet present in GCP. If not, create a VPC and subnet which will be shared with AWS.</pre><pre><strong>(1)</strong> <strong>Reserve External IP</strong></pre><pre><strong>========<br> In AWS:<br>========</strong></pre><pre><strong>(2)</strong> <strong>Create VPC</strong> (private subnet + VPN)<br>    <strong>-</strong> Subnet<br>    <strong>-</strong> Customer Gateway - use the GCP reserved External IP as Customer Gateway IP.</pre><pre>Customer Gateway &amp; VPN are created in this step.</pre><pre><strong>(3)</strong> <strong>Download Configuration of the VPN</strong></pre><pre>Virtual Gateway and Tunnel details are generated automatically and are present in this configuration file.</pre><pre><strong>========<br> In GCP:<br>========</strong></pre><pre><strong>(4)</strong> <strong>Create classic VPN</strong></pre><pre><strong>-</strong> VPN Gateway (Use the GCP reserved External IP as Customer Gateway IP)<br>    <strong>-</strong> Tunnels - Remote Peer IP, IKE  <br>       <strong>=</strong> Cloud Router - Google ASN<br>       <strong>=</strong> BGP Session - Peer ASN, Cloud Router BGP IP, BGP Peer IP</pre><h3><strong>STEP 1:</strong> <strong>Reserve a Static IP Address in GCP</strong></h3><ul><li>Go to <strong>VPC network</strong> <strong>&gt;</strong> <strong>External IP Addresses</strong></li><li>Click on <strong>[RESERVE STATIC ADDRESS]</strong></li><li>Fill in the details as shown below for reference.</li><li>Click <strong>[RESERVE]</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5oz99okeTpRXbnkcoJpE7w.png" /></figure><ul><li>Go to the External IP Addresses console page.</li></ul><p><em>We should be able to see the assigned External IP Address as shown in the below snippet (IP address blurred on purpose).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Pf-rgkAPyIwLirneu8xfA.png" /></figure><h3>STEP 2: Configure a VPC on AWS side</h3><ul><li>Go to <strong>VPC dashboard</strong></li><li>Click on <strong>[Launch VPC Wizard]</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPMczM-MrVfvdVXemVZZRg.png" /></figure><ul><li>Select the VPC configuration — <strong>VPC with a Private Subnet Only &amp; Hardware VPN Access.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xaPTFmvkPAuWz9VUZFCAUg.png" /></figure><ul><li><strong>Create a subnet</strong> which we will share with GCP</li></ul><p><em>Resources in this subnet will be accessible from GCP over the VPN which we are creating.</em></p><ul><li>Fill in other details as per preference.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4d6oRIZJARd_cruE8GVWng.png" /></figure><ul><li>Click <strong>[Next] </strong>to configure VPN</li></ul><p><em>Here, we will need the GCP External IP that we reserved in the Step 1 for creating Customer Gateway. Use the GCP reserved External IP as Customer Gateway IP.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8lBaD0egSgbki_v6cflw4w.png" /></figure><ul><li>Fill in the other details and click <strong>[Create VPC]</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ewdfgZSjYJ6B80zWqbKXSA.png" /></figure><p><em>VPC is created successfully.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SB3v7GeO5GhrUlLYizzYug.png" /></figure><p><em>Once the VPC is created, we can select that VPC and see the Details tab as shown in the below snippet.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q_YAmg7qOoqoGDJnjb5yWg.png" /></figure><h3>STEP 3: Download the VPN connection details</h3><ul><li>Select the VPN and click on <strong>[Download Configuration]</strong></li></ul><pre>Select the options as given below:</pre><pre>- Vendor: Generic</pre><pre>- Platform: Generic</pre><pre>- Software: Vendor Agnostic</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lg8w7B3OY8Wmsc4u-ZSoew.png" /></figure><ul><li>Click <strong>[Download]</strong></li></ul><blockquote>NOTE: AWS provides 2 Tunnels for redundancy.</blockquote><p><em>Collect the </em><strong><em>IP addresses of the AWS Virtual Gateway</em></strong><em> and the </em><strong><em>Pre-shared keys</em></strong><em> used for IKE authentication that are </em><strong><em>automatically generated by AWS </em></strong><em>from this downloaded configuration file.</em></p><h3>STEP 4: Create Cloud VPN on GCP side</h3><ul><li>Go to <strong>Hybrid connectivity</strong> &gt; <strong>VPN</strong></li><li>Click on <strong>[Create a VPN]</strong></li><li>Select <strong>Classic VPN</strong> and click <strong>[CONTINUE]</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5L1kXGavKw-xjfhFeQ2UBw.png" /></figure><ul><li>Create VPN Gateway</li></ul><p><em>Fill in the Gateway details (use the External IP we reserved in Step 1) and VPC to be shared with AWS.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVdanY80pnVq9r7KH-fUmg.png" /></figure><ul><li>Now, scroll and enter the tunnels details.</li></ul><pre><strong>INFORMATION:</strong></pre><pre><em>We can obtain these details from the AWS configuration file we downloaded earlier.</em></pre><pre><em>The file is divided into 2 sections. Each section provides details about a single tunnel.</em></pre><pre><em>“Customer Gateway” refers to the GCP Cloud router side IP.</em></pre><p>We will use Tunnel 1 information first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VVMJ-V972HvLJAQKtVJ65g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*nce59J_4mgaJhur59UBDLA.png" /></figure><pre><strong>Note: </strong>Remote Peer IP Address is mentioned as Virtual Private Gateway.</pre><ul><li>Fill in the other details</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vxO6CklScwLbgTkvwF9FQQ.png" /></figure><ul><li>Scroll and create a new Cloud Router</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FN4L7-CUPL1aXQe56GIHgQ.png" /></figure><p><em>Google ASN can be found in the AWS Configuration file we downloaded earlier.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZIe4feIQOTS97uMpmJqTg.png" /></figure><pre><strong>Note: </strong>Google ASN is mentioned as Customer Gateway ASN.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7PwQ9iWlvZzHGyVcaXyY-g.png" /></figure><ul><li>Create a new BGP session</li></ul><p><em>Peer ASN can be found in the AWS Configuration file we downloaded earlier.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZIe4feIQOTS97uMpmJqTg.png" /></figure><pre><strong>Note:</strong> Peer ASN is mentioned as Virtual Private Gateway ASN.</pre><p><em>BGP IP’s can be found in the AWS Configuration file we downloaded earlier.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*zA79yYBnZG0Mn6q7MBBiAg.png" /></figure><pre><strong>Note:</strong> BGP session IP’s are mentioned as Inside IP Addresses.</pre><pre><strong>INFORMATION:</strong></pre><pre><em>BGP peers on a set of </em><strong><em>169.254.x.x</em></strong><em> link local addresses specified by the AWS configuration.</em></pre><ul><li>Fill in the details and click on <strong>[Save and continue] </strong>button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1I9TPjc_EEnClglJFG_5xw.png" /></figure><ul><li>Click <strong>[Done]</strong> for Tunnel 1</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJIhZoBEGgQWIol8HtotJg.png" /></figure><p><em>We can add another tunnel as well.</em></p><p><em>Details for another tunnel can be obtained from the same downloaded file under Tunnel 2 section.</em></p><ul><li>Click <strong>[Create] </strong>once all the tunnels are added.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88HwaomqU4D62qoRznfL4g.png" /></figure><h3>STEP 5: Validate the VPN tunnel status on both sides.</h3><blockquote><strong>GCP side</strong></blockquote><ul><li>Go to <strong>Cloud VPN Tunnels</strong></li><li>Check the <strong>VPN Tunnel status</strong> and <strong>BGP session status</strong> in GCP</li></ul><p><em>They should show </em><strong><em>Established </em></strong><em>status.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2SbMteZ5hCI7FIch3RExTw.png" /></figure><blockquote><strong>AWS Side</strong></blockquote><ul><li>Select the VPN and check the <strong>Tunnel Details</strong> Tab.</li></ul><p><em>The tunnels must show </em><strong><em>UP</em></strong><em> status.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*re7MPuqB1v9LBO2rjXmkyA.png" /></figure><p>Once the tunnels are UP and established in AWS and GCP respectively, the VPN is active and can be used for private communication between the subnets associated with the VPN endpoints.</p><pre><strong>Warning:</strong> Classic VPN is going to deprecate certain functionalities on Oct 31, 2021.</pre><pre>It is advised by Google cloud to migrate to HA VPN.</pre><p>References:</p><p><a href="https://cloud.google.com/network-connectivity/docs/vpn/concepts/classic-topologies">Classic VPN topologies | Google Cloud</a></p><p>In the next blog I will cover how we can set up a private connection between GCP and AWS using <a href="https://cloud.google.com/network-connectivity/docs/vpn/concepts/overview#ha-vpn">HA VPN</a> for high availability.</p><h3>Thank you for reading :)</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=167a5e739079" width="1" height="1" alt=""><hr><p><a href="https://blog.searce.com/multi-cloud-architecture-using-vpn-between-gcp-and-aws-167a5e739079">Multi-Cloud Architecture using VPN between GCP and AWS</a> was originally published in <a href="https://blog.searce.com/">Searce</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Networking in Google Cloud: Creating subnets in GCP]]></title>
            <link>https://blog.searce.com/networking-in-google-cloud-creating-subnets-in-gcp-d3d6df39dedc?source=rss-7de25bcf2e71------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3d6df39dedc</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[subnet]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Ketan Joshi]]></dc:creator>
            <pubDate>Sat, 08 May 2021 18:48:57 GMT</pubDate>
            <atom:updated>2021-05-12T06:44:47.587Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zhBkzXaLg5vKxa3ROjT3dA.jpeg" /></figure><blockquote>“One thing that everyone moving from AWS to GCP struggles the most is understanding creation and working of subnets in GCP.</blockquote><blockquote>I was no exception and felt very confused when I started with GCP. The challenge is to corelate the concept of subnets in both the cloud platforms.”</blockquote><blockquote>This blog is for the AWS professionals struggling to correlate the difference between AWS and GCP <a href="https://cloud.google.com/vpc/docs/vpc#vpc_networks_and_subnets">network</a> &amp; other beginner individuals who are looking to start with GCP.</blockquote><p>In GCP, we have no concept of creating a ‘Public’ or ‘Private’ subnet. That’s right, you will find no such option to launch a public or private subnet.</p><h3><strong>We can manually create a subnet in either of the 2 ways mentioned below:</strong></h3><h4><strong>1) Create the subnets while creating a </strong><a href="https://cloud.google.com/vpc/docs/vpc#subnet-ranges"><strong>VPC</strong></a><strong> itself</strong></h4><p>We may name the subnet whatever we want. For e.g., Naming it as ‘my-public-subnet’ will not make it public or naming it as ‘my-private-subnet’ will not make it private. It is just a name denoted to a network in GCP.</p><p>It can be seen in the screenshot below that the only details asked while creating subnets are Region and IP address range. There is no option or setting to make it as public or private.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6CkRcyzphqiJWJsqd0mJCg.png" /></figure><h4><strong>2) After the VPC is created, add a subnet to it.</strong></h4><p>Go to the VPC in which you wish to launch the subnets. Click on [ADD SUBNET] and fill in the details asked. Then click [ADD].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*Doy3-A6MCkGxhlcqFlGwkg.png" /></figure><p>You will only be able to create a subnet which is nothing more than a network inside a VPC. It has no attributes of private or public nature associated with itself on creation.</p><blockquote><strong>Then how can we make that network public or private in GCP?</strong></blockquote><p>The concept of Public and Private is applied at instance or resource level. It means, we can make a resource or instance private or public and not the subnet which it is hosted in.</p><blockquote><strong>So, can the same subnet have some public VM instances along with some private VM instances ?</strong></blockquote><p>Yes, it can! (It is advised that we keep these instances in separate subnets but yes, it is possible.)</p><blockquote><strong>Now, how to make an instance public or private?</strong></blockquote><p>The answer is as simple as it sounds — simply assign a public IP to the resource you want to make public. And do not assign a public IP to the resource you wish to make private.</p><blockquote>Note: Public IP is also known as External IP and Private IP is also known as Internal IP in GCP</blockquote><h3><strong>We can manually assign public IP in either of the 2 ways mentioned below:</strong></h3><h4><strong>1) While launching a VM instance</strong></h4><p>Go to the Create an instance option. There search for the network settings as seen below.</p><ul><li>Assigning a Primary internal IP will give the instance a <a href="https://cloud.google.com/compute/docs/ip-addresses#networkaddresses">Private IP</a></li><li>Assigning an External IP will give the instance a <a href="https://cloud.google.com/compute/docs/ip-addresses#externaladdresses">Public IP</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0njKLKNz-2iokTbszv2vVA.png" /></figure><h4><strong>2) We can edit the VM details for already existing private VM’s and assign an External IP</strong></h4><p>Go to the instance on which you wish to assign a public IP. Search for the Network interface setting as shown below.</p><p>Change the External IP configuration from None to either a custom Static IP or Ephemeral (Automatic) depending on the requirement to make the instance Public.</p><p>Then Click [Done] and [Save]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*4mVKBs6RhezkBKU4ExK5bw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3d6df39dedc" width="1" height="1" alt=""><hr><p><a href="https://blog.searce.com/networking-in-google-cloud-creating-subnets-in-gcp-d3d6df39dedc">Networking in Google Cloud: Creating subnets in GCP</a> was originally published in <a href="https://blog.searce.com/">Searce</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>