Member-only story

Connecting GitHub Container Registry with Azure Red Hat OpenShift

GitHub Packages is a one-stop platform to host your packages. In this post, we will see how to push container images to GitHub packages and pull them from Azure Red Hat OpenShift

GitHub packages let you host your packages — be it container images, npm packages or NuGet packages. It is free for public repositories and has 500MB of free storage for private repositories.

In this quick post, we will see how to connect to GitHub packages to pull our container images and deploy the application in Azure Red Hat OpenShift.

Publishing image

I will skip this step for this post, but the documentation is clear and I followed the exact steps to publish a sample NodeJS application to the container registry.

Connecting GitHub container registry with ARO (Azure Red Hat OpenShift)

Kubernetes service connects to container registries using image pull secrets. ARO is no different, be it Azure Container Registry (ACR) or GitHub Container Registry, we will need to create a Kubernetes secret which has auth information for the Kubernetes to pull images.

We start by creating a manifest imperatively using CLI and get a YAML so that we can apply it.

kubectl create secret docker-registry github-cr-secret --docker-server=https://ghcr.io --docker-username=<username> --docker-password=$GH_PAT --docker-email=<email-address> --dry-run=client -o yaml > ./k8s/pullsecret.yml

GH_PAT is the environment variable which holds the classic GitHub PAT token with read/write and delete packages permission. You can follow this documentation if you need instructions on how to do it.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Utkarsh Shigihalli
Utkarsh Shigihalli

Written by Utkarsh Shigihalli

Microsoft MVP | Developer | Passionate about Cloud, .NET and DevOps

No responses yet

Write a response