Skip to content

Commit 84244ee

Browse files
committed
OSDOCS#13548: Generating the CLI docs for OCP 4.19
1 parent 3aabf91 commit 84244ee

File tree

2 files changed

+101
-68
lines changed

2 files changed

+101
-68
lines changed

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

Lines changed: 22 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ Create an ISO image for booting the nodes to be added to the target cluster
355355
# Specify a custom image name
356356
oc adm node-image create -o=my-node.iso
357357
358+
# In place of an ISO, creates files that can be used for PXE boot
359+
oc adm node-image create --pxe
360+
358361
# Create an ISO to add a single node without using the configuration file
359362
oc adm node-image create --mac-address=00:d8:e7:c7:4b:bb
360363
@@ -375,7 +378,7 @@ Monitor new nodes being added to an OpenShift cluster
375378
oc adm node-image monitor --ip-addresses 192.168.111.83
376379
377380
# Monitor multiple nodes being added to a cluster by separating each
378-
IP address with a comma
381+
# IP address with a comma
379382
oc adm node-image monitor --ip-addresses 192.168.111.83,192.168.111.84
380383
----
381384

@@ -480,51 +483,6 @@ Update user-data secrets in an OpenShift cluster to use updated MCO certfs
480483

481484

482485

483-
== oc adm pod-network isolate-projects
484-
Isolate project network
485-
486-
.Example usage
487-
[source,bash,options="nowrap"]
488-
----
489-
# Provide isolation for project p1
490-
oc adm pod-network isolate-projects <p1>
491-
492-
# Allow all projects with label name=top-secret to have their own isolated project network
493-
oc adm pod-network isolate-projects --selector='name=top-secret'
494-
----
495-
496-
497-
498-
== oc adm pod-network join-projects
499-
Join project network
500-
501-
.Example usage
502-
[source,bash,options="nowrap"]
503-
----
504-
# Allow project p2 to use project p1 network
505-
oc adm pod-network join-projects --to=<p1> <p2>
506-
507-
# Allow all projects with label name=top-secret to use project p1 network
508-
oc adm pod-network join-projects --to=<p1> --selector='name=top-secret'
509-
----
510-
511-
512-
513-
== oc adm pod-network make-projects-global
514-
Make project network global
515-
516-
.Example usage
517-
[source,bash,options="nowrap"]
518-
----
519-
# Allow project p1 to access all pods in the cluster and vice versa
520-
oc adm pod-network make-projects-global <p1>
521-
522-
# Allow all projects with label name=share to access all pods in the cluster and vice versa
523-
oc adm pod-network make-projects-global --selector='name=share'
524-
----
525-
526-
527-
528486
== oc adm policy add-cluster-role-to-group
529487
Add a role to groups for all projects in the cluster
530488

@@ -973,6 +931,24 @@ Display resource (CPU/memory) usage of nodes
973931

974932

975933

934+
== oc adm top persistentvolumeclaims
935+
Experimental: Show usage statistics for bound persistentvolumeclaims
936+
937+
.Example usage
938+
[source,bash,options="nowrap"]
939+
----
940+
# Show usage statistics for all the bound persistentvolumeclaims across the cluster
941+
oc adm top persistentvolumeclaims -A
942+
943+
# Show usage statistics for all the bound persistentvolumeclaims in a specific namespace
944+
oc adm top persistentvolumeclaims -n default
945+
946+
# Show usage statistics for specific bound persistentvolumeclaims
947+
oc adm top persistentvolumeclaims database-pvc app-pvc -n default
948+
----
949+
950+
951+
976952
== oc adm top pod
977953
Display resource (CPU/memory) usage of pods
978954

modules/oc-by-example-content.adoc

