How To

How To List and Approve Pending CSR in OpenShift 4.x

This post contains affiliate links. If you buy through them, we may earn a small commission at no extra cost to you. Learn more.

A worker node that sits in NotReady after joining an OpenShift 4 cluster is almost always waiting on a certificate signing request. OpenShift raises them in two rounds per node. If you came for the openshift approve csr command, it is oc adm certificate approve. The oc commands cheat sheet below lists every command around it: listing, filtering, inspecting, approving one or all, denying a suspicious request, and the checks that confirm the node actually joined.

Original content from computingforgeeks.com - post 76299

The tables double as an openshift commands cheat sheet you can keep next to your terminal, and the whole sheet is a one-page PDF further down. Every command was run in November 2026 against a Rocky Linux 10 k3s cluster through the oc client, which speaks the same certificate API that OpenShift 4 uses. The places where OpenShift behaves differently are called out as such, and the exact outputs came from that cluster, so the shapes you see are the ones you will get.

The oc commands cheat sheet

Use these tables when you know the job but not the syntax. Every row is run further down with real output, and the one-page PDF is built from these same tables:

Connect and check the cluster

CommandWhat it does
oc versionClient and server versions
oc get nodesNodes and Ready state, where the stalled one shows
oc whoamiConfirm the kubeconfig user can approve
oc config current-contextConfirm you are pointed at the right cluster

List and filter CSRs

CommandWhat it does
oc get csrAll CSRs with age, requestor and condition
oc get csr | grep -i pendingOnly the ones waiting on you
oc get csr --watchLive view while a node bootstraps
oc get csr --field-selector spec.signerName=kubernetes.io/kubelet-servingOnly the serving-certificate requests

The signer name and requestor already print in the default oc get csr table, so -o wide adds nothing there; the field selector is the filter worth knowing.

Inspect a request

CommandWhat it does
oc describe csr NAMERequestor, signer, condition and events
oc get csr NAME -o jsonpath='{.spec.signerName}'Which signer it asks for
oc get csr NAME -o jsonpath='{.spec.username}'Who raised it
oc get csr NAME -o jsonpath='{.spec.request}' | base64 -d | openssl req -noout -subject -textDecode the PKCS#10 request

Approve and deny

CommandWhat it does
oc adm certificate approve NAMEApprove CSR OpenShift raised for a single node
oc adm certificate deny NAMEDeny one you do not trust
oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs --no-run-if-empty oc adm certificate approveApprove every pending one (Red Hat’s shipped form)
oc get csr -o json | jq -r '.items[] | select(.status.conditions == null or (.status.conditions|length==0)) | .metadata.name' | xargs --no-run-if-empty oc adm certificate approveSame job with jq, safe on modern status shapes

Verify the result

CommandWhat it does
oc get csr NAMECondition should read Approved,Issued
oc get nodes -wWatch the new node flip to Ready
oc get coCluster Operators back to available (OpenShift only)

The tables above are the whole workflow. The rest of this page runs each command against a live cluster, because the output is where the decisions are: which request to trust, which round you are in, and why a node still refuses to go Ready.

List the pending CSRs

Start from a bastion or admin workstation where the oc client is installed and a kubeconfig for the cluster is loaded. oc get csr prints every certificate signing request with its age, the account that raised it and its condition. A Pending condition means the API server has not signed it. Nothing proceeds until a human or an approver acts:

oc get csr listing pending certificate signing requests with signer names

During a normal install the list fills with rows from system:serviceaccount:openshift-machine-config-operator:node-bootstrapper, which is the machine-config operator raising client certificates on behalf of new nodes. A CSR from an account you do not recognize is worth a second look before you approve it, which we cover further down. In the lab captures on this page the requestor reads system:admin because the test requests were raised by hand with the admin kubeconfig, so a real install shows the node-bootstrapper account where ours shows that one. To cut the noise and show only the ones waiting on you, filter the condition column:

oc get csr piped through grep to show only pending CSRs

Keep a second terminal on oc get csr --watch while the nodes bootstrap, because new requests appear in waves and a node can raise its serving certificate while you are still approving the first round.

Approve a single CSR

Once the requestor checks out, approve it by name. The command updates the approval subresource on the certificate object, and the cluster’s signer issues the certificate straight after:

oc adm certificate approve approving one pending CSR

Confirm the condition flipped. An approved and issued request prints Approved,Issued. The API server garbage-collects it about an hour after the approval lands, on an hourly sweep, so an empty list after approval is normal and not a failure. Running the approve command again on an already approved request is a silent no-op that prints the same line once more. An error only appears when the request carries the opposite decision, which fails with certificate signing request "NAME" is already Denied:

oc get csr showing Approved,Issued condition after approval

The Denied row next to it is a request we rejected on purpose, and the cleaner removes it on the same hourly sweep, so neither state lingers in the list for long.

