Skip to content

Commit d7a96e8

Browse files
committed
Cloud NAT article
1 parent c657bc7 commit d7a96e8

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

CLOUDNAT.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In the [previous article](README.md) we told you about how to connect to MongoDB
66

77
MongoDB Atlas offers three methods of securing the network:
88

9-
![Options to secure network](images/access_options.png "Options")
9+
<img src="images/access_options.png">
1010

1111
1. `IP Access List` where you can manage static ip addresses of hosts that are allowed to connect to your database clusters. This is a very easy way to achieve the goal, especially if you want to connect a single VM (virtual machine) that has a static public IP. A good thing about this way is that you can use this setup with all tiers MongoDB Atlas offers, even with the smallest and free of charge `M0 Sandbox`.<br>
1212
However, if you have a kubernetes cluster with several nodes, this option is almost useless. First of all, nodes of the cluster must have public ip addresses - a setup that is normally not favoured for security reasons. Secondly, the public ip of a node in the cluster is most likely to be changed at some point, and therefore MongoDB Atlas might start to refuse connections from this node.<br>
@@ -20,7 +20,7 @@ So, our challenge was to whitelist a Google Kubernetes Engine (GKE) cluster in M
2020

2121
Our goal is to set up the GKE cluster so that it gets an IP address which is public and static. We use Cloud NAT for that:
2222

23-
![Big Picture](images/cloud-nat.png "Cloud NAT")
23+
<img src=images/cloud-nat.png>
2424

2525
Accordingly to this picture we are going to do following steps:
2626

@@ -81,12 +81,11 @@ my-cluster europe-west1-b 1.15.12-gke.20 35.234.XX.YY n1-standard-1 1.15.12
8181

8282
Now we would like to encourage you to go to the [Google Console](https://console.cloud.google.com) and to continue with Cloud NAT:
8383

84-
![Go to Cloud NAT](images/goto-cloud-nat.png "Cloud NAT on Google Console")
84+
<img src="images/goto-cloud-nat.png" width=300>
8585

8686
...and click on the button `Create NAT gateway`.
8787

88-
![Create Gateway](images/create-gateway.png "Create NAT gateway")
89-
88+
<img src="images/create-gateway.png" width=400>
9089

9190
You have to fill following fields out:
9291

@@ -97,25 +96,25 @@ You have to fill following fields out:
9796

9897
In the new form you just need to give a proper name for a router and click on `Create`:
9998

100-
![Create Router](images/create-router.png "Create the router")
99+
<img src="images/create-router.png" width=300>
101100

102101
Now you are back to the previous form and your router is already set up.<br>
103102

104103
The last step you have to do is to create a static ip address for our router. Change the selection of the field `NAT IP addresses` to `manual`, let the other fields like they are.
105104

106-
![Select NAT IP](images/select-nat-ip.png "Select NAT IP")
105+
<img src="images/select-nat-ip.png" width=350>
107106

108107
Again, in a new form you just have to input an alias for the static ip address you are going to reserve:
109108

110-
![Reserve static IP](images/reserve-static-ip.png "Reserve static IP")
109+
<img src="images/reserve-static-ip.png" width=300>
111110

112111
After several seconds your Cloud NAT gateway is ready to serve you!
113112

114113
## Whitelist the IP address on MongoDB Atlas
115114

116115
If you click on the newly created gateway, you will see its configuration in details.
117116

118-
![Gateway details](images/nat-details.png "Gateway details")
117+
<img src="images/nat-details.png" width=350>
119118

120119
`my-nat-ip` has the IP 34.78.85.15 in our case. This is the one that can be whitelisted under `IP Access List` on MongoDB Atlas.<br>
121120

0 commit comments

Comments
 (0)