Skip to content

Commit 6fb8f3e

Browse files
Merge pull request #102180 from openshift/revert-102119-revert-98015-OSDOCS-15660_mg_install
OSDOCS#15660: Must gather operator install uninstall
2 parents 76e7d05 + 0be5dd9 commit 6fb8f3e

9 files changed

+528
-0
lines changed

_attributes/common-attributes.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,3 +423,5 @@ endif::openshift-origin[]
423423
// Use after feature GAs in 4.21?? In 4.20, the Operator isn't used :attribute-based-full: Attribute-Based GPU Allocation in OpenShift with the NVIDIA GPU Operator
424424
:attribute-based-full: Attribute-Based GPU Allocation
425425
:attribute-based-short: Attribute-Based GPU Allocation
426+
//Support log gather operator
427+
:support-log-gather: Support Log Gather
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
2+
// Module included in the following assemblies:
3+
//
4+
// * support/gathering-cluster-data.adoc
5+
6+
:_mod-docs-content-type: REFERENCE
7+
[id="support-log-gather-config-params_{context}"]
8+
= Configuration parameters for MustGather custom resource
9+
10+
You can manage your `MustGather` custom resource (CR) by creating a YAML file that specifies the parameters for data collection and the upload process.
11+
The following table provides an overview of the parameters that you can configure in the `MustGather` CR.
12+
13+
[cols="1,3,1", options="header"]
14+
|===
15+
|Parameter name |Description |Type
16+
17+
|`spec.audit`
18+
|Optional: Specifies whether to collect audit logs. The valid values are `true` and `false`. The default value is `false`.
19+
|`boolean`
20+
21+
|`spec.mustGatherTimeout`
22+
|Optional: Specifies the time limit for the `must-gather` command to complete.
23+
|The value must be a floating-point number with a time unit. The valid units are `s` (seconds), `m` (minutes), or `h` (hours). By default, no time is limit set.
24+
25+
|`spec.proxyConfig`
26+
|Optional: Defines the proxy configuration to be used. The default value is set to the cluster-level proxy configuration.
27+
|`Object`
28+
29+
|`spec.proxyConfig.httpProxy`
30+
|Specifies the URL of the proxy for HTTP requests.
31+
|URL
32+
33+
|`spec.proxyConfig.httpsProxy`
34+
|Specifies the URL of the proxy for HTTPS requests.
35+
|
36+
37+
|`spec.proxyConfig.noProxy`
38+
|Specifies a comma-separated list of domains for which the proxy must not be used.
39+
|List of URLs
40+
41+
|`spec.retainResourcesOnCompletion`
42+
|Optional: Specifies whether to retain the `must-gather` job and its related resources after the completion of data collection. The valid values are `true` and `false`. The default value is `false`.
43+
|`boolean`
44+
45+
|`spec.serviceAccountName`
46+
|Optional: Specifies the name of the service account. The default value is `default`.
47+
|`string`
48+
49+
|`spec.storage`
50+
|Optional: Defines the storage configuration for the `must-gather` bundle.
51+
|`Object`
52+
53+
|`spec.storage.persistentVolume`
54+
|Defines the details of the persistent volume.
55+
|`Object`
56+
57+
|`spec.storage.persistentVolume.claim`
58+
|Defines the details of the persistent volume claim (PVC).
59+
|`Object`
60+
61+
|`spec.storage.persistentVolume.claim.name`
62+
|Specifies the name of the PVC to be used for storage.
63+
|`string`
64+
65+
|`spec.storage.persistentVolume.subPath`
66+
|Optional: Specifies the path within the PVC to store the bundle.
67+
|`string`
68+
69+
|`spec.storage.type`
70+
|Defines the type of storage. The only supported value is `PersistentVolume`.
71+
|`string`
72+
73+
|`spec.uploadTarget`
74+
|Optional: Defines the upload location for the `must-gather` bundle.
75+
|`Object`
76+
77+
|`spec.uploadTarget.host`
78+
|Optional: Specifies the destination server for the bundle upload. By default, the bundle is uploaded to `sftp.access.redhat.com`.
79+
|By default, the bundle is uploaded to `sftp.access.redhat.com`.
80+
81+
|`spec.uploadTarget.sftp.caseID`
82+
|Specifies the Red{nbsp}Hat Support case ID for which the diagnostic data is collected.
83+
|`string`
84+
85+
|`spec.uploadTarget.sftp.caseManagementAccountSecretRef`
86+
|Defines the credentials required for authenticating and uploading the files to the Red{nbsp}Hat Customer Portal support case. The value must contain a `username` and `password` field.
87+
|`Object`
88+
89+
|`spec.uploadTarget.sftp.caseManagementAccountSecretRef.name`
90+
|Specifies the name of the Kubernetes secret that contains the credentials.
91+
|`string`
92+
93+
|`spec.uploadTarget.sftp.internalUser`
94+
|Optional: Specifies whether the user provided in the `caseManagementAccountSecretRef` is a Red{nbsp}Hat internal user. The valid values are `true` and `false`. The default value is `false`.
95+
|`boolean`
96+
97+
|`spec.uploadTarget.type`
98+
|Specifies the type of upload location for the `must-gather` bundle. The only supported value is `SFTP`.
99+
|`string`
100+
101+
|===
102+
103+
[NOTE]
104+
====
105+
If you do not specify `spec.uploadTarget` or `spec.storage`, the pod saves the data to an ephemeral volume and the data is permanently deleted when the pod terminates.
106+
====
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * support/support-log-gather-operator-install.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="support-log-gather-config-cli_{context}"]
7+
= Configuring a {support-log-gather} instance
8+
9+
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.
10+
11+
:FeatureName: Support Log Gather
12+
include::snippets/technology-preview.adoc[]
13+
14+
.Prerequisites
15+
16+
* You have installed the {oc-first} tool.
17+
18+
* You have installed {support-log-gather} in your cluster.
19+
20+
* You have a Red{nbsp}Hat Support case ID.
21+
22+
* You have created a Kubernetes secret containing your Red Hat Customer Portal credentials. The secret must contain a username field and a password field.
23+
24+
* You have created a service account.
25+
26+
.Procedure
27+
28+
. Create a YAML file for the `MustGather` CR, such as `support-log-gather.yaml`, that contains the following basic configuration::
29+
+
30+
.Example `support-log-gather.yaml`
31+
+
32+
[source, yaml]
33+
----
34+
apiVersion: operator.openshift.io/v1alpha1
35+
kind: MustGather
36+
metadata:
37+
name: example-mg
38+
namespace: must-gather-operator
39+
spec:
40+
serviceAccountName: must-gather-operator
41+
audit: true
42+
proxyConfig:
43+
httpProxy: "http://proxy.example.com:8080"
44+
httpsProxy: "https://proxy.example.com:8443"
45+
noProxy: ".example.com,localhost"
46+
mustGatherTimeout: "1h30m9s"
47+
uploadTarget:
48+
type: SFTP
49+
sftp:
50+
caseID: "04230315"
51+
caseManagementAccountSecretRef:
52+
name: mustgather-creds
53+
host: "sftp.access.redhat.com"
54+
retainResourcesOnCompletion: true
55+
storage:
56+
type: PersistentVolume
57+
persistentVolume:
58+
claim:
59+
name: mustgather-pvc
60+
subPath: must-gather-bundles/case-04230315
61+
----
62+
+
63+
For more information on the configuration parameters, see "Configuration parameters for MustGather custom resource".
64+
65+
. Create the `MustGather` object by running the following command:
66+
+
67+
[source, terminal]
68+
----
69+
$ oc create -f support-log-gather.yaml
70+
----
71+
72+
.Verification
73+
74+
. Verify that the `MustGather` CR was created by running the following command:
75+
+
76+
[source, terminal]
77+
----
78+
$ oc get mustgather
79+
----
80+
+
81+
.Example output
82+
+
83+
[source, terminal]
84+
----
85+
NAME AGE
86+
example-mg 7s
87+
----
88+
89+
. Verify the status of the pods in the Operator namespace by running the following command.
90+
+
91+
[source, terminal]
92+
----
93+
$ oc get pods
94+
----
95+
+
96+
.Example output
97+
+
98+
[source, terminal]
99+
----
100+
NAME READY STATUS RESTARTS AGE
101+
must-gather-operator-657fc74d64-2gg2w 1/1 Running 0 13m
102+
example-mg-gk8m8 2/2 Running 0 13s
103+
----
104+
+
105+
A new pod with a name based on the `MustGather` CR must be created. The status of all the pods must be `Running`.
106+
107+
. To monitor the progress of the file upload, view the logs of the upload container in the job pod by running the following command:
108+
+
109+
[source, terminal]
110+
----
111+
oc logs -f pod/example-mg-gk8m8 -c upload
112+
----
113+
+
114+
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.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * support/support-log-gather-operator-install.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="support-log-gather-install-cli_{context}"]
7+
= Installing {support-log-gather} by using the CLI
8+
9+
To enable automated log collection for support cases, you can install {support-log-gather} from the command-line interface (CLI).
10+
11+
:FeatureName: Support Log Gather
12+
include::snippets/technology-preview.adoc[]
13+
14+
.Prerequisites
15+
16+
* You have access to the cluster with `cluster-admin` privileges.
17+
18+
.Procedure
19+
20+
. Create a new project named `must-gather-operator` by running the following command:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc new-project must-gather-operator
25+
----
26+
27+
. Create an `OperatorGroup` object:
28+
29+
.. Create a YAML file, for example, `operatorGroup.yaml`, that defines the `OperatorGroup` object:
30+
+
31+
[source,yaml]
32+
----
33+
apiVersion: operators.coreos.com/v1
34+
kind: OperatorGroup
35+
metadata:
36+
name: must-gather-operator
37+
namespace: must-gather-operator
38+
spec: {}
39+
----
40+
41+
.. Create the `OperatorGroup` object by running the following command:
42+
+
43+
[source,terminal]
44+
----
45+
$ oc create -f operatorGroup.yaml
46+
----
47+
48+
. Create a `Subscription` object:
49+
50+
.. Create a YAML file, for example, `subscription.yaml`, that defines the `Subscription` object:
51+
+
52+
[source,yaml]
53+
----
54+
apiVersion: operators.coreos.com/v1alpha1
55+
kind: Subscription
56+
metadata:
57+
name: support-log-gather-operator
58+
namespace: must-gather-operator
59+
spec:
60+
channel: tech-preview
61+
name: support-log-gather-operator
62+
source: redhat-operators
63+
sourceNamespace: openshift-marketplace
64+
installPlanApproval: Automatic
65+
----
66+
67+
.. Create the `Subscription` object by running the following command:
68+
+
69+
[source,terminal]
70+
----
71+
$ oc create -f subscription.yaml
72+
----
73+
74+
.Verification
75+
76+
. Verify the status of the pods in the Operator namespace by running the following command.
77+
+
78+
[source,terminal]
79+
----
80+
$ oc get pods
81+
----
82+
+
83+
.Example output
84+
+
85+
[source,terminal]
86+
----
87+
NAME READY STATUS RESTARTS AGE
88+
must-gather-operator-657fc74d64-2gg2w 1/1 Running 0 13m
89+
----
90+
+
91+
The status of all the pods must be `Running`.
92+
93+
. Verify that the subscription is created by running the following command:
94+
+
95+
[source,terminal]
96+
----
97+
$ oc get subscription -n must-gather-operator
98+
----
99+
+
100+
.Example output
101+
[source,terminal]
102+
----
103+
NAME PACKAGE SOURCE CHANNEL
104+
support-log-gather-operator support-log-gather-operator redhat-operators tech-preview
105+
----
106+
107+
. Verify that the Operator is installed by running the following command:
108+
+
109+
[source,terminal]
110+
----
111+
$ oc get csv -n must-gather-operator
112+
----
113+
+
114+
.Example output
115+
[source,terminal]
116+
----
117+
NAME DISPLAY VERSION REPLACES PHASE
118+
support-log-gather-operator.v4.20.0 support log gather 4.20.0 Succeeded
119+
----

0 commit comments

Comments
 (0)