|
| 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 |
0 commit comments