Lines changed: 79 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,8 @@ Check whether an action is allowed
187187
# Check to see if I can list deployments in my current namespace
188188
oc auth can-i list deployments.apps
189189
190-
# Check to see if service account "foo" of namespace "dev" can list pods
191-
# in the namespace "prod".
192-
# You must be allowed to use impersonation for the global option "--as".
190+
# Check to see if service account "foo" of namespace "dev" can list pods in the namespace "prod"
191+
# You must be allowed to use impersonation for the global option "--as"
193192
oc auth can-i list pods --as=system:serviceaccount:dev:foo -n prod
194193
195194
# Check to see if I can do everything in my current namespace ("*" means all)
@@ -204,6 +203,9 @@ Check whether an action is allowed
204203
# Check to see if I can access the URL /logs/
205204
oc auth can-i get /logs/
206205
206+
# Check to see if I can approve certificates.k8s.io
207+
oc auth can-i approve certificates.k8s.io
208+
207209
# List all allowed actions in namespace "foo"
208210
oc auth can-i --list --namespace=foo
209211
----
@@ -228,10 +230,10 @@ Experimental: Check self subject attributes
228230
.Example usage
229231
[source,bash,options="nowrap"]
230232
----
231-
# Get your subject attributes.
233+
# Get your subject attributes
232234
oc auth whoami
233235
234-
# Get your subject attributes in JSON format.
236+
# Get your subject attributes in JSON format
235237
oc auth whoami -o json
236238
----
237239

@@ -1032,7 +1034,7 @@ Create a role binding for a particular role or cluster role
10321034
# Create a role binding for user1, user2, and group1 using the admin cluster role
10331035
oc create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1
10341036
1035-
# Create a role binding for serviceaccount monitoring:sa-dev using the admin role
1037+
# Create a role binding for service account monitoring:sa-dev using the admin role
10361038
oc create rolebinding admin-binding --role=admin --serviceaccount=monitoring:sa-dev
10371039
----
10381040

@@ -1097,7 +1099,7 @@ Create a secret for use with a Docker registry
10971099
oc create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL
10981100
10991101
# Create a new secret named my-secret from ~/.docker/config.json
1100-
oc create secret docker-registry my-secret --from-file=.dockerconfigjson=path/to/.docker/config.json
1102+
oc create secret docker-registry my-secret --from-file=path/to/.docker/config.json
11011103
----
11021104

11031105

@@ -1324,6 +1326,9 @@ Delete resources by file names, stdin, resources and names, or by resources and
13241326
13251327
# Delete all pods
13261328
oc delete pods --all
1329+
1330+
# Delete all pods only if the user confirms the deletion
1331+
oc delete pods --all --interactive
13271332
----
13281333

13291334

@@ -1565,6 +1570,12 @@ Display one or many resources
15651570
15661571
# List the 'status' subresource for a single pod
15671572
oc get pod web-pod-13je7 --subresource status
1573+
1574+
# List all deployments in namespace 'backend'
1575+
oc get deployments.apps --namespace backend
1576+
1577+
# List all pods existing in all namespaces
1578+
oc get pods --all-namespaces
15681579
----
15691580

15701581

@@ -2060,6 +2071,21 @@ Update fields of a resource
20602071

20612072

20622073

2074+
== oc plugin
2075+
Provides utilities for interacting with plugins
2076+
2077+
.Example usage
2078+
[source,bash,options="nowrap"]
2079+
----
2080+
# List all available plugins
2081+
oc plugin list
2082+
2083+
# List only binary names of available plugins without paths
2084+
oc plugin list --name-only
2085+
----
2086+
2087+
2088+
20632089
== oc plugin list
20642090
List all visible plugin executables on a user's PATH
20652091

@@ -2068,6 +2094,9 @@ List all visible plugin executables on a user's PATH
20682094
----
20692095
# List all available plugins
20702096
oc plugin list
2097+
2098+
# List only binary names of available plugins without paths
2099+
oc plugin list --name-only
20712100
----
20722101

20732102

@@ -2305,6 +2334,27 @@ Revert part of an application back to a previous deployment
23052334

23062335

23072336

2337+
== oc rollout
2338+
Manage the rollout of a resource
2339+
2340+
.Example usage
2341+
[source,bash,options="nowrap"]
2342+
----
2343+
# Roll back to the previous deployment
2344+
oc rollout undo deployment/abc
2345+
2346+
# Check the rollout status of a daemonset
2347+
oc rollout status daemonset/foo
2348+
2349+
# Restart a deployment
2350+
oc rollout restart deployment/abc
2351+
2352+
# Restart deployments with the 'app=nginx' label
2353+
oc rollout restart deployment --selector=app=nginx
2354+
----
2355+
2356+
2357+
23082358
== oc rollout cancel
23092359
Cancel the in-progress deployment
23102360

