zoukankan      html  css  js  c++  java
  • 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字段的使用

  • 相关阅读:
    函数进阶-生成器
    函数进阶-列表生成式
    闭包
    命名空间
    内置方法
    函数
    squid清除缓存
    subprocess实现管道
    Python统计脚本行数(fileinput)
    fabric note
  • 原文地址:https://www.cnblogs.com/zisefeizhu/p/13426862.html
Copyright © 2011-2022 走看看