Skip to content
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

fix: e2e test failure #2467

Merged
merged 6 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ kind: Service
metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics-no-node-pods
app.kubernetes.io/name: kube-state-metrics-unscheduled-pods-fetching
app.kubernetes.io/version: 2.13.0
name: kube-state-metrics-no-node-pods
name: kube-state-metrics-unscheduled-pods-fetching
namespace: kube-system
spec:
clusterIP: None
Expand All @@ -17,4 +17,4 @@ spec:
port: 8081
targetPort: telemetry
selector:
app.kubernetes.io/name: kube-state-metrics-no-node-pods
app.kubernetes.io/name: kube-state-metrics-unscheduled-pods-fetching
2 changes: 1 addition & 1 deletion jsonnet/kube-state-metrics/kube-state-metrics.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
'--track-unscheduled-pods',
],
};
local shardksmname = ksm.name + '-no-node-pods';
local shardksmname = ksm.name + '-unscheduled-pods-fetching';
std.mergePatch(
ksm.service,
{
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ function kube_pod_up() {
function test_daemonset() {
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/deployment.yaml
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/daemonset.yaml
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/deployment-no-node-pods.yaml
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/deployment-unscheduled-pods-fetching.yaml

kubectl get deployment -n kube-system
kubectl create -f ./examples/daemonsetsharding
kube_state_metrics_up kube-state-metrics-no-node-pods
kube_state_metrics_up kube-state-metrics-unscheduled-pods-fetching
kube_state_metrics_up kube-state-metrics
kube_state_metrics_up kube-state-metrics-shard
kubectl apply -f ./tests/e2e/testdata/pods.yaml
Expand All @@ -147,11 +147,11 @@ function test_daemonset() {
exit 1
fi

kubectl logs deployment/kube-state-metrics-no-node-pods -n kube-system
kubectl logs deployment/kube-state-metrics-unscheduled-pods-fetching -n kube-system
sleep 2
kubectl get pods -A --field-selector spec.nodeName=""
sleep 2
pendingpod2="$(curl -s "http://localhost:8001/api/v1/namespaces/kube-system/services/kube-state-metrics-no-node-pods:http-metrics/proxy/metrics" | grep "pendingpod2" | grep -c "kube_pod_info" )"
pendingpod2="$(curl -s "http://localhost:8001/api/v1/namespaces/kube-system/services/kube-state-metrics-unscheduled-pods-fetching:http-metrics/proxy/metrics" | grep "pendingpod2" | grep -c "kube_pod_info" )"
if [ "${pendingpod2}" != "${expected_num_pod}" ]; then
echo "metric kube_pod_info for pendingpod2 doesn't show up only once, got ${runningpod1} times"
exit 1
Expand Down