Approve every pending CSR

During a cluster install you will face a dozen or more requests at once, and approving them one by one wastes the time the nodes spend waiting. Red Hat’s documented one-liner lists the names of every CSR whose status is still empty and pipes them into the approve command; the --no-run-if-empty flag keeps xargs from calling the API when nothing is pending:

oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | xargs --no-run-if-empty oc adm certificate approve

Run it with one request left pending and it clears the queue with a single confirmation line:

Red Hat go-template one-liner approving every pending CSR

The go-template works because a pending request has an empty status struct. Go templates treat that as false, while an approved request carries conditions and drops out of the list. If you prefer jq, do not copy the older select(.status == {}) form you will find in older guides. It keys on the whole status object rather than the conditions array, and the shape of an empty status is not guaranteed across API versions. Filter on the conditions array instead:

oc get csr -o json | jq -r '.items[] | select(.status.conditions == null or (.status.conditions|length==0)) | .metadata.name' | xargs --no-run-if-empty oc adm certificate approve

The jq form selects on the same emptiness and prints the names it is about to approve, then hands them to the same approve command:

jq one-liner approving pending Kubernetes CSRs

Both forms print one confirmation line per approved request. If a second wave of requests appears a minute later, that is the serving-certificate round arriving, not a loop; run the same command again.

Read what the CSR is asking for

Approving a CSR signs a certificate, so it pays to know what you are signing. oc describe shows the account, the signer and the condition, which is enough for the routine node-bootstrapper requests:

oc describe csr showing requestor, signer, status and subject

The request itself is a base64-encoded PKCS#10 blob under .spec.request. Piping it through base64 -d and openssl shows the subject and, more importantly for a serving certificate, the DNS and IP subject alternative names it wants on the certificate:

CSR request decoded with base64 and openssl showing the PKCS#10 subject

For a kubelet serving certificate you should see the node’s own hostnames and addresses in the SAN list. A request whose SANs name other machines, or whose username is not a node or the node-bootstrapper service account, is the case where oc adm certificate deny earns its place. Denial records the decision on the object and stops the signer from issuing; the requester has to submit a fresh request.

The two certificate rounds on a new node

OpenShift raises two CSRs per new machine in the normal case, in order. Knowing which round you are in explains most of the confusion around bootstrapping, because the two requests come from different accounts and ask for different signers:

  • Client certificate first, requested by system:serviceaccount:openshift-machine-config-operator:node-bootstrapper for the kubernetes.io/kube-apiserver-client-kubelet signer. The kubelet needs it to authenticate to the API server.
  • Serving certificate second, requested by system:node:NODE-NAME for the kubernetes.io/kubelet-serving signer. The API server needs it to trust the kubelet back, and until it is issued, oc exec, oc logs and oc debug node fail against that node.

After you approve the first manual round, the machine-approver controller auto-approves identical renewals, so the manual work is front-loaded into the install. One timing limit from Red Hat’s docs is worth knowing: approve the requests within an hour of adding the machines, because past that mark the certificates rotate and each node can raise more than two requests. The approve-all command handles the extras the same way. Two limits from the API’s own garbage collection are worth memorizing too: a pending request that nobody touches is deleted after about 24 hours, and an approved one is cleaned up about an hour after issuance. If a cluster sat powered off past certificate expiry, requests keep reappearing as nodes re-request, and the fix is the approve-all command run twice, not one CSR at a time.

On user-provisioned infrastructure the machine API plays no part in provisioning, so Red Hat’s guidance is to run your own approval watcher for the serving certificates rather than waiting for an approver that will not come. The full flow, from the client round to a green operator list, is easiest to watch on a practice cluster; our guide to installing a local OpenShift cluster with CRC runs one on a workstation. Once the requests clear, the same page’s checks pair well with our walkthrough of checking the OpenShift cluster version and operator status to confirm everything converged.

If you want the certificate machinery explained rather than command-by-command, we recommend Learn OpenShift, Second Edition. It covers the trust chain, the machine-approver and the day-2 certificate rotation behind these requests, and it is the admin book we hand EX280 candidates.

Verify the node joined the cluster

Approval is only half the job; the node has to come back Ready. Watch the node list until the new machine flips from NotReady to Ready, which takes a minute or two after the serving certificate is issued:

oc get nodes showing the node Ready after CSR approval

When the node is Ready, the loop is closed: requests approved, certificates issued, kubelet talking to the API server in both directions. If you are approving CSRs as part of a wider cluster bring-up, our Kubernetes book guide covers the foundations behind the certificate objects, and the ArgoCD install guide is the usual next step once the cluster is accepting workloads.

When a CSR stays Pending

These are the failure patterns we have hit more than once, with what each one looks like from oc get csr:

The same requests reappear in a loop

