(EDITED) I want to connect a GKE pod to Atlas.
I have an Atlas db with a VPC peering connection set up to a GCP VPC Network. I am trying to apply things I learnt in these tuts:
Configuring VPC Network Peering
Controlling Access to VPC Networks
When I look at VPC network peering > Routes > Peering in the GCP console, I seeing automatically configured peering routes. I'm at a loss how to set one up or how to test the connection. I ping the atlas IP from my pod and it gets 100% packet loss, but then there are no routes so it shouldn't get through. I go to VM instances and SSH from my pod there, then run
docker run --rm busybox ping 192.168.0.0 -c 3
but, predictably, the result is the same.
From the gcloud shell I do:
gcloud compute firewall-rules list
and get:
NAME: allow-monolith-nodeport
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 1000
ALLOW: tcp:31000
DENY:
DISABLED: False
NAME: default-allow-icmp
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 65534
ALLOW: icmp
DENY:
DISABLED: False
NAME: default-allow-internal
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 65534
ALLOW: tcp:0-65535,udp:0-65535,icmp
DENY:
DISABLED: False
NAME: default-allow-rdp
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 65534
ALLOW: tcp:3389
DENY:
DISABLED: False
NAME: default-allow-ssh
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 65534
ALLOW: tcp:22
DENY:
DISABLED: False
NAME: gke-my-cluster-94435ead-all
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 1000
ALLOW: icmp,esp,ah,sctp,tcp,udp
DENY:
DISABLED: False
NAME: gke-my-cluster-94435ead-ssh
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 1000
ALLOW: tcp:22
DENY:
DISABLED: False
NAME: gke-my-cluster-94435ead-vms
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 1000
ALLOW: icmp,tcp:1-65535,udp:1-65535
DENY:
DISABLED: False
NAME: k8s-fw-l7--ca9214afee2f865d
NETWORK: default
DIRECTION: INGRESS
PRIORITY: 1000
ALLOW: tcp:30000-32767
DENY:
DISABLED: False
In GKE I have created a Service account with the Compute Network Admin role, but not sure how to link it to the VMs for my pods? I need this to change the firewall rules for the pod VMs - tho it would be better if I could just do it declarative from the pod/service manifest.
In Atlas I added the external IPs of my pod VMs to the Network Access IP Access List.
How can I set up VPC Network Peering between Mongodb Atlas and a GKE pod so when I ping the Atlas CIDR I get packets back?
****** EDIT *****
When following this tut atlas k8s peering tut I find I can't alter my k8s networking on GKE? Do I need to recreate the cluster from scratch?