-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 使用单阶段构建,因为我们已经有了本地的k6二进制文件 | ||
|
||
# 基础镜像 | ||
FROM alpine:latest | ||
|
||
# 安装必要的依赖 | ||
RUN apk add --no-cache ca-certificates | ||
|
||
# 复制本地的k6 tar文件到镜像中 | ||
COPY k6-v0.49.0-linux-amd64.tar.gz /tmp/k6.tar.gz | ||
|
||
# 解压k6 tar文件,并将k6二进制文件移动到/usr/bin | ||
RUN tar -xzf /tmp/k6.tar.gz -C /tmp \ | ||
&& mv /tmp/k6-v0.49.0-linux-amd64/k6 /usr/bin/k6 \ | ||
&& rm -rf /tmp/k6-v0.49.0-linux-amd64 /tmp/k6.tar.gz | ||
|
||
# 验证k6安装 | ||
RUN k6 version | ||
|
||
# 将你的测试脚本复制到镜像中 | ||
COPY tests/simple.js /logstore-loggen-simple.js | ||
|
||
# 为你的镜像设置默认的运行命令 | ||
ENTRYPOINT ["k6", "run", "/logstore-loggen-simple.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: logstore-tester | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: logstore-tester | ||
template: | ||
metadata: | ||
labels: | ||
app: logstore-tester | ||
spec: | ||
containers: | ||
- name: logstore-tester | ||
image: garygao90/logstore-tester:latest | ||
# image: registry.cn-hangzhou.aliyuncs.com/insightmon/logstore-tester:v1.0.0 | ||
|
||
args: ["--vus", "10", "--duration", "1h"] | ||
# 根据需要添加环境变量 | ||
env: | ||
- name: LOGSTORE_URL | ||
value: "http://logstore-write:3100/logstore/api/v1/push" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: batch/v1beta1 | ||
kind: CronJob | ||
metadata: | ||
name: logstore-tester | ||
spec: | ||
# schedule: "0 */4 * * *" # 每 4 小时运行一次 | ||
schedule: "*/1 * * * *" # 每分钟运行一次 | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: logstore-tester | ||
image: registry.cn-hangzhou.aliyuncs.com/insightmon/logstore-tester:latest | ||
args: ["--vus", "10", "--duration", "1h"] | ||
# 环境变量 | ||
env: | ||
- name: LOGSTORE_URL | ||
value: "http://logstore-write:3100/logstore/api/v1/push" | ||
restartPolicy: OnFailure |
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.