1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

Merge pull request #66984 from openshift-cherrypick-robot/cherry-pick-66274-to-enterprise-4.14

[enterprise-4.14] OSDOCS#7408: Autogenerated CLI tools for MicroShift
This commit is contained in:
Kelly Brown
2023-10-26 14:19:09 -04:00
committed by GitHub
2 changed files with 426 additions and 490 deletions

View File

@@ -3,116 +3,30 @@
// Uses 'source,bash' for proper syntax highlighting for comments in examples
:_content-type: REFERENCE
[id="microshift-oc-cli-admin_{context}"]
[id="microshift-cli-admin_{context}"]
= OpenShift CLI (oc) administrator commands
//IMPORTANT: QE'd and hand-edited for relevance to MicroShift; use this version to check auto-generated files for 4.14
//== oc adm build-chain
== oc adm catalog mirror
Mirror an operator-registry catalog
.Example usage
[source,bash,options="nowrap"]
----
# Mirror an operator-registry image and its contents to a registry
oc adm catalog mirror quay.io/my/image:latest myregistry.com
# Mirror an operator-registry image and its contents to a particular namespace in a registry
oc adm catalog mirror quay.io/my/image:latest myregistry.com/my-namespace
# Mirror to an airgapped registry by first mirroring to files
oc adm catalog mirror quay.io/my/image:latest file:///local/index
oc adm catalog mirror file:///local/index/my/image:latest my-airgapped-registry.com
# Configure a cluster to use a mirrored registry
oc apply -f manifests/imageContentSourcePolicy.yaml
# Edit the mirroring mappings and mirror with "oc image mirror" manually
oc adm catalog mirror --manifests-only quay.io/my/image:latest myregistry.com
oc image mirror -f manifests/mapping.txt
# Delete all ImageContentSourcePolicies generated by oc adm catalog mirror
oc delete imagecontentsourcepolicy -l operators.openshift.org/catalog=true
----
//== oc adm certificate approve
//== oc adm certificate deny
//== oc adm cordon
//== oc adm create-bootstrap-project-template
//== oc adm create-error-template
//== oc adm create-login-template
//== oc adm create-provider-selection-template
//== oc adm drain
//== oc adm groups add-users
//== oc adm groups new
//== oc adm groups prune
//== oc adm groups remove-users
//== oc adm groups sync
== oc adm inspect
Collect debugging data for a given resource
//NOTE: This was hand-edited per QE in 4.13. This section is correct as is.
.Example usage
[source,bash,options="nowrap"]
----
# Collect debugging data for the "microshift-apiserver"
# Collect debugging data for a kubernetes service
oc adm inspect service/kubernetes
# Collect debugging data for the "microshift-apiserver" and "toptlvm-apiserver"
oc adm inspect service/kubernetes crd/logicalvolumes.topolvm.io
# Collect debugging data for services
oc adm inspect service
# Collect debugging data for all clusterversions
oc adm inspect service,crd
# Collect debugging data for a node
oc adm inspect node/<node_name>
# Collect debugging data for logicalvolumes in a CRD
oc adm inspect crd/logicalvolumes.topolvm.io
# Collect debugging data for routes.route.openshift.io in a CRD
oc adm inspect crd/routes.route.openshift.io
----
== oc adm migrate icsp
Update imagecontentsourcepolicy file(s) to imagedigestmirrorset file(s).
.Example usage
[source,bash,options="nowrap"]
----
# update the imagecontentsourcepolicy.yaml to new imagedigestmirrorset file under directory mydir
oc adm migrate icsp imagecontentsourcepolicy.yaml --dest-dir mydir
----
//== oc adm migrate template-instances
//== oc adm must-gather
//== oc adm new-project
//== oc adm node-logs
Display and filter node logs
.Example usage
[source,bash,options="nowrap"]
----
# Show kubelet logs from all masters
oc adm node-logs --role master -u kubelet
# See what logs are available in masters in /var/logs
oc adm node-logs --role master --path=/
# Display cron log file from all masters
oc adm node-logs --role master --path=cron
----
//== oc adm pod-network isolate-projects
//== oc adm pod-network join-projects
//== oc adm pod-network make-projects-global
//== oc adm policy add-role-to-user
//== oc adm policy add-scc-to-group
//== oc adm policy add-scc-to-user
//== oc adm policy scc-review
//== oc adm policy scc-subject-review
//== oc adm prune builds
//== oc adm prune deployments
//== oc adm prune groups
//== oc adm prune images
== oc adm release extract
@@ -123,12 +37,12 @@ Extract the contents of an update payload to disk
----
# Use git to check out the source code for the current cluster release to DIR
oc adm release extract --git=DIR
# Extract cloud credential requests for AWS
oc adm release extract --credentials-requests --cloud=aws
# Use git to check out the source code for the current cluster release to DIR from linux/s390x image
# Note: Wildcard filter is not supported. Pass a single os/arch to extract
# Note: Wildcard filter is not supported; pass a single os/arch to extract
oc adm release extract --git=DIR quay.io/openshift-release-dev/ocp-release:4.11.2 --filter-by-os=linux/s390x
----
@@ -142,54 +56,25 @@ Display information about a release
----
# Show information about the cluster's current release
oc adm release info
# Show the source code that comprises a release
oc adm release info 4.11.2 --commit-urls
# Show the source code difference between two releases
oc adm release info 4.11.0 4.11.2 --commits
# Show where the images referenced by the release are located
oc adm release info quay.io/openshift-release-dev/ocp-release:4.11.2 --pullspecs
# Show information about linux/s390x image
# Note: Wildcard filter is not supported. Pass a single os/arch to extract
# Note: Wildcard filter is not supported; pass a single os/arch to extract
oc adm release info quay.io/openshift-release-dev/ocp-release:4.11.2 --filter-by-os=linux/s390x
----
== oc adm release mirror
Mirror a release to a different image registry location
.Example usage
[source,bash,options="nowrap"]
----
# Perform a dry run showing what would be mirrored, including the mirror objects
oc adm release mirror 4.11.0 --to myregistry.local/openshift/release \
--release-image-signature-to-dir /tmp/releases --dry-run
# Mirror a release into the current directory
oc adm release mirror 4.11.0 --to file://openshift/release \
--release-image-signature-to-dir /tmp/releases
# Mirror a release to another directory in the default location
oc adm release mirror 4.11.0 --to-dir /tmp/releases
# Upload a release from the current directory to another server
oc adm release mirror --from file://openshift/release --to myregistry.com/openshift/release \
--release-image-signature-to-dir /tmp/releases
# Mirror the 4.11.0 release to repository registry.example.com and apply signatures to connected cluster
oc adm release mirror --from=quay.io/openshift-release-dev/ocp-release:4.11.0-x86_64 \
--to=registry.example.com/your/repository --apply-release-image-signature
----
//== oc adm release new
== oc adm taint
Update the taints on one or more nodes
Update the taints on nodes
.Example usage
[source,bash,options="nowrap"]
@@ -197,45 +82,18 @@ Update the taints on one or more nodes
# Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'
# If a taint with that key and effect already exists, its value is replaced as specified
oc adm taint nodes foo dedicated=special-user:NoSchedule
# Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists
oc adm taint nodes foo dedicated:NoSchedule-
# Remove from node 'foo' all the taints with key 'dedicated'
oc adm taint nodes foo dedicated-
# Add a taint with key 'dedicated' on nodes having label mylabel=X
oc adm taint node -l myLabel=X dedicated=foo:PreferNoSchedule
# Add to node 'foo' a taint with key 'bar' and no value
oc adm taint nodes foo bar:NoSchedule
----
//== oc adm top images
//== oc adm top imagestreams
//== oc adm top node
== oc adm top pod
Display resource (CPU/memory) usage of pods
.Example usage
[source,bash,options="nowrap"]
----
# Show metrics for all pods in the default namespace
oc adm top pod
# Show metrics for all pods in the given namespace
oc adm top pod --namespace=NAMESPACE
# Show metrics for a given pod and its containers
oc adm top pod POD_NAME --containers
# Show metrics for the pods defined by label name=myLabel
oc adm top pod -l name=myLabel
----
//== oc adm uncordon
//== oc adm upgrade
//== oc adm verify-image-signature

File diff suppressed because it is too large Load Diff