Skip to content

Commit

Permalink
test(e2e): cut down resource limit
Browse files Browse the repository at this point in the history
  • Loading branch information
whg517 committed Dec 31, 2024
1 parent 073e250 commit 2d050f7
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 60 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ chainsaw-setup: ## Run the chainsaw setup

.PHONY: chainsaw-test
chainsaw-test: chainsaw ## Run the chainsaw test
- KUBECONFIG=$(KIND_KUBECONFIG) $(CHAINSAW) test --cluster cluster-1=$(KIND_KUBECONFIG) --test-dir ./test/e2e/tls
KUBECONFIG=$(KIND_KUBECONFIG) kubectl logs --tail=-1 -n secret-operator-system -l "app.kubernetes.io/name=secret-operator"
KUBECONFIG=$(KIND_KUBECONFIG) $(CHAINSAW) test --cluster cluster-1=$(KIND_KUBECONFIG) --test-dir ./test/e2e/tls

.PHONY: chainsaw-cleanup
chainsaw-cleanup: ## Run the chainsaw cleanup
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/krb5/krb5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ spec:
mountPath: /data
resources:
limits:
memory: "526Mi"
cpu: "300m"
memory: "128Mi"
cpu: "100m"
readinessProbe:
exec:
command:
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/krb5/node-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ spec:
value: /kubedoop/secret/krb5.conf
resources:
limits:
memory: "526Mi"
cpu: "500m"
memory: "50Mi"
cpu: "50m"
ports:
- containerPort: 80
protocol: TCP
Expand Down
5 changes: 2 additions & 3 deletions test/e2e/krb5/pod-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ spec:
value: /kubedoop/secret/krb5.conf
resources:
limits:
memory: "526Mi"
cpu: "500m"
memory: "50Mi"
cpu: "50m"
ports:
- containerPort: 80
protocol: TCP
name: http

volumeMounts:
- name: secret
mountPath: /kubedoop/secret
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/krb5/service-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ spec:
value: /kubedoop/secret/krb5.conf
resources:
limits:
memory: "200Mi"
cpu: "256m"
memory: "50Mi"
cpu: "50m"
volumeMounts:
- name: secret
mountPath: /kubedoop/secret
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/search-in-default-ns/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ kind: Pod
metadata:
name: search-ns
status:
phase: Running
phase: Succeeded
containerStatuses:
- name: pod
ready: true
restartCount: 0
started: true
19 changes: 7 additions & 12 deletions test/e2e/search-in-default-ns/01-pod-for-ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
labels:
name: search-ns
spec:
restartPolicy: Never
containers:
- name: pod
image: busybox:stable
Expand All @@ -15,24 +16,18 @@ spec:
- "sh"
- "-c"
- |
trap 'echo "Exiting..."; exit 1' SIGINT SIGTERM
echo "Loop is running... (Press Ctrl+C or send SIGTERM to exit)"
while true; do
# Continuous check /kubedoop/secret/mode exist
while ! test -f /kubedoop/secret/mode; do
sleep 1
tail -f /opt/secret/mode || (sleep 1 && echo 'Waiting for content...')
echo "Waiting for content..."
done
resources:
limits:
memory: "512Mi"
cpu: "500m"
memory: "50Mi"
cpu: "50m"
volumeMounts:
- name: secret
mountPath: /opt/secret
readinessProbe:
exec:
command: ["sh", "-c", "cat /opt/secret/mode | grep -q search-default-ns"]
initialDelaySeconds: 1
periodSeconds: 5
mountPath: /kubedoop/secret
volumes:
- name: secret
ephemeral:
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/search-in-default-ns/11-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ kind: Pod
metadata:
name: search-with-pod
status:
phase: Running
phase: Succeeded
containerStatuses:
- name: pod
ready: true
restartCount: 0
started: true
14 changes: 4 additions & 10 deletions test/e2e/search-in-default-ns/11-pod-for-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,18 @@ spec:
- "sh"
- "-c"
- |
trap 'echo "Exiting..."; exit 1' SIGINT SIGTERM
echo "Loop is running... (Press Ctrl+C or send SIGTERM to exit)"
while true; do
# Continuous check /kubedoop/secret/mode exist
while ! test -f /kubedoop/secret/mode; do
sleep 1
tail -f /opt/secret/mode || (sleep 1 && echo 'Waiting for content...')
echo "Waiting for content..."
done
resources:
limits:
memory: "512Mi"
cpu: "500m"
volumeMounts:
- name: secret
mountPath: /opt/secret
readinessProbe:
exec:
command: ["sh", "-c", "cat /opt/secret/mode | grep -q search-with-pod"]
initialDelaySeconds: 1
periodSeconds: 5
mountPath: /kubedoop/secret
volumes:
- name: secret
ephemeral:
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/search-in-default-ns/21-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ kind: Pod
metadata:
name: search-with-pod-scope
status:
phase: Running
phase: Succeeded
containerStatuses:
- name: pod
ready: true
restartCount: 0
started: true
18 changes: 6 additions & 12 deletions test/e2e/search-in-default-ns/21-pod-with-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,18 @@ spec:
- "sh"
- "-c"
- |
trap 'echo "Exiting..."; exit 1' SIGINT SIGTERM
echo "Loop is running... (Press Ctrl+C or send SIGTERM to exit)"
while true; do
# Continuous check /kubedoop/secret/mode exist
while ! test -f /kubedoop/secret/mode; do
sleep 1
tail -f /opt/secret/mode || (sleep 1 && echo 'Waiting for content...')
echo "Waiting for content..."
done
resources:
limits:
memory: "512Mi"
cpu: "500m"
memory: "50Mi"
cpu: "50m"
volumeMounts:
- name: secret
mountPath: /opt/secret
readinessProbe:
exec:
command: ["sh", "-c", "cat /opt/secret/mode | grep -q nginx-secret-pod-scope"]
initialDelaySeconds: 1
periodSeconds: 5
mountPath: /kubedoop/secret
volumes:
- name: secret
ephemeral:
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tls/tls-pkcs12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ spec:
resources:
limits:
memory: "512Mi"
cpu: "300m"
memory: "128Mi"
cpu: "100m"
securityContext:
runAsUser: 0
runAsGroup: 0
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tls/tls-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ spec:
fieldPath: metadata.namespace
resources:
limits:
memory: "512Mi"
cpu: "500m"
memory: "128Mi"
cpu: "100m"
command:
- /bin/bash
- -c
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tls/tls-will-expires.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ spec:
image: caddy:2
resources:
limits:
memory: "512Mi"
cpu: "500m"
memory: "128Mi"
cpu: "100m"
ports:
- containerPort: 80
name: http
Expand Down

0 comments on commit 2d050f7

Please sign in to comment.