From 688f020031489a6ecdf2afea92323a8f2d99d80b Mon Sep 17 00:00:00 2001 From: wojtekt Date: Mon, 30 Mar 2020 21:31:01 +0200 Subject: [PATCH] Load test: Each deployment has secret & configmap, 90% is immutable. --- clusterloader2/testing/load/configmap.yaml | 3 +++ clusterloader2/testing/load/deployment.yaml | 8 -------- clusterloader2/testing/load/secret.yaml | 3 +++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/clusterloader2/testing/load/configmap.yaml b/clusterloader2/testing/load/configmap.yaml index b249a3914..cb0f9f9b5 100644 --- a/clusterloader2/testing/load/configmap.yaml +++ b/clusterloader2/testing/load/configmap.yaml @@ -2,6 +2,9 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{.Name}} +{{if not (eq (Mod .Index 20) 0 19) }} # .Index % 20 in {0,19} - only 10% deployments will have non-immutable ConfigMap. +immutable: true +{{end}} data: data.yaml: |- a: 1 diff --git a/clusterloader2/testing/load/deployment.yaml b/clusterloader2/testing/load/deployment.yaml index 7ede0d054..17c0d2404 100644 --- a/clusterloader2/testing/load/deployment.yaml +++ b/clusterloader2/testing/load/deployment.yaml @@ -28,14 +28,10 @@ spec: cpu: {{$CpuRequest}} memory: {{$MemoryRequest}} volumeMounts: - {{if (eq (Mod .Index 20) 0 19) }} # .Index % 20 in {0,19} - 10% deployments will have ConfigMap - name: configmap mountPath: /var/configmap - {{end}} - {{if (eq (Mod .Index 20) 10 19) }} # .Index % 20 in {10,19} - 10% deployments will have Secret - name: secret mountPath: /var/secret - {{end}} dnsPolicy: Default terminationGracePeriodSeconds: 1 # Add not-ready/unreachable tolerations for 15 minutes so that node @@ -50,14 +46,10 @@ spec: effect: "NoExecute" tolerationSeconds: 900 volumes: - {{if (eq (Mod .Index 20) 0 19) }} # .Index % 20 in {0,19} - 10% deployments will have ConfigMap - name: configmap configMap: name: {{.BaseName}}-{{.Index}} - {{end}} - {{if (eq (Mod .Index 20) 10 19) }} # .Index % 20 in {10,19} - 10% deployments will have Secret - name: secret secret: secretName: {{.BaseName}}-{{.Index}} - {{end}} diff --git a/clusterloader2/testing/load/secret.yaml b/clusterloader2/testing/load/secret.yaml index 67134b355..a06a6e83f 100644 --- a/clusterloader2/testing/load/secret.yaml +++ b/clusterloader2/testing/load/secret.yaml @@ -2,6 +2,9 @@ apiVersion: v1 kind: Secret metadata: name: {{.Name}} +{{if not (eq (Mod .Index 20) 10 19) }} # .Index % 20 in {10,19} - only 10% deployments will have non-immutable Secret. +immutable: true +{{end}} type: Opaque data: password: c2NhbGFiaWxpdHkK