0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

小ネタ kubernetes クラスタに手っ取り早く負荷をかける

Posted at

これは?

簡易的なk8sクラスタの負荷テストを行うため、stress-ngコマンドを実行するpodのデプロイメントを作成する備忘録

podのimageにはcontainerstack/cpustress
を使わせてもらった。

k8クラスタで負荷テスト・リソースを食いつぶした時の挙動、高負荷時でもUPSが耐えられるか?を確認したかった。

デプロイメントの作成

resources:, args:はお好みで

$ cat << EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cpustress
spec:
  selector:
    matchLabels:
      app: cpustress
  replicas: 1
  template:
    metadata:
      labels:
        app: cpustress
    spec:
      containers:
      - name: cpustress
        image: containerstack/cpustress
        args: [ "--cpu", "4", "--timeout", "72h", "--metrics-brief" ]
        resources: {}
EOF

スケール

お好みで

kubectl  scale  deployment cpustress --replicas 100
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?