Skip to content

Commit 6db26c4

Browse files
authored
Merge pull request #81546 from bergerhoffer/OSDOCS-11308
OSDOCS#11308: Generating CLI docs for 4.17
2 parents 0ded40e + b4a5203 commit 6db26c4

File tree

2 files changed

+125
-31
lines changed

2 files changed

+125
-31
lines changed

modules/oc-adm-by-example-content.adoc

Lines changed: 105 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ Deny a certificate signing request
8080

8181

8282
== oc adm copy-to-node
83-
Copies specified files to the node.
83+
Copy specified files to the node
8484

8585
.Example usage
8686
[source,bash,options="nowrap"]
8787
----
88-
# copy a new bootstrap kubeconfig file to node-0
88+
# Copy a new bootstrap kubeconfig file to node-0
8989
oc adm copy-to-node --copy=new-bootstrap-kubeconfig=/etc/kubernetes/kubeconfig node/node-0
9090
----
9191

@@ -340,31 +340,72 @@ Create a new project
340340

341341

342342

343+
== oc adm node-image create
344+
Create an ISO image for booting the nodes to be added to the target cluster
345+
346+
.Example usage
347+
[source,bash,options="nowrap"]
348+
----
349+
# Create the ISO image and download it in the current folder
350+
oc adm node-image create
351+
352+
# Use a different assets folder
353+
oc adm node-image create --dir=/tmp/assets
354+
355+
# Specify a custom image name
356+
oc adm node-image create -o=my-node.iso
357+
358+
# Create an ISO to add a single node without using the configuration file
359+
oc adm node-image create --mac-address=00:d8:e7:c7:4b:bb
360+
361+
# Create an ISO to add a single node with a root device hint and without
362+
# using the configuration file
363+
oc adm node-image create --mac-address=00:d8:e7:c7:4b:bb --root-device-hint=deviceName:/dev/sda
364+
----
365+
366+
367+
368+
== oc adm node-image monitor
369+
Monitor new nodes being added to an OpenShift cluster
370+
371+
.Example usage
372+
[source,bash,options="nowrap"]
373+
----
374+
# Monitor a single node being added to a cluster
375+
oc adm node-image monitor --ip-addresses 192.168.111.83
376+
377+
# Monitor multiple nodes being added to a cluster by separating each
378+
IP address with a comma
379+
oc adm node-image monitor --ip-addresses 192.168.111.83,192.168.111.84
380+
----
381+
382+
383+
343384
== oc adm node-logs
344385
Display and filter node logs
345386

346387
.Example usage
347388
[source,bash,options="nowrap"]
348389
----
349-
# Show kubelet logs from all masters
390+
# Show kubelet logs from all control plane nodes
350391
oc adm node-logs --role master -u kubelet
351392
352-
# See what logs are available in masters in /var/log
393+
# See what logs are available in control plane nodes in /var/log
353394
oc adm node-logs --role master --path=/
354395
355-
# Display cron log file from all masters
396+
# Display cron log file from all control plane nodes
356397
oc adm node-logs --role master --path=cron
357398
----
358399

359400

360401

361402
== oc adm ocp-certificates monitor-certificates
362-
Watch platform certificates.
403+
Watch platform certificates
363404

364405
.Example usage
365406
[source,bash,options="nowrap"]
366407
----
367-
# Watch platform certificates.
408+
# Watch platform certificates
368409
oc adm ocp-certificates monitor-certificates
369410
----
370411

@@ -376,7 +417,7 @@ Regenerate client and serving certificates of an OpenShift cluster
376417
.Example usage
377418
[source,bash,options="nowrap"]
378419
----
379-
# Regenerate a leaf certificate contained in a particular secret.
420+
# Regenerate a leaf certificate contained in a particular secret
380421
oc adm ocp-certificates regenerate-leaf -n openshift-config-managed secret/kube-controller-manager-client-cert-key
381422
----
382423

@@ -403,7 +444,7 @@ Regenerate the top level certificates in an OpenShift cluster
403444
.Example usage
404445
[source,bash,options="nowrap"]
405446
----
406-
# Regenerate the signing certificate contained in a particular secret.
447+
# Regenerate the signing certificate contained in a particular secret
407448
oc adm ocp-certificates regenerate-top-level -n openshift-kube-apiserver-operator secret/loadbalancer-serving-signer-key
408449
----
409450

@@ -484,6 +525,30 @@ Make project network global
484525

485526

486527

528+
== oc adm policy add-cluster-role-to-group
529+
Add a role to groups for all projects in the cluster
530+
531+
.Example usage
532+
[source,bash,options="nowrap"]
533+
----
534+
# Add the 'cluster-admin' cluster role to the 'cluster-admins' group
535+
oc adm policy add-cluster-role-to-group cluster-admin cluster-admins
536+
----
537+
538+
539+
540+
== oc adm policy add-cluster-role-to-user
541+
Add a role to users for all projects in the cluster
542+
543+
.Example usage
544+
[source,bash,options="nowrap"]
545+
----
546+
# Add the 'system:build-strategy-docker' cluster role to the 'devuser' user
547+
oc adm policy add-cluster-role-to-user system:build-strategy-docker devuser
548+
----
549+
550+
551+
487552
== oc adm policy add-role-to-user
488553
Add a role to users or service accounts for the current project
489554

