Skip to content

Commit

Permalink
Merge pull request #553 from Kuadrant/local-perf
Browse files Browse the repository at this point in the history
Add initial kube-burner config and readme for perf testing
  • Loading branch information
trepel authored Oct 15, 2024
2 parents 6f54c6c + 580c9bb commit fff3377
Show file tree
Hide file tree
Showing 15 changed files with 496 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scale_test/aws-credentials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
kind: Secret
apiVersion: v1
metadata:
name: aws-credentials
labels:
app: scale-test
stringData:
AWS_ACCESS_KEY_ID: {{ .KUADRANT_AWS_ACCESS_KEY_ID }}
AWS_REGION: {{ .KUADRANT_AWS_REGION }}
AWS_SECRET_ACCESS_KEY: {{ .KUADRANT_AWS_SECRET_ACCESS_KEY }}
type: kuadrant.io/aws
106 changes: 106 additions & 0 deletions scale_test/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
metricsEndpoints:
- endpoint: {{ .PROMETHEUS_URL }}
token: {{ .PROMETHEUS_TOKEN }}
metrics:
- ./metrics.yaml
{{ if .OS_INDEXING }}
indexer:
type: opensearch
esServers: ["{{ .ES_SERVER }}"]
insecureSkipVerify: true
defaultIndex: kube-burner
{{ else }}
indexer:
type: local
metricsDirectory: ./metrics
{{ end }}
global:
gc: true
jobs:
- name: scale-test-preparations
jobIterations: 1
qps: 1
burst: 1
namespacedIterations: true
namespace: scale-test
waitWhenFinished: true
objects:
- objectTemplate: ./httpbin-deployment.yaml
kind: Deployment
replicas: 1
waitOptions:
forCondition: "Available"
customStatusPath: ".conditions[].type"
- objectTemplate: ./httpbin-service.yaml
kind: Service
replicas: 1
- objectTemplate: ./aws-credentials.yaml
kind: Secret
replicas: 1
inputVars:
KUADRANT_AWS_ACCESS_KEY_ID: "{{ .KUADRANT_AWS_ACCESS_KEY_ID }}"
KUADRANT_AWS_REGION: "{{ .KUADRANT_AWS_REGION }}"
KUADRANT_AWS_SECRET_ACCESS_KEY: "{{ .KUADRANT_AWS_SECRET_ACCESS_KEY }}"
- name: scale-test-main
jobIterations: 1
qps: 1
burst: 1
namespacedIterations: true
namespace: scale-test
waitWhenFinished: true
objects:
- objectTemplate: ./gw.yaml
replicas: 1
waitOptions:
forCondition: Programmed
customStatusPath: ".conditions[].type"
inputVars:
KUADRANT_ZONE_ROOT_DOMAIN: "{{ .KUADRANT_ZONE_ROOT_DOMAIN }}"
- objectTemplate: ./gw-tls-policy.yaml
replicas: 1
waitOptions:
forCondition: Enforced
customStatusPath: ".conditions[].type"
- objectTemplate: ./gw-dns-policy.yaml
replicas: 1
waitOptions:
forCondition: Enforced
customStatusPath: ".conditions[].type"
- objectTemplate: ./gw-rlp.yaml
replicas: 1
waitOptions:
forCondition: Accepted
customStatusPath: ".conditions[].type"
- objectTemplate: ./gw-auth-policy.yaml
replicas: 1
waitOptions:
forCondition: Accepted
customStatusPath: ".conditions[].type"
- objectTemplate: ./httproute.yaml
replicas: 1
waitOptions:
forCondition: Accepted
customStatusPath: ".conditions[].type"
inputVars:
KUADRANT_ZONE_ROOT_DOMAIN: "{{ .KUADRANT_ZONE_ROOT_DOMAIN }}"
- objectTemplate: ./httproute-rlp.yaml
replicas: 1
waitOptions:
forCondition: Enforced
customStatusPath: ".conditions[].type"
- objectTemplate: ./httproute-auth-policy.yaml
replicas: 1
waitOptions:
forCondition: Enforced
customStatusPath: ".conditions[].type"
- name: scale-test-safe-dnspolicy-cleanup
jobType: delete
jobIterations: 1
namespacedIterations: true
namespace: scale-test
waitWhenFinished: true
objects:
- kind: DNSPolicy
apiVersion: kuadrant.io/v1alpha1
labelSelector: {kube-burner-job: scale-test-main}
27 changes: 27 additions & 0 deletions scale_test/gw-auth-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: kuadrant.io/v1beta2
kind: AuthPolicy
metadata:
name: gw-auth-policy-{{.Iteration}}
labels:
app: scale-test
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: scale-test-{{.Iteration}}
rules:
authorization:
deny-all:
opa:
rego: "allow = false"
response:
unauthorized:
headers:
"content-type":
value: application/json
body:
value: |
{
"error": "Forbidden",
"message": "Access denied by default by the gateway operator. If you are the administrator of the service, create a specific auth policy for the route."
}
13 changes: 13 additions & 0 deletions scale_test/gw-dns-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kuadrant.io/v1alpha1
kind: DNSPolicy
metadata:
name: gw-dns-policy-{{.Iteration}}
labels:
app: scale-test
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: scale-test-{{.Iteration}}
providerRefs:
- name: aws-credentials
17 changes: 17 additions & 0 deletions scale_test/gw-rlp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kuadrant.io/v1beta3
kind: RateLimitPolicy
metadata:
name: gw-rlp-{{.Iteration}}
labels:
app: scale-test
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: scale-test-{{.Iteration}}
limits:
"global":
rates:
- limit: 5
duration: 10
unit: second
15 changes: 15 additions & 0 deletions scale_test/gw-tls-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kuadrant.io/v1alpha1
kind: TLSPolicy
metadata:
name: gw-tls-policy-{{.Iteration}}
labels:
app: scale-test
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: scale-test-{{.Iteration}}
issuerRef:
group: cert-manager.io
kind: ClusterIssuer
name: selfsigned-issuer
21 changes: 21 additions & 0 deletions scale_test/gw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: scale-test-{{.Iteration}}
labels:
app: scale-test
spec:
gatewayClassName: istio
listeners:
- allowedRoutes:
namespaces:
from: All
hostname: "*.scale-test-{{.Iteration}}.{{ .KUADRANT_ZONE_ROOT_DOMAIN }}"
name: api
port: 443
protocol: HTTPS
tls:
mode: Terminate
certificateRefs:
- name: scale-test-{{.Iteration}}
kind: Secret
24 changes: 24 additions & 0 deletions scale_test/httpbin-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: httpbin
labels:
app: scale-test
spec:
replicas: 1
selector:
matchLabels:
app: scale-test
template:
metadata:
labels:
app: scale-test
spec:
containers:
- name: httpbin
image: 'quay.io/trepel/httpbin:jsmadis'
ports:
- name: api
containerPort: 8080
protocol: TCP
15 changes: 15 additions & 0 deletions scale_test/httpbin-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
kind: Service
apiVersion: v1
metadata:
name: httpbin
labels:
app: scale-test
spec:
ports:
- name: http
protocol: TCP
port: 8080
targetPort: api
selector:
app: scale-test
16 changes: 16 additions & 0 deletions scale_test/httproute-auth-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: kuadrant.io/v1beta2
kind: AuthPolicy
metadata:
name: httproute-auth-policy-{{.Iteration}}
labels:
app: scale-test
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: scale-test-{{.Iteration}}
rules:
authorization:
allow-all:
opa:
rego: "allow = true"
17 changes: 17 additions & 0 deletions scale_test/httproute-rlp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kuadrant.io/v1beta3
kind: RateLimitPolicy
metadata:
name: httproute-rlp-{{.Iteration}}
labels:
app: scale-test
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: scale-test-{{.Iteration}}
limits:
"httproute-level":
rates:
- limit: 10
duration: 10
unit: second
24 changes: 24 additions & 0 deletions scale_test/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: scale-test-{{.Iteration}}
labels:
app: scale-test
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: scale-test-{{.Iteration}}
hostnames:
- "api-{{.Iteration}}.scale-test-{{.Iteration}}.{{ .KUADRANT_ZONE_ROOT_DOMAIN }}"
rules:
- backendRefs:
- group: ''
kind: Service
name: httpbin
port: 8080
weight: 1
matches:
- path:
type: PathPrefix
value: /
Loading

0 comments on commit fff3377

Please sign in to comment.