Skip to content

Commit 19b8799

Browse files
Merge pull request #257 from PannagaRao/must-gather
Custom must gather image
2 parents 7f8d7d0 + 1a9a34a commit 19b8799

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed

Makefile

+35
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ OPERATOR_VERSION ?= 0.0.1
1818
OPERATOR_IMAGE ?= mustchange
1919
BUNDLE_IMAGE ?= mustchange
2020
KUEUE_IMAGE ?= mustchange
21+
MUST_GATHER_IMAGE ?= https://quay.io/redhat-user-workloads/kueue-operator-tenant/kueue-must-gather:latest
2122

2223
KUBECONFIG ?= ${HOME}/.kube/config
2324

@@ -246,3 +247,37 @@ e2e-tech-preview-upstream-test: wait-for-image deploy-cert-manager wait-for-cert
246247
@rm -rf $(TEMP_DIR)
247248
make undeploy-ocp
248249
@rm -f .kueue_image
250+
251+
.PHONY: e2e-tech-preview-test
252+
e2e-tech-preview-test: wait-for-image deploy-cert-manager ginkgo
253+
@echo "Running operator e2e tests with released images..."
254+
export KUEUE_IMAGE=registry.redhat.io/kueue-tech-preview/kueue-rhel9@sha256:d0d6c34952e3d60be62fe7add33aa7ae2b0ac5c1bd2592e319f4cc28b2a2783e
255+
$(GINKGO) -v ./test/e2e/...
256+
make undeploy-ocp
257+
@rm -f .kueue_image
258+
259+
.PHONY: e2e-tech-preview-upstream-test
260+
e2e-tech-preview-upstream-test: wait-for-image deploy-cert-manager wait-for-cert-manager deploy-ocp
261+
@echo "Running upstream e2e tests with released images..."
262+
export KUEUE_IMAGE=registry.redhat.io/kueue-tech-preview/kueue-rhel9@sha256:d0d6c34952e3d60be62fe7add33aa7ae2b0ac5c1bd2592e319f4cc28b2a2783e
263+
cd $(TEMP_DIR) && KUEUE_NAMESPACE="openshift-kueue-operator" make -f Makefile-test-ocp.mk test-e2e-upstream-ocp
264+
@echo "Cleaning up TEMP_DIR: $(TEMP_DIR)"
265+
@rm -rf $(TEMP_DIR)
266+
make undeploy-ocp
267+
@rm -f .kueue_image
268+
269+
.PHONY: build-must
270+
build-must:
271+
$(CONTAINER_TOOL) build -f must-gather/Dockerfile -t $(MUST_GATHER_IMAGE) .
272+
273+
.PHONY: push-must
274+
push-must:
275+
$(CONTAINER_TOOL) push $(MUST_GATHER_IMAGE)
276+
277+
.PHONY: run-must
278+
run-must:
279+
oc adm must-gather --image=$(MUST_GATHER_IMAGE)
280+
281+
.PHONY: clean-must
282+
clean-must:
283+
-$(CONTAINER_TOOL) rmi $(MUST_GATHER_IMAGE) || true

must-gather/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM quay.io/openshift/origin-must-gather:latest as builder
2+
3+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
4+
5+
RUN microdnf update -y && microdnf install tar rsync bash -y && microdnf clean all
6+
7+
COPY --from=builder /usr/bin/oc /usr/bin/oc
8+
COPY --from=builder /usr/bin/gather /usr/bin/gather_original
9+
10+
# COPY must-gather/collection-scripts/gather /gather
11+
# COPY must-gather/collection-scripts/gather-kueue.sh /gather-kueue.sh
12+
13+
COPY must-gather/collection-scripts/gather /usr/bin/gather
14+
COPY must-gather/collection-scripts/gather-kueue /usr/bin/gather-kueue
15+
16+
# RUN chmod +x /gather /gather-kueue.sh
17+
RUN chmod +x /usr/bin/gather /usr/bin/gather-kueue
18+
19+
# ENTRYPOINT /usr/bin/gather
20+
# ENTRYPOINT ["/gather"]
21+
CMD ["/bin/bash", "/usr/bin/gather"]

