-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathgather_hub_logs
More file actions
executable file
·113 lines (98 loc) · 5.6 KB
/
gather_hub_logs
File metadata and controls
executable file
·113 lines (98 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#! /bin/bash
# Copyright (c) 2023 Red Hat, Inc.
# Copyright Contributors to the Open Cluster Management project
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
source ${SCRIPT_DIR}/gather_utils
if [[ "${GATHER_CONTEXT}" == "true" ]]; then
${SCRIPT_DIR}/gather_mce_logs
fi
if [ -z $GATHER_HUB_RAN ] || [ $GATHER_HUB_RAN != true ]; then
log "Starting ACM Hub cluster must-gather"
HUB_NAMESPACE=$(oc get multiclusterhubs.operator.open-cluster-management.io --all-namespaces --no-headers=true | awk '{ print $1 }')
log "Hub namespace: $HUB_NAMESPACE"
{
print_with_header "Openshift CLI version" "$(oc version)"
print_with_header "ClusterServiceVersion in namespace ${HUB_NAMESPACE}" \
"$(oc get clusterserviceversions.operators.coreos.com -n "${HUB_NAMESPACE}")"
print_with_header "MultiClusterHub resource in namespace ${HUB_NAMESPACE}" \
"$(oc get multiclusterhubs.operator.open-cluster-management.io -n "${HUB_NAMESPACE}")"
print_with_header "Pods in hub namespace ${HUB_NAMESPACE}" "$(oc get pods -n "${HUB_NAMESPACE}")"
} >"${BASE_COLLECTION_PATH}/gather-acm.log"
run_inspect ns/"$HUB_NAMESPACE"
run_inspect serviceaccounts --namespace "$HUB_NAMESPACE"
run_inspect roles --namespace "$HUB_NAMESPACE"
run_inspect ns/open-cluster-management-hub
run_inspect ns/open-cluster-management-backup
# request from https://bugzilla.redhat.com/show_bug.cgi?id=1853485
oc get proxy -o yaml >${BASE_COLLECTION_PATH}/gather-proxy.log
run_inspect multiclusterhubs.operator.open-cluster-management.io --all-namespaces
run_inspect internalhubcomponents.operator.open-cluster-management.io --all-namespaces
run_inspect klusterletaddonconfigs.agent.open-cluster-management.io --all-namespaces
run_inspect validatingwebhookconfigurations.admissionregistration.k8s.io --all-namespaces
run_inspect mutatingwebhookconfigurations.admissionregistration.k8s.io --all-namespaces
run_inspect clustermanagementaddons.addon.open-cluster-management.io --all-namespaces
run_inspect managedclusteraddons.addon.open-cluster-management.io --all-namespaces
run_inspect managedproxyconfigurations.proxy.open-cluster-management.io
run_inspect managedproxyserviceresolvers.proxy.open-cluster-management.io
run_inspect addondeploymentconfigs.addon.open-cluster-management.io --all-namespaces
run_inspect searches.search.open-cluster-management.io --all-namespaces
run_inspect ns/openshift-monitoring
run_inspect ns/open-cluster-management-issuer
run_inspect ansiblejobs.tower.ansible.com --all-namespaces
# Fine Grained RBAC CRs
run_inspect multiclusterroleassignments.rbac.open-cluster-management.io --all-namespaces
# Backup and Restore chart, OADP Operator and Velero CRs
run_inspect restores.cluster.open-cluster-management.io --all-namespaces
run_inspect backupschedules.cluster.open-cluster-management.io --all-namespaces
run_inspect dataprotectionapplications.oadp.openshift.io --all-namespaces
run_inspect backupstoragelocations.velero.io --all-namespaces
run_inspect backuprepositories.velero.io --all-namespaces
run_inspect deletebackuprequests.velero.io --all-namespaces
run_inspect downloadrequests.velero.io --all-namespaces
run_inspect podvolumebackups.velero.io --all-namespaces
run_inspect podvolumerestores.velero.io --all-namespaces
run_inspect volumesnapshotlocations.velero.io --all-namespaces
run_inspect schedules.velero.io --all-namespaces
run_inspect backups.velero.io --all-namespaces
run_inspect restores.velero.io --all-namespaces
# SiteConfig Operator CRs
run_inspect clusterinstances.siteconfig.open-cluster-management.io --all-namespaces
# Submariner Addon CRs
run_inspect submarinerconfigs.submarineraddon.open-cluster-management.io --all-namespaces
run_inspect brokers.submariner.io --all-namespaces
# Multicluster GlobalHub information
if run_inspect multiclusterglobalhubs.operator.open-cluster-management.io --all-namespaces; then
# kafka
run_inspect kafkas.kafka.strimzi.io --all-namespaces
run_inspect kafkatopics.kafka.strimzi.io --all-namespaces
run_inspect kafkausers.kafka.strimzi.io --all-namespaces
KAFKANS=$(oc get kafkas.kafka.strimzi.io --all-namespaces --no-headers=true -o custom-columns=NAMESPACE:.metadata.namespace | sort -u)
for kns in $KAFKANS; do
run_inspect ns/"$kns"
done
# postgresql
run_inspect postgresclusters.postgres-operator.crunchydata.com --all-namespaces
POSTGRESNS=$(oc get postgresclusters.postgres-operator.crunchydata.com --all-namespaces --no-headers=true -o custom-columns=NAMESPACE:.metadata.namespace | sort -u)
for pns in $POSTGRESNS; do
run_inspect ns/"$pns"
done
GLOBALHUB_NAMESPACE=$(oc get multiclusterglobalhubs.operator.open-cluster-management.io --all-namespaces --no-headers=true | awk '{ print $1 }')
# migration
run_inspect managedclustermigration --all-namespaces
log "GlobalHub namespace: $GLOBALHUB_NAMESPACE"
run_inspect ns/"$GLOBALHUB_NAMESPACE"
fi
# Multicluster Global Hub Agent information
run_inspect ns/multicluster-global-hub-agent
run_inspect ns/open-cluster-management-global-hub-agent-addon
# Get disconnected information
run_inspect imagecontentsourcepolicies.operator.openshift.io --all-namespaces
# version information
run_inspect clusterversions
run_inspect clusterserviceversions.operators.coreos.com -n "$HUB_NAMESPACE"
run_inspect packagemanifests.packages.operators.coreos.com advanced-cluster-management -n openshift-marketplace
# OpenShift console plug-in enablement
run_inspect consoles.operator.openshift.io
run_inspect consoleplugins.console.openshift.io
export GATHER_HUB_RAN=true
fi