Bojan Delic
06/27/2024, 2:15 PMcerbos
gem and tried it with locally running Cerbos. Works fine. However, then trying to reach it while behind k8s ingres which is configured like in attached screenshot - I am getting following error:
irb(main):011> client = Cerbos::Client.new("<host>:443", tls: nil, on_validation_error: :raise)
irb(main):012> client.allow?(principal: {id: '<mailto:bojan@org.com|bojan@org.com>', roles: ['foo']}, resource: {id: 'foo', kind: 'bar'}, action: 'view')
/Users/bojan.delic/.local/share/mise/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/cerbos-0.9.0/lib/cerbos/client.rb:235:in `rescue in handle_errors': gRPC error 14: failed to connect to all addresses; last error: INTERNAL: ipv4:10.163.39.30:443: Trying to connect an http1.x server (Cerbos::Error::Unavailable)
/Users/bojan.delic/.local/share/mise/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/grpc-1.64.0-arm64-darwin/src/ruby/lib/grpc/generic/active_call.rb:29:in `check_status': 14:failed to connect to all addresses; last error: INTERNAL: ipv4:10.163.39.30:443: Trying to connect an http1.x server. debug_error_string:{UNKNOWN:Error received from peer {created_time:"2024-06-27T16:11:44.84836+02:00", grpc_status:14, grpc_message:"failed to connect to all addresses; last error: INTERNAL: ipv4:10.163.39.30:443: Trying to connect an http1.x server"}} (GRPC::Unavailable)
Now, this seems like something is not right with the network, but I am able to use grpcurl
to hit health endpoint on the same host:
❯ grpcurl <host>:443 grpc.health.v1.Health.Check
{
"status": "SERVING"
}
I am not sure what is happening here. Is there any guidance on setting this up? Also, is there maybe HTTP ruby client available? In addition to this problem with proxying GRPC, there is also a problem with GRPC requiring glibc, and I am using alpine base image.
I would appreciate any help.Charith (Cerbos)
client = Cerbos::Client.new("<host>:443", tls: Cerbos::TLS.new)
Andrew Haines (Cerbos)
gcompat
package: https://github.com/grpc/grpc/issues/25711#issuecomment-1825466108Bojan Delic
06/28/2024, 10:38 AMCerbos::TLS.new
, of course, but at that point there were probably some other problems in my infra setup. So, I reverted that and forgot to try again once infra problems were solved. Looks like classic PEBCAK on my end. Thanks @Charith (Cerbos)
Re glibc and alpine - this is an awesome tip in general, I did not know about gcompat
package. It seems to work as advertise. Thanks @Andrew Haines (Cerbos). TIL 🙂
You guys rock 🙂