must-gather/collection-scripts/gather

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
4+
OUTPUT_DIR=${OUTPUT_DIR:-/must-gather}
5+
KUEUE_NS=openshift-kueue-operator
6+
7+
echo "[INFO] Gathering Kueue-specific resources from namespace: ${KUEUE_NS}"
8+
mkdir -p ${OUTPUT_DIR}/kueue
9+
10+
/usr/bin/gather-kueue "${KUEUE_NS}" "${OUTPUT_DIR}/kueue"
11+
12+
echo "[INFO] Kueue must-gather complete."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
4+
NAMESPACE="$1"
5+
OUT="$2"
6+
7+
mkdir -p "${OUT}"
8+
9+
echo "[INFO] Collecting Kueue Custom Resources"
10+
oc get workloads -A -o yaml > "${OUT}/workloads.yaml" || true
11+
oc get clusterqueues -A -o yaml > "${OUT}/clusterqueues.yaml" || true
12+
oc get localqueues -A -o yaml > "${OUT}/localqueues.yaml" || true
13+
oc get resourceflavors -A -o yaml > "${OUT}/resourceflavors.yaml" || true
14+
oc get admissionchecks -A -o yaml > "${OUT}/admissionchecks.yaml" || true
15+
16+
echo "[INFO] Collecting CRD Definitions"
17+
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
18+
oc get crd "$crd" -o yaml > "${OUT}/crd-${crd}.yaml" || true
19+
done
20+
21+
echo "[INFO] Collecting Services and Endpoints"
22+
oc get services -n "${NAMESPACE}" -o yaml > "${OUT}/services.yaml" || true
23+
oc get endpoints -n "${NAMESPACE}" -o yaml > "${OUT}/endpoints.yaml" || true
24+
25+
for svc in kueue-controller-manager-metrics-service kueue-webhook-service kueue-visibility-server; do
26+
oc describe service "$svc" -n "${NAMESPACE}" > "${OUT}/describe-svc-${svc}.txt" || true
27+
done
28+
29+
echo "[INFO] Collecting Webhook Configurations"
30+
oc get mutatingwebhookconfiguration -o yaml > "${OUT}/mutatingwebhookconfiguration.yaml" || true
31+
oc get validatingwebhookconfiguration -o yaml > "${OUT}/validatingwebhookconfiguration.yaml" || true
32+
33+
echo "[INFO] Collecting Operator Deployment Pod Logs"
34+
for pod in $(oc get pods -n "${NAMESPACE}" -l name=openshift-kueue-operator -o jsonpath='{.items[*].metadata.name}'); do
35+
oc logs -n "${NAMESPACE}" "$pod" > "${OUT}/logs-operator-${pod}.log" || true
36+
done
37+
38+
echo "[INFO] Collecting kueue-controller-manager Pod Logs"
39+
for pod in $(oc get pods -n "${NAMESPACE}" -l control-plane=controller-manager -o jsonpath='{.items[*].metadata.name}'); do
40+
oc logs -n "${NAMESPACE}" "$pod" > "${OUT}/logs-controller-manager-${pod}.log" || true
41+
done
42+
43+
echo "[INFO] Collecting Deployments"
44+
oc get deployment openshift-kueue-operator -n "${NAMESPACE}" -o yaml > "${OUT}/deployment-openshift-kueue-operator.yaml" || true
45+
oc get deployment kueue-controller-manager -n "${NAMESPACE}" -o yaml > "${OUT}/deployment-kueue-controller-manager.yaml" || true
46+
47+
echo "[INFO] Collecting RBAC"
48+
oc get serviceaccount -n "${NAMESPACE}" -o yaml > "${OUT}/serviceaccounts.yaml" || true
49+
oc get role -n "${NAMESPACE}" -o yaml > "${OUT}/roles.yaml" || true
50+
oc get rolebinding -n "${NAMESPACE}" -o yaml > "${OUT}/rolebindings.yaml" || true
51+
52+
echo "[INFO] Kueue must-gather collection completed successfully."

0 commit comments

Comments
 (0)