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>

Disclaimer: The views expressed and the content shared are those of the author and do not reflect the views of the author’s employer or techbeatly platform.

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.