-
Notifications
You must be signed in to change notification settings - Fork 11
Custom must gather image #257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM quay.io/openshift/origin-must-gather:latest as builder | ||
|
||
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 | ||
|
||
RUN microdnf update -y && microdnf install tar rsync bash -y && microdnf clean all | ||
|
||
COPY --from=builder /usr/bin/oc /usr/bin/oc | ||
COPY --from=builder /usr/bin/gather /usr/bin/gather_original | ||
|
||
# COPY must-gather/collection-scripts/gather /gather | ||
# COPY must-gather/collection-scripts/gather-kueue.sh /gather-kueue.sh | ||
|
||
COPY must-gather/collection-scripts/gather /usr/bin/gather | ||
COPY must-gather/collection-scripts/gather-kueue /usr/bin/gather-kueue | ||
|
||
# RUN chmod +x /gather /gather-kueue.sh | ||
RUN chmod +x /usr/bin/gather /usr/bin/gather-kueue | ||
|
||
# ENTRYPOINT /usr/bin/gather | ||
# ENTRYPOINT ["/gather"] | ||
CMD ["/bin/bash", "/usr/bin/gather"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
OUTPUT_DIR=${OUTPUT_DIR:-/must-gather} | ||
KUEUE_NS=openshift-kueue-operator | ||
|
||
echo "[INFO] Gathering Kueue-specific resources from namespace: ${KUEUE_NS}" | ||
mkdir -p ${OUTPUT_DIR}/kueue | ||
|
||
/usr/bin/gather-kueue "${KUEUE_NS}" "${OUTPUT_DIR}/kueue" | ||
|
||
echo "[INFO] Kueue must-gather complete." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
NAMESPACE="$1" | ||
OUT="$2" | ||
|
||
mkdir -p "${OUT}" | ||
|
||
echo "[INFO] Collecting Kueue Custom Resources" | ||
oc get workloads -A -o yaml > "${OUT}/workloads.yaml" || true | ||
oc get clusterqueues -A -o yaml > "${OUT}/clusterqueues.yaml" || true | ||
oc get localqueues -A -o yaml > "${OUT}/localqueues.yaml" || true | ||
oc get resourceflavors -A -o yaml > "${OUT}/resourceflavors.yaml" || true | ||
oc get admissionchecks -A -o yaml > "${OUT}/admissionchecks.yaml" || true | ||
|
||
echo "[INFO] Collecting CRD Definitions" | ||
for crd in clusterqueues.kueue.x-k8s.io localqueues.kueue.x-k8s.io workloads.kueue.x-k8s.io resourceflavors.kueue.x-k8s.io admissionchecks.kueue.x-k8s.io; do | ||
oc get crd "$crd" -o yaml > "${OUT}/crd-${crd}.yaml" || true | ||
done | ||
|
||
echo "[INFO] Collecting Services and Endpoints" | ||
oc get services -n "${NAMESPACE}" -o yaml > "${OUT}/services.yaml" || true | ||
oc get endpoints -n "${NAMESPACE}" -o yaml > "${OUT}/endpoints.yaml" || true | ||
|
||
for svc in kueue-controller-manager-metrics-service kueue-webhook-service kueue-visibility-server; do | ||
oc describe service "$svc" -n "${NAMESPACE}" > "${OUT}/describe-svc-${svc}.txt" || true | ||
done | ||
|
||
echo "[INFO] Collecting Webhook Configurations" | ||
oc get mutatingwebhookconfiguration -o yaml > "${OUT}/mutatingwebhookconfiguration.yaml" || true | ||
oc get validatingwebhookconfiguration -o yaml > "${OUT}/validatingwebhookconfiguration.yaml" || true | ||
|
||
echo "[INFO] Collecting Operator Deployment Pod Logs" | ||
for pod in $(oc get pods -n "${NAMESPACE}" -l name=openshift-kueue-operator -o jsonpath='{.items[*].metadata.name}'); do | ||
oc logs -n "${NAMESPACE}" "$pod" > "${OUT}/logs-operator-${pod}.log" || true | ||
done | ||
|
||
echo "[INFO] Collecting kueue-controller-manager Pod Logs" | ||
for pod in $(oc get pods -n "${NAMESPACE}" -l control-plane=controller-manager -o jsonpath='{.items[*].metadata.name}'); do | ||
oc logs -n "${NAMESPACE}" "$pod" > "${OUT}/logs-controller-manager-${pod}.log" || true | ||
done | ||
|
||
echo "[INFO] Collecting Deployments" | ||
oc get deployment openshift-kueue-operator -n "${NAMESPACE}" -o yaml > "${OUT}/deployment-openshift-kueue-operator.yaml" || true | ||
oc get deployment kueue-controller-manager -n "${NAMESPACE}" -o yaml > "${OUT}/deployment-kueue-controller-manager.yaml" || true | ||
|
||
echo "[INFO] Collecting RBAC" | ||
oc get serviceaccount -n "${NAMESPACE}" -o yaml > "${OUT}/serviceaccounts.yaml" || true | ||
oc get role -n "${NAMESPACE}" -o yaml > "${OUT}/roles.yaml" || true | ||
oc get rolebinding -n "${NAMESPACE}" -o yaml > "${OUT}/rolebindings.yaml" || true | ||
|
||
echo "[INFO] Kueue must-gather collection completed successfully." |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.