0

I have created the below resources in GCP:

  • GKE
  • VPC and associated networks
  • dns zone

I have created a pod with node js app in the same.I have Kubernetes service of type load balancer exposed. when I try to curl into my service with the external IP created , I am able to get response.

Then I tried to map my Google external load balancer IP to 'A' record. When I try to access the same I get the error could not resolve host name

It would be great if I can get some help on the same.

Sunil
  • 553
  • 1
  • 12
  • 30
  • If you run nslookup or dig against your domain, do you get your lb up? Where are you testing from? – Patrick W Oct 27 '19 at 04:25
  • The service lb is purely layer 4, so as long as your domains resolves correctly, traffic will be sent to your pods – Patrick W Oct 27 '19 at 04:26
  • @PatrickW I have a run a dig and did not get any answer for my domain name question. All my networks settings seemed to be correct. When trying to use the external IP directly am able to reach the service – Sunil Oct 27 '19 at 12:48
  • If dig does not return anything, your dns is not set correctly. Can you provide some details about how you configured your nameservers – Patrick W Oct 27 '19 at 14:30

1 Answers1

-2

I understand that you have GKE, VPC and a DNS zone as resources in GCP. You have a pod with node js app, and you have exposed the Kubernetes service of load balancer type, which resolves successfully to the host. You have tried to map your Google external load balancer IP to ‘A’ record, but you are not able to resolve the host name. I will do my best to advise you.

Once you expose the workload to create a service, it creates an ip address exposed to the Internet that will access the application. Requests to that ip address will round robin across all the pods to balance the load accordingly.

As you mentioned that you can curl into your service with the external IP address but not with the domain, it seems to be an issue related with DNS. ‘A’ Record is used to point a logical domain name, such as "google.com", to the IP address of Google's hosting server, "74.125.224.147".

Before we proceed any further, please let me know the following details :

Please make sure A record is there on the Domain registrar and propagated.
Please let me know if the A records are actually resolving to the IP at all. ‘ whatsmydns.net ’ might be helpful to check this out. Please make sure A record is there and propagated.
If the A record is properly setup, please check that the A record properly resolves from the client machine, with nslookup or dig. To query domain ‘A’ record : dig example.com. In the output, you can see that example.com has an A record pointing to the IP address. Or, you can use nslookup example.com for the same. Please try to curl from another machine as well.

In case you are using Cloud DNS from GCP, please make sure the Cloud DNS is setup properly. You can go through the link :1 to create a new record. For information on managing records, please go to the link :2

I will be awaiting your reply. If you have any other questions or concerns about your issue, please do not hesitate to contact me by replying to this message. I will be happy to help.

  • Thanks Anurag. I shall troubleshoot once and surely get back to you – Sunil Oct 26 '19 at 02:59
  • 1
    This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/24419114) – Nick Oct 27 '19 at 08:22
  • 1
    @Nick look into the answer... its more than just blabla. In fact, serious pointer how to solve this issue and does not fit in a simple PM-chat that might take days and/or sinlge line commentary. Therefore, it was not worth to flag this answer as "not an answer". Please remove your comment. – ZF007 Oct 27 '19 at 10:15
  • 1
    @Anurag Sharma, you should once you both have it solved update your answer with new information for others to have handles how this was solved! – ZF007 Oct 27 '19 at 10:16
  • @ZF007, I disagree - and I see someone else has also flagged it. – Nick Oct 27 '19 at 12:24
  • @Nick... np, probably better to point SO "new commer" OP in the direction of posting some example code ;-) – ZF007 Oct 27 '19 at 12:27