@@ -526,6 +591,30 @@ Add a security context constraint to users or a service account
526591

527592

528593

594+
== oc adm policy remove-cluster-role-from-group
595+
Remove a role from groups for all projects in the cluster
596+
597+
.Example usage
598+
[source,bash,options="nowrap"]
599+
----
600+
# Remove the 'cluster-admin' cluster role from the 'cluster-admins' group
601+
oc adm policy remove-cluster-role-from-group cluster-admin cluster-admins
602+
----
603+
604+
605+
606+
== oc adm policy remove-cluster-role-from-user
607+
Remove a role from users for all projects in the cluster
608+
609+
.Example usage
610+
[source,bash,options="nowrap"]
611+
----
612+
# Remove the 'system:build-strategy-docker' cluster role from the 'devuser' user
613+
oc adm policy remove-cluster-role-from-user system:build-strategy-docker devuser
614+
----
615+
616+
617+
529618
== oc adm policy scc-review
530619
Check which service account can create a pod
531620

@@ -687,7 +776,7 @@ Lists rendered MachineConfigs in an OpenShift cluster
687776

688777

689778
== oc adm reboot-machine-config-pool
690-
Initiate reboot of the specified MachineConfigPool.
779+
Initiate reboot of the specified MachineConfigPool
691780

692781
.Example usage
693782
[source,bash,options="nowrap"]
@@ -800,18 +889,18 @@ Create a new OpenShift release
800889

801890

802891
== oc adm restart-kubelet
803-
Restarts kubelet on the specified nodes
892+
Restart kubelet on the specified nodes
804893

805894
.Example usage
806895
[source,bash,options="nowrap"]
807896
----
808-
# Restart all the nodes, 10% at a time
897+
# Restart all the nodes, 10% at a time
809898
oc adm restart-kubelet nodes --all --directive=RemoveKubeletKubeconfig
810899
811-
# Restart all the nodes, 20 nodes at a time
900+
# Restart all the nodes, 20 nodes at a time
812901
oc adm restart-kubelet nodes --all --parallelism=20 --directive=RemoveKubeletKubeconfig
813902
814-
# Restart all the nodes, 15% at a time
903+
# Restart all the nodes, 15% at a time
815904
oc adm restart-kubelet nodes --all --parallelism=15% --directive=RemoveKubeletKubeconfig
816905
817906
# Restart all the masters at the same time
@@ -976,12 +1065,12 @@ Wait for nodes to reboot after running `oc adm reboot-machine-config-pool`
9761065

9771066

9781067
== oc adm wait-for-stable-cluster
979-
wait for the platform operators to become stable
1068+
Wait for the platform operators to become stable
9801069

9811070
.Example usage
9821071
[source,bash,options="nowrap"]
9831072
----
984-
# Wait for all clusteroperators to become stable
1073+
# Wait for all cluster operators to become stable
9851074
oc adm wait-for-stable-cluster
9861075
9871076
# Consider operators to be stable if they report as such for 5 minutes straight

modules/oc-by-example-content.adoc

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Display users defined in the kubeconfig
453453

454454

455455
== oc config new-admin-kubeconfig
456-
Generate, make the server trust, and display a new admin.kubeconfig.
456+
Generate, make the server trust, and display a new admin.kubeconfig
457457

458458
.Example usage
459459
[source,bash,options="nowrap"]
@@ -465,7 +465,7 @@ Generate, make the server trust, and display a new admin.kubeconfig.
465465

466466

467467
== oc config new-kubelet-bootstrap-kubeconfig
468-
Generate, make the server trust, and display a new kubelet /etc/kubernetes/kubeconfig.
468+
Generate, make the server trust, and display a new kubelet /etc/kubernetes/kubeconfig
469469

470470
.Example usage
471471
[source,bash,options="nowrap"]
@@ -477,7 +477,7 @@ Generate, make the server trust, and display a new kubelet /etc/kubernetes/kubec
477477

478478

479479
== oc config refresh-ca-bundle
480-
Update the OpenShift CA bundle by contacting the apiserver.
480+
Update the OpenShift CA bundle by contacting the API server
481481

482482
.Example usage
483483
[source,bash,options="nowrap"]
@@ -488,7 +488,7 @@ Update the OpenShift CA bundle by contacting the apiserver.
488488
# Refresh the CA bundle for the cluster named e2e in your kubeconfig
489489
oc config refresh-ca-bundle e2e
490490
491-
# Print the CA bundle from the current OpenShift cluster's apiserver.
491+
# Print the CA bundle from the current OpenShift cluster's API server
492492
oc config refresh-ca-bundle --dry-run
493493
----
494494

