How to deploy an application using Red Hat OpenShift Service on AWS

Learn how to deploy an application on a cluster using Red Hat OpenShift Service on AWS.

 

In this section we'll see how OSToy uses intra-cluster networking to separate functions by using microservices and visualizing the scaling of pods.

Diagram of intra-cluster networking
Figure 16. Diagram of intra cluster networking.

As can be seen in Figure 16, we have defined at least two separate pods, each with its own service. One is the frontend web application (with a service and a publicly accessible route); the other is the backend microservice with a service object so that the frontend pod can communicate with the microservice (across the pods if there are multiple). 

Therefore this microservice is not accessible from outside this cluster, or from other namespaces/projects if configured (due to the Red Hat OpenShift Service on AWS (ROSA) network policy, ovs-networkpolicy. The sole purpose of this microservice is to serve internal web requests and return a JSON object containing the current hostname (which is the podname) and a randomly generated color string. This color string is used to display a box with that color displayed in the tile titled "Intra-cluster Communication."

What will you learn?

  • Intra-cluster networking

What do you need before starting?

  • Successfully deployed application on an OpenShift Service on AWS cluster

Steps for networking between functions

  1. Click Networking in the left menu.
    • Review the networking configuration. The right tile titled "Hostname Lookup" illustrates how the service name created for a pod can be used to translate into an internal ClusterIP address.
  2. Enter the name of the microservice we created in the right tile ("Hostname Lookup") following the format of my-svc.my-namespace.svc.cluster.local. We created the microservice in the service definition of ostoy-microservice.yaml, which can be seen here:
apiVersion: v1
kind: Service
metadata:
  name: ostoy-microservice-svc
  labels:
    app: ostoy-microservice
spec:
  type: ClusterIP
  ports:
    - port: 8080
      targetPort: 8080
      protocol: TCP
  selector:
    app: ostoy-microservice
  • In this case, we will enter:
    ostoy-microservice-svc.ostoy.svc.cluster.local
  1. This returns an IP address. In our example shown in Figure 17, it is 172.30.165.246. This is the intra-cluster IP address which is only accessible from within the cluster.
How to find the intra-cluster IP address in OSToy
Figure 17. How to find the intra-cluster IP address in OSToy.

You are now ready to learn how to scale within your OpenShift Service on AWS cluster.

Get more support

More OpenShift resources

Previous resource
Configuring an application on a Red Hat OpenShift Service on AWS cluster
Next resource
Cluster cost optimization