kubernetes:基于ab的压力测试

基于ab的压力测试

# cat apache-test.yaml 
##########################################################################
#Author:                     zisefeizhu
#QQ:                         2********0
#Date:                       2020-08-03
#FileName:                   apache-test.yaml
#URL:                        https://www.cnblogs.com/zisefeizhu/
#Description:                The test script
#Copyright (C):              2020 All rights reserved
###########################################################################
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: apache
  namespace: default
  labels:
    name: apache

spec:
  #replicas: 3  #起的pod数    
  selector:
    matchLabels:
      name: apache
  template:
    metadata:
      labels:
        name: apache
    spec:
      containers:
      - name: apache
        image: httpd   #使用镜像
        command: ["ab","-c 30","-n 100000"]    #执行命令
        args: ["https://xxx.xxxxx.com/"]    #压测域名
        ports:
        - name: http
          containerPort: 80

写此的主要原因是在于spec.template.containers. 下的command和args字段的使用

posted @ 2020-08-03 16:09  紫色飞猪  阅读(778)  评论(0编辑  收藏  举报