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 flaky target allocator tests #2615

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -7,7 +7,7 @@ automountServiceAccountToken: true
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pod-view
name: targetallocator-features
rules:
- apiGroups: [""]
resources: [ "pods", "namespaces" ]
Expand All @@ -19,7 +19,7 @@ rules:
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl -n $NAMESPACE create clusterrolebinding default-view-$NAMESPACE --clusterrole=pod-view --serviceaccount=$NAMESPACE:ta
- command: kubectl -n $NAMESPACE create clusterrolebinding default-view-$NAMESPACE --clusterrole=targetallocator-features --serviceaccount=$NAMESPACE:ta
# Annotate the namespace to allow the application to run using an specific group and user in OpenShift
# https://docs.openshift.com/dedicated/authentication/managing-security-context-constraints.html
# This annotation has no effect in Kubernetes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ automountServiceAccountToken: true
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ta
name: targetallocator-kubernetessd
rules:
- apiGroups: [""]
resources:
Expand Down Expand Up @@ -58,7 +58,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: collector
name: collector-kubernetessd
rules:
- apiGroups: [""]
resources:
Expand All @@ -84,8 +84,8 @@ rules:
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl create clusterrolebinding ta-$NAMESPACE --clusterrole=ta --serviceaccount=$NAMESPACE:ta
- command: kubectl create clusterrolebinding collector-$NAMESPACE --clusterrole=collector --serviceaccount=$NAMESPACE:collector
- command: kubectl create clusterrolebinding ta-$NAMESPACE --clusterrole=targetallocator-kubernetessd --serviceaccount=$NAMESPACE:ta
- command: kubectl create clusterrolebinding collector-$NAMESPACE --clusterrole=collector-kubernetessd --serviceaccount=$NAMESPACE:collector
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ spec:
args:
- /bin/sh
- -c
- curl -s http://prometheus-kubernetessd-collector:9090/metrics | grep "kubelet_running_pods{"
- |
for i in $(seq 30); do
if curl -m 1 -s http://prometheus-kubernetessd-collector:9090/metrics | grep "kubelet_running_pods"; then exit 0; fi
sleep 5
done
exit 1
---
apiVersion: batch/v1
kind: Job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ automountServiceAccountToken: true
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ta
name: targetallocator-prometheuscr
rules:
- apiGroups: [""]
resources:
Expand Down Expand Up @@ -65,7 +65,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: collector
name: collector-prometheuscr
rules:
- apiGroups: [""]
resources:
Expand All @@ -92,8 +92,8 @@ rules:
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl create clusterrolebinding ta-$NAMESPACE --clusterrole=ta --serviceaccount=$NAMESPACE:ta
- command: kubectl create clusterrolebinding collector-$NAMESPACE --clusterrole=collector --serviceaccount=$NAMESPACE:collector
- command: kubectl create clusterrolebinding ta-$NAMESPACE --clusterrole=targetallocator-prometheuscr --serviceaccount=$NAMESPACE:ta
- command: kubectl create clusterrolebinding collector-$NAMESPACE --clusterrole=collector-prometheuscr --serviceaccount=$NAMESPACE:collector
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
Expand Down
Loading