MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Openshift: How to update openshift with authentication of registry.redhat.io

An OpenShift cluster can only pull images from registry.redhat.io when its global pull secret, pull-secret in the openshift-config namespace, holds valid Red Hat credentials. The screenshots above show the Customer Portal side: creating a registry service account and copying its token. This page adds the oc commands that merge that token into the cluster pull secret from Linux, macOS or Windows, how to check that the change reached the nodes, and a working version of the test command.

URL – https://access.redhat.com/articles/RegistryAuthentication

Red Hat Registries table comparing access, login and token support for three container registries

Step 1 – Access – https://access.redhat.com/articles/RegistryAuthentication

Red Hat Container Registry Authentication article with Modifying Authentication Tokens link circled

Step 2 – https://access.redhat.com/terms-based-registry/accounts

Red Hat Registry Service Accounts page with New Service Account button and aro account highlighted

Step 3 – https://access.redhat.com/terms-based-registry/token/aro

Red Hat token information page for the aro service account showing username, token and Regenerate Token

Step 4 – Local pull-secret at openshift

OpenShift console Secrets list in openshift-config project with pull-secret highlighted

Step 5 –

OpenShift pull-secret details page with Actions menu open and Edit Secret highlighted

Step 6 –

OpenShift Edit Secret form adding registry.redhat.io credentials with username, password and email

How to test the new registry authentication

oc import-image test-registry-check 
  --from=registry.redhat.io/openshift4/ose-cli 
  --confirm -n openshiftCode language: JavaScript (javascript)
Terminal output of oc import-image showing test-registry-check imported from registry.redhat.io ose-cli

Why the global pull secret matters

Every node in an OpenShift 4 cluster pulls images using credentials from the secret pull-secret in the openshift-config namespace. The Machine Config Operator (MCO) copies that secret to each node as /var/lib/kubelet/config.json, and CRI-O uses that file when it pulls images. If the secret has no valid entry for registry.redhat.io, Red Hat images fail with ImagePullBackOff, Red Hat Operator catalogs in OperatorHub stay empty, and image stream imports fail.

This comes up often on clusters created without a Red Hat pull secret, such as Azure Red Hat OpenShift (ARO) clusters built without one, which is likely why the example above uses a token named aro. It also happens when a personal account's credentials are removed or a service account token is regenerated.

Note: Always merge the new credentials into the existing secret. Never replace it. On ARO, the secret also holds entries for Azure's own registries, and the cluster needs them to operate. Overwriting the whole secret can break upgrades and node image pulls.

Prerequisites

  • The oc CLI, logged in as a user with cluster-admin rights (oc whoami and oc auth can-i update secrets -n openshift-config should both succeed).
  • A Red Hat registry service account, created on the Customer Portal's Registry Service Accounts page as shown in steps 1 to 3 above. Its username has the form 1234567|account-name.
  • The token for that account, from the account's token page in the portal.
  • Optionally jq, to check that the edited JSON is still valid.

Check the credentials on your workstation before you touch the cluster. A typo in the username or token is the most common cause of failure later.

podman login registry.redhat.io --username '1234567|account-name'
# paste the token when prompted
# Expected: Login Succeeded!Code language: PHP (php)

Update the pull secret on Linux or macOS

These commands replace the missing steps 4 to 6 above. They follow the procedure Red Hat documents for updating the global cluster pull secret.

  1. Export the current pull secret to a local file.
  2. Add or update the registry.redhat.io entry in that file with oc registry login. Entries for other registries stay as they are.
  3. Check the JSON and write the file back to the cluster secret.
# 1. Export the existing secret
oc get secret/pull-secret -n openshift-config \
  --template='{{index .data ".dockerconfigjson" | base64decode}}' > pull-secret.json

# 2. Merge the Red Hat registry service account credentials
oc registry login --registry="registry.redhat.io" \
  --auth-basic='1234567|account-name:<TOKEN>' \
  --to=pull-secret.json

