<p>I have a Redis pod, and I expect connection requests to this pod from different clusters and applications not running in the cloud.
Since Redis does not work with the http protocol, accessing as the route I have done below does not work with this connection string &quot;<code>route-redis.local:6379</code>&quot;.</p>
<ul>
<li>route.yml</li>
</ul>
<pre><code>apiVersion: v1
kind: Route
metadata:
  name: redis
spec:
  host: route-redis.local
  to:
    kind: Service
    name: redis
</code></pre>
<ul>
<li><p>service.yml</p>
<pre><code> apiVersion: v1
 kind: Service
 metadata:
   name: redis
 spec:
   ports:
   - port: 6379
     targetPort: 6379
   selector:
     name: redis
</code></pre>
</li>
</ul>
<p>You may have encountered this situation. In short, is there any way to access to the redis pod via route? If not, how do you solve this problem?</p>

<p>You already discovered that Redis does not work via the HTTP protocol, which is correct as far as I know. Routes work by inspecting the HTTP Host header for each request, which will not work for Redis. This means that you will <strong>not be able to use Routes for non-HTTP workload</strong>.</p>
<p>Typically, such non-HTTP services are exposed via a <code>Service</code> and <code>NodePorts</code>. This means that each Worker Node that is part of your cluster will open this port and will forward the traffic to your application.</p>
<p>You can find more information in the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">Kubernetes documentation</a>:</p>
<blockquote>
<p>NodePort: Exposes the Service on each Node's IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created. You'll be able to contact the NodePort Service, from outside the cluster, by requesting :.</p>
</blockquote>
<p>You can define a NodePort like so (this example is for MySQL, which is also non-HTTP workload):</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: mysql
  labels:
    name: mysql
spec:
  type: NodePort
  ports:
    - port: 3306
      nodePort: 30036
      name: http
  selector:
    name: mysql
</code></pre>
<p>Of course, your administrator may limit the access to these ports, so it may or may not be possible to use these types of services on your OpenShift cluster.</p>