@@ -2324,10 +2374,10 @@ View rollout history
23242374
[source,bash,options="nowrap"]
23252375
----
23262376
# View the rollout history of a deployment
2327-
oc rollout history dc/nginx
2377+
oc rollout history deployment/abc
23282378
2329-
# View the details of deployment revision 3
2330-
oc rollout history dc/nginx --revision=3
2379+
# View the details of daemonset revision 3
2380+
oc rollout history daemonset/abc --revision=3
23312381
----
23322382

23332383

@@ -2353,10 +2403,10 @@ Mark the provided resource as paused
23532403
.Example usage
23542404
[source,bash,options="nowrap"]
23552405
----
2356-
# Mark the nginx deployment as paused. Any current state of
2357-
# the deployment will continue its function, new updates to the deployment will not
2358-
# have an effect as long as the deployment is paused
2359-
oc rollout pause dc/nginx
2406+
# Mark the nginx deployment as paused
2407+
# Any current state of the deployment will continue its function; new updates
2408+
# to the deployment will not have an effect as long as the deployment is paused
2409+
oc rollout pause deployment/nginx
23602410
----
23612411

23622412

@@ -2367,7 +2417,7 @@ Restart a resource
23672417
.Example usage
23682418
[source,bash,options="nowrap"]
23692419
----
2370-
# Restart all deployments in test-namespace namespace
2420+
# Restart all deployments in the test-namespace namespace
23712421
oc rollout restart deployment -n test-namespace
23722422
23732423
# Restart a deployment
@@ -2389,7 +2439,7 @@ Resume a paused resource
23892439
[source,bash,options="nowrap"]
23902440
----
23912441
# Resume an already paused deployment
2392-
oc rollout resume dc/nginx
2442+
oc rollout resume deployment/nginx
23932443
----
23942444

23952445

@@ -2413,8 +2463,8 @@ Show the status of the rollout
24132463
.Example usage
24142464
[source,bash,options="nowrap"]
24152465
----
2416-
# Watch the status of the latest rollout
2417-
oc rollout status dc/nginx
2466+
# Watch the rollout status of a deployment
2467+
oc rollout status deployment/nginx
24182468
----
24192469

24202470

@@ -2426,10 +2476,13 @@ Undo a previous rollout
24262476
[source,bash,options="nowrap"]
24272477
----
24282478
# Roll back to the previous deployment
2429-
oc rollout undo dc/nginx
2479+
oc rollout undo deployment/abc
24302480
2431-
# Roll back to deployment revision 3. The replication controller for that version must exist
2432-
oc rollout undo dc/nginx --to-revision=3
2481+
# Roll back to daemonset revision 3
2482+
oc rollout undo daemonset/abc --to-revision=3
2483+
2484+
# Roll back to the previous deployment with dry-run
2485+
oc rollout undo --dry-run=server deployment/abc
24332486
----
24342487

24352488

@@ -3035,9 +3088,13 @@ Experimental: Wait for a specific condition on one or many resources
30353088
# Wait for pod "busybox1" to be Ready
30363089
oc wait --for='jsonpath={.status.conditions[?(@.type=="Ready")].status}=True' pod/busybox1
30373090
3038-
# Wait for the service "loadbalancer" to have ingress.
3091+
# Wait for the service "loadbalancer" to have ingress
30393092
oc wait --for=jsonpath='{.status.loadBalancer.ingress}' service/loadbalancer
30403093
3094+
# Wait for the secret "busybox1" to be created, with a timeout of 30s
3095+
oc create secret generic busybox1
3096+
oc wait --for=create secret/busybox1 --timeout=30s
3097+
30413098
# Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command
30423099
oc delete pod/busybox1
30433100
oc wait --for=delete pod/busybox1 --timeout=60s

0 commit comments

Comments
 (0)