-
Notifications
You must be signed in to change notification settings - Fork 217
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
test(poc): add scale test using clusterloader2 #1154
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: test | ||
namespace: | ||
number: 1 | ||
prefix: traffic | ||
tuningSets: | ||
- name: Uniform1qps | ||
qpsLoad: | ||
qps: 1 | ||
- name: Uniform500qps | ||
qpsLoad: | ||
qps: 500 | ||
steps: | ||
- name: Start measurements | ||
measurements: | ||
- Identifier: WaitForControlledPodsRunning | ||
Method: WaitForControlledPodsRunning | ||
Params: | ||
action: start | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
labelSelector: is-real = true | ||
operationTimeout: 120s | ||
- module: | ||
path: /traffic/kapinger.yaml | ||
params: | ||
namespace: traffic-1 | ||
tuningSet: Uniform500qps | ||
deployments: 10 | ||
podReplicas: 5 | ||
- name: Wait for pods to be running | ||
measurements: | ||
- Identifier: WaitForControlledPodsRunning | ||
Method: WaitForControlledPodsRunning | ||
Params: | ||
action: gather |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{.Name}} | ||
labels: | ||
app: kapinger | ||
spec: | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
podSelector: | ||
matchLabels: | ||
shared-N: N | ||
unique-dep-label: "{{.Index}}" | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
app: shared-{{???}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
## Kapinger module creates kapinger components | ||
|
||
# Namespaces where kapinger will be deployed to | ||
{{$namespace := DefaultParam .namespace "traffic-1"}} | ||
# Tuning set | ||
{{$tuningSet := DefaultParam .tuningSet "Uniform500qps"}} | ||
# Number of deployments | ||
{{$deployments := DefaultParam .deployments 1000}} | ||
# Number of pods per deploymen | ||
{{$podReplicas := DefaultParam .podReplicas 20}} | ||
|
||
steps: | ||
- name: Create service accounts | ||
phases: | ||
- namespaceList: | ||
- {{$namespace}} | ||
replicasPerNamespace: 1 | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger-sa | ||
objectTemplatePath: "traffic/kapinger/sa.yaml" | ||
- name: Create cluster role | ||
phases: | ||
- namespaceList: | ||
- "" | ||
replicasPerNamespace: 1 | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger-role | ||
objectTemplatePath: "traffic/kapinger/role.yaml" | ||
- name: Create cluster role binding | ||
phases: | ||
- namespaceList: | ||
- "" | ||
replicasPerNamespace: 1 | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger-rolebinding | ||
objectTemplatePath: "traffic/kapinger/rolebinding.yaml" | ||
templateFillMap: | ||
subjectNamespace: {{$namespace}} | ||
- name: Create deployments | ||
phases: | ||
- namespaceList: | ||
- {{$namespace}} | ||
replicasPerNamespace: {{$deployments}} | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger | ||
objectTemplatePath: "traffic/kapinger/deployment.yaml" | ||
templateFillMap: | ||
Replicas: {{$podReplicas}} | ||
- name: Create services | ||
phases: | ||
- namespaceList: | ||
- {{$namespace}} | ||
replicasPerNamespace: {{$deployments}} | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger | ||
objectTemplatePath: "traffic/kapinger/svc.yaml" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{.Name}} | ||
labels: | ||
is-real: "true" | ||
spec: | ||
replicas: {{.Replicas}} | ||
selector: | ||
matchLabels: | ||
app: kapinger | ||
template: | ||
metadata: | ||
labels: | ||
app: kapinger | ||
is-real: "true" | ||
unique-dep-label: "{{.Index}}" | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
scale-test: "true" | ||
kubernetes.io/arch: amd64 | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 100 | ||
podAffinityTerm: | ||
topologyKey: kubernetes.io/hostname | ||
labelSelector: | ||
matchLabels: | ||
app: kapinger | ||
serviceAccountName: kapinger-sa-0 | ||
containers: | ||
- image: acnpublic.azurecr.io/kapinger:20241014.7 | ||
name: kapinger | ||
resources: | ||
limits: | ||
memory: 80Mi | ||
requests: | ||
memory: 20Mi | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: GODEBUG | ||
value: "netdns=go" | ||
- name: TARGET_TYPE | ||
value: "service" | ||
- name: HTTP_PORT | ||
value: "8080" | ||
- name: TCP_PORT | ||
value: "8085" | ||
- name: UDP_PORT | ||
value: "8086" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: kapinger-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
- pods | ||
verbs: | ||
- get | ||
- list |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kapinger-rolebinding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kapinger-sa-0 | ||
namespace: {{.subjectNamespace}} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kapinger-role-0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kapinger-sa |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{.Name}} | ||
labels: | ||
app: kapinger | ||
spec: | ||
selector: | ||
app: kapinger | ||
unique-dep-label: "{{.Index}}" | ||
ports: | ||
- port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Set environment variables | ||
description: Set environment variables | ||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
env: | ||
RUN_ID: ${{ github.run_id }} | ||
RUN_ATTEMPT: ${{ github.run_attempt }} | ||
# TODO: fix env vars | ||
run: | | ||
echo "RESOURCE_GROUP=lx-retina-e2e-tests" >> $GITHUB_ENV | ||
echo "LOCATION=westus2" >> $GITHUB_ENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hardcoding locations has been problematic in the past, especially when we reach quota There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this is just a placeholder for the step to show general idea. |
||
echo "CLUSTER_NAME=lx-retina-e2e-tests" >> $GITHUB_ENV | ||
# echo "CLUSTER_NAME=retina-e2e-tests-${RUN_ID}-${RUN_ATTEMPT}" >> $GITHUB_ENV | ||
echo "VM_SIZE=Standard_D4_v3" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to reuse a kapinger deployment elsewhere?
retina/test/trafficgen/kapinger.yaml
Line 20 in f574448
if we have to rev the kapinger image it's getting unwieldy to track down everywhere it's used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's called from go code, it could be rendered using go template to fill in the values before sending to kubeAPI. But to use the yaml directly (e.g.
kubectl apply -f kapigner.yaml
) I think it would not be possible, because of the placeholders for go template.