Approve a round, and minutes later a fresh batch of Pending rows shows up with the same requestor. That is the signature of a cluster that was offline long enough for its certificates to expire: each new request is a real re-request, not a stuck queue. Run the approve-all command, let the wave settle, run it again. Certificates expire on staggered dates by design, so the offline time that triggers this is unpredictable.

The node is Ready but oc exec and oc logs fail

A node can pass oc get nodes and still refuse oc exec, oc logs and oc debug node. That combination means the kubelet serving certificate never got approved: the node authenticates outbound fine, but the API server does not trust it inbound. List the serving-signer requests specifically and approve them:

oc get csr | grep kubelet-serving

Until that round clears, anything that streams from the kubelet fails with a certificate or connection error, so it is the first thing to check when exec works on old nodes and fails only on new ones.

The condition reads Approved,Failed

An approval does not force an issuance. The kubelet-serving signer validates the request subject after you approve, and a request that does not look like a real kubelet finishes as Approved,Failed with a SignerValidationFailure reason. We hit both of its messages while testing requests built by hand. A serving request whose subject organization is missing fails with:

message: "subject organization is not system:nodes"
reason: SignerValidationFailure

Fix the organization and the common name trips the next check, because the signer also requires the kubelet client form:

message: "subject common name does not begin with system:node:"
reason: SignerValidationFailure

A genuine serving request carries the subject CN=system:node:NODE-NAME, O=system:nodes plus the node’s own hostnames and addresses in the SAN list, and with that subject the same approval ends in Approved,Issued. When you see Approved,Failed, the approval worked but the requester is broken or forged: delete the object, fix or distrust the requester, and let it raise a fresh request. The failed object also fails closed the other way, and trying to flip it with a deny returns certificate signing request "NAME" is already Approved.

The approved request vanished

An approved CSR disappears from oc get csr about an hour after issuance because the API server garbage-collects completed requests. A missing row with a Ready node is success, not data loss. The same GC deletes untouched pending requests after about a day. That is why an install left overnight can come back with an empty CSR list and NotReady nodes: the requests expired, and the nodes raise new ones on their next retry.

You approved the wrong request

Approval and denial are one-way doors in both directions. Approving a denied request fails with certificate signing request "NAME" is already Denied, and denying an approved one fails the mirror way. A hasty approve cannot be walked back through the same command, and the certificate may already have been issued by then. Decode the request as shown above and confirm the username and SANs. If the certificate should not exist, rotate the kubelet’s credentials on that node rather than assuming a deny would clean it up. Blind approval on a production cluster is how an unauthorized kubelet gets trusted, which is why the inspection step exists.

Automate the approval

For clusters where nodes join regularly, a small script on a cron or systemd timer saves the manual round. The version below is the one we run in the lab, with two guards the naive version lacks: it exits without calling the API when nothing is pending, and it deliberately leaves serving-signer requests out of the batch, because those deserve a human look on a cluster you care about. Approve those by hand with the field selector from the table above:

#!/bin/bash
# Approve pending client CSRs. Serving-signer requests are left for manual review.
oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}} {{.spec.signerName}}{{"\n"}}{{end}}{{end}}' \
| grep -v kubelet-serving \
| awk '{ print $1 }' \
| xargs --no-run-if-empty oc adm certificate approve

Run it from an account that holds update rights on the approval subresource, which on OpenShift means the cluster-admin kubeconfig or a role bound to certificatesigningrequests/approval plus the approve verb on the signer resource. A cron entry every minute is enough; the queue rarely grows faster than that outside an install.

That is the whole workflow: list, inspect, approve, deny and the checks that prove the node joined, all through oc adm certificate and the filters around it. Keep the PDF next to the terminal for the next bootstrap, and if you are granting developers access to the cluster once it is green, our project access guide picks up from there.

The next bootstrap should take minutes instead of a troubleshooting session. If a node still refuses to go Ready after both rounds clear, compare the operator list against our cluster version and operator status guide before touching the certificates again, because a stalled operator can mimic a certificate problem.

Keep reading

UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP Php PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP PHP2Shell on End-of-Life PHP 8.1, 8.0 and 7.4 (WHMCS, ionCube) Php PHP2Shell on End-of-Life PHP 8.1, 8.0 and 7.4 (WHMCS, ionCube) Git CVE-2026-111760: Check and Patch the Recursive Clone RCE Git Git CVE-2026-111760: Check and Patch the Recursive Clone RCE OpenCloud vs ownCloud vs Nextcloud: Tested on Identical VMs Cloud OpenCloud vs ownCloud vs Nextcloud: Tested on Identical VMs Steps to Mitigate Cybersecurity Risks in Field Service Operations Security Steps to Mitigate Cybersecurity Risks in Field Service Operations

Leave a Comment

Press ESC to close