Openshift - connecting pods between projects

7/20/2018

I'm having problems with a pod (running Keycloak) connecting to a database pod in another openshift project, on the same cluster.

Version Info

  • OpenShift Master: v1.5.1+7b451fc
  • Kubernetes Master: v1.5.2+43a9be4

Problem

In the Keycloak pod, the error I am getting is:

01:29:20,245 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 28) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "KeycloakDS")
]) - failure description: "WFLYCTL0211: Cannot resolve expression 'jdbc:postgresql://${env.POSTGRES_PORT_5432_TCP_ADDR}:${env.POSTGRES_PORT_5432_TCP_PORT:5432}/${env.POSTGRES_DATABASE:keycloak}'"

Troubleshooting

I have tried the following:

I've tried pinging from a pod in another project.

ping timescaledb.my-data-service.svc

and

ping timescaledb.my-data-service.svc.cluster.local

In both cases I get the following error:

From gateway (xx.xxx.0.1) icmp_seq=9 Destination Host Unreachable                                                                                                                      
-- Magick
kubernetes
openshift

1 Answer

7/20/2018

Service is not pingable, since it's iptables-based and not a real ip. You can test the service with command like curl $service:$port

-- Kun Li
Source: StackOverflow