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

test(poc): add scale test using clusterloader2 #1154

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
35 changes: 35 additions & 0 deletions .github/actions/cl2/config.yaml
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
19 changes: 19 additions & 0 deletions .github/actions/cl2/network-policy.yaml
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-{{???}}
61 changes: 61 additions & 0 deletions .github/actions/cl2/traffic/kapinger.yaml
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"
54 changes: 54 additions & 0 deletions .github/actions/cl2/traffic/kapinger/deployment.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"

13 changes: 13 additions & 0 deletions .github/actions/cl2/traffic/kapinger/role.yaml
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
12 changes: 12 additions & 0 deletions .github/actions/cl2/traffic/kapinger/rolebinding.yaml
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
4 changes: 4 additions & 0 deletions .github/actions/cl2/traffic/kapinger/sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: kapinger-sa
14 changes: 14 additions & 0 deletions .github/actions/cl2/traffic/kapinger/svc.yaml
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
16 changes: 16 additions & 0 deletions .github/actions/set-env-variables/action.yaml
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
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
Loading
Loading