Skip to content

Commit bc6157f

Browse files
committed
OSDOCS-5420: Auto generate oc commands for MicroShift
1 parent 1d7d6d8 commit bc6157f

5 files changed

+2619
-5
lines changed

microshift_cli_ref/microshift-oc-cli-commands-list.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ Using `oc <command> --help` lists details for any `oc` command. Not all `oc` com
1717

1818
// The OCP file is auto-generated from the openshift/oc repository; MicroShift is made manually
1919
// OpenShift CLI (oc) administrator commands
20-
include::modules/microshift-oc-by-example-content.adoc[leveloffset=+1]
20+
//include::modules/microshift-oc-by-example-content.adoc[leveloffset=+1]
21+
include::modules/microshift-oc-by-example-content-gen.adoc[leveloffset=+1]
22+
include::modules/microshift-oc-adm-by-example-content.adoc[leveloffset=+1]
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
// NOTE: The contents of this file are auto-generated
2+
// This template is for admin ('oc adm ...') commands
3+
// Uses 'source,bash' for proper syntax highlighting for comments in examples
4+
5+
:_content-type: REFERENCE
6+
[id="microshift-oc-cli-admin_{context}"]
7+
= OpenShift CLI (oc) administrator commands
8+
9+
//hand-edited for relevance to MicroShift in lieu of working PR--can replace when auto-generate is ready
10+
11+
//== oc adm build-chain
12+
13+
== oc adm catalog mirror
14+
Mirror an operator-registry catalog
15+
16+
.Example usage
17+
[source,bash,options="nowrap"]
18+
----
19+
# Mirror an operator-registry image and its contents to a registry
20+
oc adm catalog mirror quay.io/my/image:latest myregistry.com
21+
22+
# Mirror an operator-registry image and its contents to a particular namespace in a registry
23+
oc adm catalog mirror quay.io/my/image:latest myregistry.com/my-namespace
24+
25+
# Mirror to an airgapped registry by first mirroring to files
26+
oc adm catalog mirror quay.io/my/image:latest file:///local/index
27+
oc adm catalog mirror file:///local/index/my/image:latest my-airgapped-registry.com
28+
29+
# Configure a cluster to use a mirrored registry
30+
oc apply -f manifests/imageContentSourcePolicy.yaml
31+
32+
# Edit the mirroring mappings and mirror with "oc image mirror" manually
33+
oc adm catalog mirror --manifests-only quay.io/my/image:latest myregistry.com
34+
oc image mirror -f manifests/mapping.txt
35+
36+
# Delete all ImageContentSourcePolicies generated by oc adm catalog mirror
37+
oc delete imagecontentsourcepolicy -l operators.openshift.org/catalog=true
38+
----
39+
40+
//== oc adm certificate approve
41+
//== oc adm certificate deny
42+
//== oc adm cordon
43+
//== oc adm create-bootstrap-project-template
44+
//== oc adm create-error-template
45+
//== oc adm create-login-template
46+
//== oc adm create-provider-selection-template
47+
//== oc adm drain
48+
//== oc adm groups add-users
49+
//== oc adm groups new
50+
//== oc adm groups prune
51+
//== oc adm groups remove-users
52+
//== oc adm groups sync
53+
54+
== oc adm inspect
55+
Collect debugging data for a given resource
56+
57+
.Example usage
58+
[source,bash,options="nowrap"]
59+
----
60+
# Collect debugging data for the "openshift-apiserver" clusteroperator
61+
oc adm inspect clusteroperator/openshift-apiserver
62+
63+
# Collect debugging data for the "openshift-apiserver" and "kube-apiserver" clusteroperators
64+
oc adm inspect clusteroperator/openshift-apiserver clusteroperator/kube-apiserver
65+
66+
# Collect debugging data for all clusteroperators
67+
oc adm inspect clusteroperator
68+
69+
# Collect debugging data for all clusteroperators and clusterversions
70+
oc adm inspect clusteroperators,clusterversions
71+
----
72+
73+
== oc adm migrate icsp
74+
Update imagecontentsourcepolicy file(s) to imagedigestmirrorset file(s).
75+
76+
.Example usage
77+
[source,bash,options="nowrap"]
78+
----
79+
# update the imagecontentsourcepolicy.yaml to new imagedigestmirrorset file under directory mydir
80+
oc adm migrate icsp imagecontentsourcepolicy.yaml --dest-dir mydir
81+
----
82+
83+
//== oc adm migrate template-instances
84+
//== oc adm must-gather
85+
//== oc adm new-project
86+
87+
88+
//== oc adm node-logs
89+
Display and filter node logs
90+
91+
.Example usage
92+
[source,bash,options="nowrap"]
93+
----
94+
# Show kubelet logs from all masters
95+
oc adm node-logs --role master -u kubelet
96+
97+
# See what logs are available in masters in /var/logs
98+
oc adm node-logs --role master --path=/
99+
100+
# Display cron log file from all masters
101+
oc adm node-logs --role master --path=cron
102+
----
103+
104+
//== oc adm pod-network isolate-projects
105+
//== oc adm pod-network join-projects
106+
//== oc adm pod-network make-projects-global
107+
//== oc adm policy add-role-to-user
108+
//== oc adm policy add-scc-to-group
109+
//== oc adm policy add-scc-to-user
110+
//== oc adm policy scc-review
111+
//== oc adm policy scc-subject-review
112+
//== oc adm prune builds
113+
//== oc adm prune deployments
114+
//== oc adm prune groups
115+
//== oc adm prune images
116+
117+
118+
== oc adm release extract
119+
Extract the contents of an update payload to disk
120+
121+
.Example usage
122+
[source,bash,options="nowrap"]
123+
----
124+
# Use git to check out the source code for the current cluster release to DIR
125+
oc adm release extract --git=DIR
126+
127+
# Extract cloud credential requests for AWS
128+
oc adm release extract --credentials-requests --cloud=aws
129+
130+
# Use git to check out the source code for the current cluster release to DIR from linux/s390x image
131+
# Note: Wildcard filter is not supported. Pass a single os/arch to extract
132+
oc adm release extract --git=DIR quay.io/openshift-release-dev/ocp-release:4.11.2 --filter-by-os=linux/s390x
133+
----
134+
135+
136+
137+
== oc adm release info
138+
Display information about a release
139+
140+
.Example usage
141+
[source,bash,options="nowrap"]
142+
----
143+
# Show information about the cluster's current release
144+
oc adm release info
145+
146+
# Show the source code that comprises a release
147+
oc adm release info 4.11.2 --commit-urls
148+
149+
# Show the source code difference between two releases
150+
oc adm release info 4.11.0 4.11.2 --commits
151+
152+
# Show where the images referenced by the release are located
153+
oc adm release info quay.io/openshift-release-dev/ocp-release:4.11.2 --pullspecs
154+
155+
# Show information about linux/s390x image
156+
# Note: Wildcard filter is not supported. Pass a single os/arch to extract
157+
oc adm release info quay.io/openshift-release-dev/ocp-release:4.11.2 --filter-by-os=linux/s390x
158+
----
159+
160+
161+
162+
== oc adm release mirror
163+
Mirror a release to a different image registry location
164+
165+
.Example usage
166+
[source,bash,options="nowrap"]
167+
----
168+
# Perform a dry run showing what would be mirrored, including the mirror objects
169+
oc adm release mirror 4.11.0 --to myregistry.local/openshift/release \
170+
--release-image-signature-to-dir /tmp/releases --dry-run
171+
172+
# Mirror a release into the current directory
173+
oc adm release mirror 4.11.0 --to file://openshift/release \
174+
--release-image-signature-to-dir /tmp/releases
175+
176+
# Mirror a release to another directory in the default location
177+
oc adm release mirror 4.11.0 --to-dir /tmp/releases
178+
179+
# Upload a release from the current directory to another server
180+
oc adm release mirror --from file://openshift/release --to myregistry.com/openshift/release \
181+
--release-image-signature-to-dir /tmp/releases
182+
183+
# Mirror the 4.11.0 release to repository registry.example.com and apply signatures to connected cluster
184+
oc adm release mirror --from=quay.io/openshift-release-dev/ocp-release:4.11.0-x86_64 \
185+
--to=registry.example.com/your/repository --apply-release-image-signature
186+
----
187+
188+
189+
//== oc adm release new
190+
191+
== oc adm taint
192+
Update the taints on one or more nodes
193+
194+
.Example usage
195+
[source,bash,options="nowrap"]
196+
----
197+
# Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'
198+
# If a taint with that key and effect already exists, its value is replaced as specified
199+
oc adm taint nodes foo dedicated=special-user:NoSchedule
200+
201+
# Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists
202+
oc adm taint nodes foo dedicated:NoSchedule-
203+
204+
# Remove from node 'foo' all the taints with key 'dedicated'
205+
oc adm taint nodes foo dedicated-
206+
207+
# Add a taint with key 'dedicated' on nodes having label mylabel=X
208+
oc adm taint node -l myLabel=X dedicated=foo:PreferNoSchedule
209+
210+
# Add to node 'foo' a taint with key 'bar' and no value
211+
oc adm taint nodes foo bar:NoSchedule
212+
----
213+
214+
215+
//== oc adm top images
216+
//== oc adm top imagestreams
217+
//== oc adm top node
218+
219+
220+
== oc adm top pod
221+
Display resource (CPU/memory) usage of pods
222+
223+
.Example usage
224+
[source,bash,options="nowrap"]
225+
----
226+
# Show metrics for all pods in the default namespace
227+
oc adm top pod
228+
229+
# Show metrics for all pods in the given namespace
230+
oc adm top pod --namespace=NAMESPACE
231+
232+
# Show metrics for a given pod and its containers
233+
oc adm top pod POD_NAME --containers
234+
235+
# Show metrics for the pods defined by label name=myLabel
236+
oc adm top pod -l name=myLabel
237+
----
238+
239+
//== oc adm uncordon
240+
//== oc adm upgrade
241+
//== oc adm verify-image-signature

modules/microshift-oc-apis-errors.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Module included in the following assemblies:
22
//
3-
// * microshift-clie-using-oc/microshift-oc-apis-errors.adoc
3+
// * microshift-cli-using-oc/microshift-oc-apis-errors.adoc
44

55
:_content-type: CONCEPT
66
[id="microshift-oc-apis-errors_{context}"]
77
= oc command errors in {product-title}
88

9-
Not all {OCP} CLI tool (`oc`) commands are relevant for {product-title} deployments. When you use `oc` to make a request call against an unsupported API, the `oc` binary usually generates an error message about a resource that cannot be found.
9+
Not all OpenShift CLI (oc) tool commands are relevant for {product-title} deployments. When you use `oc` to make a request call against an unsupported API, the `oc` binary usually generates an error message about a resource that cannot be found.
1010

1111
.Example output
1212

@@ -17,7 +17,7 @@ For example, when the following `new-project` command is run:
1717
$ oc new-project test
1818
----
1919

20-
The error following error message can be generated:
20+
The following error message can be generated:
2121

2222
[source, terminal]
2323
----

0 commit comments

Comments
 (0)