1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/support-log-gather-configure-cli.adoc

115 lines
3.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * support/support-log-gather-operator-install.adoc
:_mod-docs-content-type: PROCEDURE
[id="support-log-gather-config-cli_{context}"]
= Configuring a {support-log-gather} instance
You must create a `MustGather` custom resource (CR) from the command-line interface (CLI) to automate the collection of diagnostic data from your cluster. This process also automatically uploads the data to a Red{nbsp}Hat Support case.
:FeatureName: Support Log Gather
include::snippets/technology-preview.adoc[]
.Prerequisites
* You have installed the {oc-first} tool.
* You have installed {support-log-gather} in your cluster.
* You have a Red{nbsp}Hat Support case ID.
* You have created a Kubernetes secret containing your Red Hat Customer Portal credentials. The secret must contain a username field and a password field.
* You have created a service account.
.Procedure
. Create a YAML file for the `MustGather` CR, such as `support-log-gather.yaml`, that contains the following basic configuration::
+
.Example `support-log-gather.yaml`
+
[source, yaml]
----
apiVersion: operator.openshift.io/v1alpha1
kind: MustGather
metadata:
name: example-mg
namespace: must-gather-operator
spec:
serviceAccountName: must-gather-operator
audit: true
proxyConfig:
httpProxy: "http://proxy.example.com:8080"
httpsProxy: "https://proxy.example.com:8443"
noProxy: ".example.com,localhost"
mustGatherTimeout: "1h30m9s"
uploadTarget:
type: SFTP
sftp:
caseID: "04230315"
caseManagementAccountSecretRef:
name: mustgather-creds
host: "sftp.access.redhat.com"
retainResourcesOnCompletion: true
storage:
type: PersistentVolume
persistentVolume:
claim:
name: mustgather-pvc
subPath: must-gather-bundles/case-04230315
----
+
For more information on the configuration parameters, see "Configuration parameters for MustGather custom resource".
. Create the `MustGather` object by running the following command:
+
[source, terminal]
----
$ oc create -f support-log-gather.yaml
----
.Verification
. Verify that the `MustGather` CR was created by running the following command:
+
[source, terminal]
----
$ oc get mustgather
----
+
.Example output
+
[source, terminal]
----
NAME AGE
example-mg 7s
----
. Verify the status of the pods in the Operator namespace by running the following command.
+
[source, terminal]
----
$ oc get pods
----
+
.Example output
+
[source, terminal]
----
NAME READY STATUS RESTARTS AGE
must-gather-operator-657fc74d64-2gg2w 1/1 Running 0 13m
example-mg-gk8m8 2/2 Running 0 13s
----
+
A new pod with a name based on the `MustGather` CR must be created. The status of all the pods must be `Running`.
. To monitor the progress of the file upload, view the logs of the upload container in the job pod by running the following command:
+
[source, terminal]
----
oc logs -f pod/example-mg-gk8m8 -c upload
----
+
When successful, the process must create an archive and upload it to the Red{nbsp}Hat Secure File Transfer Protocol (SFTP) server for the specified case.