GRPC::Unavailable: 14:DNS resolution failed when trying to connect python server from ruby client all served on kubernates

1/17/2020

I have a Python server and Ruby client. Application was already working since more than a year. But now we are moving to a kubernates. After we moved everything we are receiving following error while we want to access some endpoint on server ..

GRPC::Unavailable: 14:DNS resolution failed when trying to connect python server from ruby client all served on kubernates

Since This module is not developed by me I don't have a lot idea about this and not sure what I am missing.following is the code where I want to connect to server ...

module CS
  class SD
    def initialize(csm_host: nil)
      @host = host.dup
      if @host.nil?
        @host = ENV['CSM_HOST'] || 'localhost:50051'
      end
      connect!
    end

    def connect!
      @stub = Cs::Csm::SD::Stub.new(@host, :this_channel_is_insecure)
    end

    def some_method(argsuments)
      request = Cs::Csm::SomeRequest.new(arguments)
      @stub.some_function(request)
    end

CSM_HOST is address of internal network load balancer where python server is running. Open ports are 50051

Please help me out to fix this issue.

By the way I am using AWS services for kubernates.

-- Surat Pyari
amazon-ecr
grpc
http2
kubernetes

0 Answers