# 3. Validate and apply
jq '.auths | keys' pull-secret.json
oc set data secret/pull-secret -n openshift-config \
  --from-file=.dockerconfigjson=pull-secret.json

# 4. Remove the local copy (it contains every registry credential)
rm -f pull-secret.jsonCode language: PHP (php)

The jq output should list registry.redhat.io along with every registry that was there before, such as cloud.openshift.com, quay.io or Azure registry hosts. --auth-basic takes username:password. The service account username contains a pipe character, so keep the whole value in single quotes.

Update the pull secret from Windows PowerShell

Windows PowerShell 5.1, and PowerShell versions before 7.3, can strip the embedded double quotes from the --template argument, which breaks the export. oc extract avoids the problem because it writes the decoded secret straight to a file named .dockerconfigjson.

# Work in a scratch folder
New-Item -ItemType Directory -Force C:\temp\ps | Out-Null
Set-Location C:\temp\ps

# 1. Export the existing secret to .\.dockerconfigjson
oc extract secret/pull-secret -n openshift-config --to=. --confirm

# 2. Merge the Red Hat credentials
oc registry login --registry=registry.redhat.io `
  --auth-basic='1234567|account-name:<TOKEN>' `
  --to=.dockerconfigjson

# 3. Validate and apply
(Get-Content .\.dockerconfigjson -Raw | ConvertFrom-Json).auths.PSObject.Properties.Name
oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=.dockerconfigjson

# 4. Clean up
Remove-Item .\.dockerconfigjsonCode language: PHP (php)

