DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Building Hybrid Multi-Cloud Event Mesh With Apache Camel and Kubernetes
  • Achieving Container High Availability in EKS, AKS, and RKS: A Comprehensive Guide
  • The State of Kubernetes: Self-Managed vs. Managed Platforms
  • Implementing a Self-Healing Infrastructure With Kubernetes and Prometheus

Trending

  • MySQL to PostgreSQL Database Migration: A Practical Case Study
  • Securing the Future: Best Practices for Privacy and Data Governance in LLMOps
  • Start Coding With Google Cloud Workstations
  • MCP Servers: The Technical Debt That Is Coming
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Pulling Images from External Container Registry to OpenShift Cluster via ImageStream

Pulling Images from External Container Registry to OpenShift Cluster via ImageStream

This brief article demonstrates how the OpenShift Container Platform enables you to pull third-party images using ImageStream.

By 
Rishab Aggarwal user avatar
Rishab Aggarwal
·
Apr. 22, 20 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
14.1K Views

Join the DZone community and get the full member experience.

Join For Free

OpenShift Container Platform can create containers using images from third-party registries. OpenShift Container Platform will fetch tags from the remote registry upon image stream creation, We can perform this action by fetching the tags with  oc import-image <stream>.

Reference architecture

Steps to Create Image Stream

1. For the  import-image  command to work, we created a pull secret for the Azure Container registry image stream.

Plain Text
 




x


 
1
$ oc create secret docker-registry <pull_secret_name> \
2
    --docker-server=<registry_server> \
3
    --docker-username=<user_name> \
4
    --docker-password=<password> \
5
    --docker-email=<email>


2. To use a secret for pulling images for pods, you must add the secret to your service account. The name of the service account in this example should match the name of the service account the pod uses; default is the default service account:

Plain Text
xxxxxxxxxx
1
 
1
# oc secrets link default <secret-name> --for=pull
2
# oc secrets link deployer <secret-name> --for=pull
Plain Text
xxxxxxxxxx
1
 
1
Note: Since we are pulling image from external container registry so we do not need builder service account for building the image.

3. Once we have the pull secret in place and is linked to pull images, we can use the  image stream to fetch the image tag for the local OCP cluster image registry:

Plain Text
 




x


 
1
# oc import-image <image-name-that-you-want-locally>:<tag> --from=<registry name>/<image-name-mentioned-in-container-registry>:<tag> --confirm --scheduled=true


4. Once the image stream is created, we need to create an application from it.

Plain Text
 




xxxxxxxxxx
1


 
1
# oc new-app <imagestream name> --name <application name>


5. We then need to expose service, that is, create a route.

Plain Text
 




xxxxxxxxxx
1


 
1
# oc expose service <service name>



Container cluster Plain text OpenShift

Opinions expressed by DZone contributors are their own.

Related

  • Building Hybrid Multi-Cloud Event Mesh With Apache Camel and Kubernetes
  • Achieving Container High Availability in EKS, AKS, and RKS: A Comprehensive Guide
  • The State of Kubernetes: Self-Managed vs. Managed Platforms
  • Implementing a Self-Healing Infrastructure With Kubernetes and Prometheus

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!