Skip to content

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

# 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>


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.

Systems Engineer | LinkedIn


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.