In PowerShell the line-continuation character is the backtick (` “), not the backslash. For more on PowerShell syntax, see the PowerShell command line reference.

Note: You can also edit the secret in the web console: switch to the openshift-config project, open Workloads > Secrets > pull-secret, then choose Actions > Edit Secret. Add a new credential entry for registry.redhat.io and leave the existing entries unchanged.

Verify the rollout and test a pull

After the secret changes, the MCO writes the new file to every node. In current OpenShift 4 releases this update does not drain or reboot nodes. Wait until the machine config pools report UPDATED=True and UPDATING=False.

oc get mcp
# NAME     CONFIG          UPDATED   UPDATING   DEGRADED ...
# master   rendered-...    True      False      False
# worker   rendered-...    True      False      False

# Confirm a node received the new credentials (pick any node name)
oc debug node/<node-name> -- chroot /host \
  sh -c 'grep -c registry.redhat.io /var/lib/kubelet/config.json'

# Pull directly on the node with CRI-O's credentials
oc debug node/<node-name> -- chroot /host \
  podman pull --authfile /var/lib/kubelet/config.json registry.redhat.io/ubi9/ubi:latestCode language: PHP (php)

Use an image stream import to test at the API level. The fixed command from the example above appears in the next section. Running it in a scratch project keeps test objects out of the shared openshift namespace.

Corrected test command

The test command above is split across three lines without continuation characters. A shell runs each line as a separate command, so oc import-image fails with no source, and --from=... and --confirm fail as unknown commands. Here is the corrected version, run in a disposable project:

oc new-project registry-auth-test

oc import-image test-registry-check \
  --from=registry.redhat.io/ubi9/ubi:latest \
  --confirm -n registry-auth-test

# Success shows image metadata such as the digest and creation date.
oc get istag test-registry-check:latest -n registry-auth-test

# Clean up
oc delete project registry-auth-testCode language: PHP (php)

The ubi9/ubi:latest image always exists, so a failure means the credentials are the problem, not a missing tag. You can still test with openshift4/ose-cli as in the original, but add a tag that exists for your cluster version, for example :v4.16. On Windows, either put the command on one line or end each line with a backtick.

Common errors and fixes

SymptomLikely causeFix
unauthorized: Please login to the Red Hat Registry using your Customer Portal credentialsNo registry.redhat.io entry, or the nodes have not received it yetCheck the entry with oc extract, then wait for oc get mcp to show all pools updated
invalid username/passwordUsername is missing the numeric prefix, or the token was regeneratedCopy the username exactly (1234567|name) and the current token from the portal
Cluster operators degrade after the change; image pulls from Azure registries fail on AROThe secret was overwritten instead of mergedRestore the missing entries from a backup or from your platform's documented pull secret, then merge again
oc set data succeeds but pulls still failJSON became invalid during a manual editValidate with jq . pull-secret.json before applying
Machine config pool shows DEGRADED=TrueUnrelated MCO problem, or a node that cannot apply configRun oc describe mcp worker and check the machine-config-daemon pod logs on the affected node

Security and maintenance practices

  • Use a registry service account rather than a personal Customer Portal password. Service accounts can be revoked without locking a person out of their account.
  • Create a separate service account for each cluster or environment, so you can revoke one without affecting the others.
  • Regenerating a token in the portal invalidates the old one. Update every cluster that uses it right away, or new pulls will start failing.
  • Delete local copies of the pull secret after use. The file contains credentials for every registry the cluster uses.
  • Back up the current secret before changing it (oc get secret pull-secret -n openshift-config -o yaml > pull-secret-backup.yaml) and store the backup somewhere secure.

Frequently asked questions

Does updating the OpenShift global pull secret reboot the nodes?

In current OpenShift 4 releases, no. The Machine Config Operator writes the new /var/lib/kubelet/config.json to each node without draining or rebooting it. Use oc get mcp to confirm the rollout has finished.

Can I use my Red Hat Customer Portal username and password instead of a service account?

It works, but it is not recommended. A personal password stored in a cluster secret is hard to rotate and is tied to one person. A registry service account token can be revoked or regenerated on its own.

Why does registry.redhat.io require authentication when registry.access.redhat.com does not?

registry.redhat.io is Red Hat's authenticated registry and requires credentials for every pull. registry.access.redhat.com serves a limited set of content, such as UBI images, without authentication.

How do I add registry.redhat.io credentials to an ARO cluster?

Use the same process: export pull-secret from openshift-config, merge in the registry.redhat.io entry, and apply the file. Keep every existing entry, because ARO depends on its own registry credentials in the same secret.

Can I add the credentials to a single project instead of the whole cluster?

Yes. Create a docker-registry secret in that project with oc create secret docker-registry and link it to the service account with oc secrets link default <secret> --for=pull. Operator catalogs and cluster components still need the global pull secret.

Related tutorials

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Datadog Tutorials: How to Monitor Apache using Datadog in Windows

To monitor Apache on Windows with Datadog, you expose Apache's mod_status page on localhost, then point the Datadog Agent's built-in Apache check at http://localhost/server-status?auto. The steps above…

Read More

How to install Kapitan in Windows using wsl?

Kapitan is a Python-based configuration management tool, and on Windows it runs best inside the Windows Subsystem for Linux (WSL). This guide fills in the commands the…

Read More

Windows Troubleshooting: Administrator Guide

To find which ports are in use on Windows, use netstat -ano in Command Prompt, Get-NetTCPConnection and Get-NetUDPEndpoint in PowerShell, or the graphical tools Resource Monitor and…

Read More

OpenShift Lab 10: View Pod, Workload, and Namespace Performance Metrics Using the OpenShift Web Console

This lab uses the OpenShift web console to view CPU, memory, network and pod metrics for one namespace and its workloads. It then checks the same numbers…

Read More

Kubernetes: Pull an Image from a Private Registry using Yaml and Helm File

Kubernetes pulls images from a private registry using a kubernetes.io/dockerconfigjson Secret. A Pod references that Secret through imagePullSecrets, either directly or through its ServiceAccount. This page shows…

Read More

How to Install and Configure pre-commit on macOS, Windows, and Linux: Complete Step-by-Step Guide

SEO Title: How to Install and Configure pre-commit on Mac, Windows & Linux (2026) Meta Description: Learn how to install and configure pre-commit Git hooks on macOS,…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x