Get up to 50% off on CKA, CKAD, CKS, KCNA, KCSA exams and courses!

Configure Projects with Global Network in OpenShift

We will have requirements, where customer need to configure multiple projects but they want pods inside those projects to communicate each other. Since each projects will have its own netnamespace , communication will not happen between them by default. We can easily achieve this cross-communication as below.

Check current netnamespace of the projects. You can see different ID’s as below.

# oc get netnamespace | grep myapp
myapp-test                750807
myapp-test-db             5402669
myapp-test-data           6503429

Let’s join the projects with join-projects option.

# oadm pod-network join-projects --to=myapp-test-db myapp-test myapp-test-data

Verify the ID’s again; you can see all got the same netnamespace ID as myapp-test-db

# oc get netnamespace | grep myapp
myapp-test                5402669
myapp-test-db             5402669
myapp-test-data           5402669

That’s all.

You can use isolate-projects option as below, to isolate project network.

# oc adm pod-network isolate-projects <project1> <project2>
Aneesh Mohan

Aneesh Mohan

System Engineer- Paas(Openshift) at T-Systems Malaysia |RHCE|Ansible|Openshift


Note

Disclaimer: The views expressed and the content shared in all published articles on this website are solely those of the respective authors, and they do not necessarily reflect the views of the author’s employer or the techbeatly platform. We strive to ensure the accuracy and validity of the content published on our website. However, we cannot guarantee the absolute correctness or completeness of the information provided. It is the responsibility of the readers and users of this website to verify the accuracy and appropriateness of any information or opinions expressed within the articles. If you come across any content that you believe to be incorrect or invalid, please contact us immediately so that we can address the issue promptly.

Share :

Related Posts

Play with Ansible Playbooks

Play with Ansible Playbooks

Plays are ordered set of tasks to execute against host selections from your inventory. A playbook is a file containing one or more plays.

Installing Python Modules in Disconnected Environments

Installing Python Modules in Disconnected Environments

Installing a python module or package (any applications) is very easy if you have internet connection and access to public repo or private repo.

Setup Vim editor for YAML, Ansible, Kubernetes, OpenShift

Setup Vim editor for YAML, Ansible, Kubernetes, OpenShift

Are you new to Vim and working with YAML files? This post is for you! If you’re already a Vim expert, feel free to skip this quick guide.