Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubernetes vs openshift (routes and services)

I'm new to kubernetes and openshift (came from docker swarm world) and I'm having trouble with some of kubernetes and openshift documentation especially related to route and services. I was looking for how to expose a replica set of containers externally and I've found kubernetes documentation uses a service to expose the pod while openshift uses routes. can anyone explain to me the differences?

like image 590
tkyass Avatar asked Jun 13 '20 00:06

tkyass


People also ask

What is the difference between OpenShift and Kubernetes ingress?

So now in OpenShift we have a Route objects which do almost the same job as Ingress in Kubernetes. The main difference is that routes are implemented by good, old HAproxy that can be replaced by commercial solution based on F5 BIG-IP.

What is a route in OpenShift?

Each route consists of a route name (limited to 63 characters), service selector, and (optionally) security configuration. An OpenShift administrator can deploy routers in an OpenShift cluster, which enable routes created by developers to be used by external clients.

How to expose an OpenShift service to the outside world?

So to get HTTP (S) traffic from the outside to your Service, OpenShift uses Routes ( Ingress in other Kubernetes distributions): So to expose your application to the outside world, you typically create an internal Service using oc create service and then create a Route using oc expose:

What is the difference between K8s and OpenShift router?

The Router objects in OpenShift and Ingress in K8s almost perform identical jobs. The prominent contrast is that routes are implemented by good, old HAproxy that can be replaced by a commercial solution based on F5 BIG-IP.


1 Answers

There are only minor differences in tools being used. OpenShift is a Kubernetes distribution, this means it is a collection of opinionated pre-selected components. So for Ingress, OpenShift uses HAProxy to get (HTTP) traffic into the cluster. Other Kubernetes distributions maybe use the NGINX Ingress Controller or something similar.

So Services are used to loadbalance traffic inside the cluster. So when you create a ReplicaSet, you'll have multiple Pods running. To "talk" to these Pods, you typically create a Service. That Service will distribute the traffic evenly between your Pods.

So to get HTTP(S) traffic from the outside to your Service, OpenShift uses Routes (Ingress in other Kubernetes distributions):

                                            +-----+
                                        +-->+ Pod |
           +-------+       +---------+  |   +-----+
Traffic--->+ Route +------>+ Service +--+-->+ Pod |
           +-------+       +---------+  |   +-----+
                                        +-->+ Pod |
                                            +-----+

So to expose your application to the outside world, you typically create an internal Service using oc create service and then create a Route using oc expose:

# Create a new ClusterIP service named myservice
oc create service clusterip myservice --tcp=8080:8080
oc expose service myservice
like image 168
Simon Avatar answered Sep 29 '22 10:09

Simon