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

Add antrea scale test tool #5772

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ antrea-agent-simulator:
@mkdir -p $(BINDIR)
GOOS=linux $(GO) build -o $(BINDIR) $(GOFLAGS) -ldflags '$(LDFLAGS)' antrea.io/antrea/cmd/antrea-agent-simulator

.PHONY: antrea-scale
antrea-scale:
@mkdir -p $(BINDIR)
GOOS=linux $(GO) build -o $(BINDIR) $(GOFLAGS) -ldflags '$(LDFLAGS)' antrea.io/antrea/cmd/antrea-scale

.PHONY: antrea-agent-instr-binary
antrea-agent-instr-binary:
@mkdir -p $(BINDIR)
Expand Down Expand Up @@ -363,6 +368,12 @@ build-agent-ubuntu:
.PHONY: build-ubuntu
build-ubuntu: build-agent-ubuntu build-controller-ubuntu

.PHONY: build-antrea-scale
build-antrea-scale:
@echo "===> Building antrea/antrea-scale Docker image <==="
docker build -t antrea/antrea-scale:$(DOCKER_IMG_VERSION) -f build/images/Dockerfile.scale .
docker tag antrea/antrea-scale:$(DOCKER_IMG_VERSION) antrea/antrea-scale

.PHONY: build-ubi
build-ubi: build-agent-ubi build-controller-ubi

Expand Down
26 changes: 26 additions & 0 deletions build/images/Dockerfile.scale
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Antrea Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE=ubuntu:22.04
FROM ${BASE_IMAGE}

LABEL maintainer="Antrea <projectantrea-dev@googlegroups.com>"
LABEL description="Antrea scale test image."

USER root

WORKDIR /antrea

COPY test/performance/scale.yml .
wenqiq marked this conversation as resolved.
Show resolved Hide resolved
COPY bin/antrea-scale /usr/local/bin
171 changes: 171 additions & 0 deletions build/yamls/antrea-scale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: antrea-scale
namespace: default
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: antrea-scale
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- watch
- list
- apiGroups:
- ""
resources:
- pods
- endpoints
- services
- namespaces
verbs:
- create
- get
- watch
- list
- delete
- deletecollection
- apiGroups:
- ""
resources:
- pods/exec
verbs:
- create
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- replicasets
verbs:
- create
- get
- delete
- list
- apiGroups:
- networking.k8s.io
resources:
- networkpolicies
verbs:
- get
- watch
- list
- create
- delete
- deletecollection
- apiGroups:
- crd.antrea.io
resources:
- antreaagentinfos
verbs:
- get
- create
- update
- delete
- apiGroups:
- controlplane.antrea.io
resources:
- networkpolicies
- appliedtogroups
- addressgroups
verbs:
- get
- watch
- list
- apiGroups:
- controlplane.antrea.io
resources:
- nodestatssummaries
verbs:
- create
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- ""
resourceNames:
- extension-apiserver-authentication
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- antrea-ca
verbs:
- get
- watch
- list
- apiGroups:
- ops.antrea.tanzu.vmware.com
resources:
- traceflows
- traceflows/status
verbs:
- get
- watch
- list
- update
- patch
- create
- delete
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: antrea-scale
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: antrea-scale
subjects:
- kind: ServiceAccount
name: antrea-scale
namespace: default
---
apiVersion: batch/v1
kind: Job
metadata:
name: antrea-scale
spec:
template:
metadata:
name: antrea-scale
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: antrea/instance
operator: NotIn
values:
- simulator
containers:
- name: antrea-scale
image: antrea/antrea-scale:latest
imagePullPolicy: IfNotPresent
command: ["antrea-scale"]
args:
- "--config=scale.yml"
serviceAccountName: antrea-scale
restartPolicy: Never
priorityClassName: system-node-critical
nodeSelector:
kubernetes.io/os: linux
backoffLimit: 1
2 changes: 2 additions & 0 deletions ci/jenkins/jobs/macros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,5 @@
#!/bin/bash
set -e
./ci/jenkins/stop-stale-jobs.sh --pull-request "${ghprbPullId}" --jenkins "${JENKINS_URL}"

#
1 change: 1 addition & 0 deletions ci/jenkins/jobs/projects-lab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1485,3 +1485,4 @@
timeout: 135
type: absolute
publishers: []
#
Loading
Loading