@@ -591,6 +591,9 @@ Set a user entry in kubeconfig
591591
# Enable new exec auth plugin for the "cluster-admin" entry
592592
oc config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1
593593
594+
# Enable new exec auth plugin for the "cluster-admin" entry with interactive mode
595+
oc config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1 --exec-interactive-mode=Never
596+
594597
# Define new exec auth plugin arguments for the "cluster-admin" entry
595598
oc config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2
596599
@@ -819,6 +822,9 @@ Create a deployment with the specified name
819822
820823
# Create a deployment named my-dep that runs the busybox image and expose port 5701
821824
oc create deployment my-dep --image=busybox --port=5701
825+
826+
# Create a deployment named my-dep that runs multiple containers
827+
oc create deployment my-dep --image=busybox:latest --image=ubuntu:latest --image=nginx
822828
----
823829

824830

@@ -1127,7 +1133,7 @@ Create a TLS secret
11271133
[source,bash,options="nowrap"]
11281134
----
11291135
# Create a new TLS secret named tls-secret with the given key pair
1130-
oc create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key
1136+
oc create secret tls tls-secret --cert=path/to/tls.crt --key=path/to/tls.key
11311137
----
11321138

11331139

@@ -1261,8 +1267,8 @@ Launch a new instance of a pod for debugging
12611267
# Debug a node as an administrator
12621268
oc debug node/master-1
12631269
1264-
# Debug a Windows Node
1265-
# Note: the chosen image must match the Windows Server version (2019, 2022) of the Node
1270+
# Debug a Windows node
1271+
# Note: the chosen image must match the Windows Server version (2019, 2022) of the node
12661272
oc debug node/win-worker-1 --image=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022
12671273
12681274
# Launch a shell in a pod using the provided image stream tag
@@ -1569,10 +1575,10 @@ Experimental: Get token from external OIDC issuer as credentials exec plugin
15691575
.Example usage
15701576
[source,bash,options="nowrap"]
15711577
----
1572-
# Starts an auth code flow to the issuer url with the client id and the given extra scopes
1578+
# Starts an auth code flow to the issuer URL with the client ID and the given extra scopes
15731579
oc get-token --client-id=client-id --issuer-url=test.issuer.url --extra-scopes=email,profile
15741580
1575-
# Starts an authe code flow to the issuer url with a different callback address.
1581+
# Starts an auth code flow to the issuer URL with a different callback address
15761582
oc get-token --client-id=client-id --issuer-url=test.issuer.url --callback-address=127.0.0.1:8343
15771583
----
15781584

@@ -1737,8 +1743,7 @@ Mirror images from one repository to another
17371743
17381744
# Copy specific os/arch manifest of a multi-architecture image
17391745
# Run 'oc image info myregistry.com/myimage:latest' to see available os/arch for multi-arch images
1740-
# Note that with multi-arch images, this results in a new manifest list digest that includes only
1741-
# the filtered manifests
1746+
# Note that with multi-arch images, this results in a new manifest list digest that includes only the filtered manifests
17421747
oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
17431748
--filter-by-os=os/arch
17441749
@@ -1753,8 +1758,8 @@ Mirror images from one repository to another
17531758
17541759
# Copy specific os/arch manifest of a multi-architecture image
17551760
# Run 'oc image info myregistry.com/myimage:latest' to see available os/arch for multi-arch images
1756-
# Note that the target registry may reject a manifest list if the platform specific images do not all
1757-
# exist. You must use a registry with sparse registry support enabled.
1761+
# Note that the target registry may reject a manifest list if the platform specific images do not all exist
1762+
# You must use a registry with sparse registry support enabled
17581763
oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
17591764
--filter-by-os=linux/386 \
17601765
--keep-manifest-list=true
@@ -1856,7 +1861,7 @@ Log in to a server
18561861
# Log in to the given server through a browser
18571862
oc login localhost:8443 --web --callback-port 8280
18581863
1859-
# Log in to the external OIDC issuer through Auth Code + PKCE by starting a local server listening port 8080
1864+
# Log in to the external OIDC issuer through Auth Code + PKCE by starting a local server listening on port 8080
18601865
oc login localhost:8443 --exec-plugin=oc-oidc --client-id=client-id --extra-scopes=email,profile --callback-port=8080
18611866
----
18621867

@@ -3003,7 +3008,7 @@ Print the client and server version information
30033008
# Print the OpenShift client, kube-apiserver, and openshift-apiserver version information for the current context
30043009
oc version
30053010
3006-
# Print the OpenShift client, kube-apiserver, and openshift-apiserver version numbers for the current context in json format
3011+
# Print the OpenShift client, kube-apiserver, and openshift-apiserver version numbers for the current context in JSON format
30073012
oc version --output json
30083013
30093014
# Print the OpenShift client version information for the current context

0 commit comments

Comments
 (0)