-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSDOCS#8394: Migrated the Networking topic for the Deploying your App…
…lication docs
- Loading branch information
1 parent
6409f00
commit 436bc89
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...perts-deploying-application/cloud-experts-deploying-application-networking.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
:_mod-docs-content-type: ASSEMBLY | ||
[id="cloud-experts-deploying-application-networking"] | ||
= Tutorial: Networking | ||
include::_attributes/attributes-openshift-dedicated.adoc[] | ||
:context: cloud-experts-deploying-application-networking | ||
|
||
toc::[] | ||
|
||
//rosaworkshop.io content metadata | ||
//Brought into ROSA product docs 2023-12-14 | ||
|
||
This tutorial shows how the OSToy app uses intra-cluster networking to separate functions by using microservices and visualize the scaling of pods. | ||
|
||
image::deploying-networking-arch.png[OSToy Diagram] | ||
|
||
The image shows there are at least 2 separate pods, each with its own service. One pod functions as the frontend web application with a service and a publicly accessible route. The other pod functions as the backend microservice with a service object so that the frontend pod can communicate with the microservice. This communication occurs across the pods if more than one. Therefore this microservice is not accessible from outside this cluster, or from other namespaces/projects if configured (due to OpenShift's network policy, xref:../../networking/openshift_network_security/network_policy/about-network-policy.adoc#about-network-policy[About network policy]. The sole purpose of this microservice is to serve internal web requests and return a JSON object containing the current hostname (which is the pod name) 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". | ||
|
||
== Networking types | ||
|
||
. Intra-cluster networking | ||
+ | ||
Click on *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. | ||
|
||
. Lookup internal IP address of the service | ||
+ | ||
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` which we created in the service definition of `ostoy-microservice.yaml` which can be seen here: | ||
+ | ||
[source,yaml] | ||
---- | ||
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` | ||
|
||
. IP address returned | ||
+ | ||
We will see an IP address returned. In our example it is `172.30.165.246`. This is the intra-cluster IP address; only accessible from within the cluster. | ||
+ | ||
image::deploying-networking-dns.png[OSToy DNS] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.