Skip to content

Commit

Permalink
Cluster density v1 (kube-burner#257)
Browse files Browse the repository at this point in the history
* Cluster-density v1

Signed-off-by: Raul Sevilla <[email protected]>

Update route endpoint

Signed-off-by: Raul Sevilla <[email protected]>

* Remove unused metrics files

Signed-off-by: Raul Sevilla <[email protected]>

---------

Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 authored Feb 23, 2023
1 parent cbc5e3a commit 9bac817
Show file tree
Hide file tree
Showing 28 changed files with 300 additions and 588 deletions.
24 changes: 24 additions & 0 deletions cmd/kube-burner/ocp-config/cluster-density-v2/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
kind: Build
apiVersion: build.openshift.io/v1
metadata:
name: {{.JobName}}-{{.Replica}}
spec:
nodeSelector:
node-role.kubernetes.io/worker: ""
serviceAccount: builder
source:
dockerfile: |-
FROM registry.fedoraproject.org/fedora-minimal:latest
RUN touch $(date +%s)
type: Dockerfile
strategy:
dockerStrategy:
from:
kind: DockerImage
name: registry.fedoraproject.org/fedora-minimal:latest
type: Source
output:
to:
kind: ImageStreamTag
name: cluster-density-{{.Replica}}:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
global:
writeToFile: false
gc: {{.GC}}
indexerConfig:
enabled: {{.INDEXING}}
esServers: ["{{.ES_SERVER}}"]
insecureSkipVerify: true
defaultIndex: {{.ES_INDEX}}
type: elastic
measurements:
- name: podLatency
esIndex: {{.ES_INDEX}}
jobs:
- name: cluster-density-v2
namespace: cluster-density-v2
jobIterations: {{.JOB_ITERATIONS}}
qps: {{.QPS}}
burst: {{.BURST}}
namespacedIterations: true
podWait: false
waitWhenFinished: true
preLoadImages: true
preLoadPeriod: 30s
churn: {{.CHURN}}
churnDuration: {{.CHURN_DURATION}}
churnPercent: {{.CHURN_PERCENT}}
churnDelay: {{.CHURN_DELAY}}
namespaceLabels:
security.openshift.io/scc.podSecurityLabelSync: false
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: privileged
objects:

- objectTemplate: imagestream.yml
replicas: 1

- objectTemplate: build.yml
replicas: 1

- objectTemplate: deployment-server.yml
replicas: 3
inputVars:
podReplicas: 2

- objectTemplate: deployment-client.yml
replicas: 2
inputVars:
podReplicas: 2
ingressDomain: {{.INGRESS_DOMAIN}}

- objectTemplate: service.yml
replicas: 5

- objectTemplate: route.yml
replicas: 2

- objectTemplate: secret.yml
replicas: 10

- objectTemplate: configmap.yml
replicas: 10

- objectTemplate: np-deny-all.yml
replicas: 1

- objectTemplate: np-allow-from-clients.yml
replicas: 1

- objectTemplate: np-allow-from-ingress.yml
replicas: 1
7 changes: 7 additions & 0 deletions cmd/kube-burner/ocp-config/cluster-density-v2/configmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{.JobName}}-{{.Replica}}
data:
key1: "{{rand 2048}}"
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
- name: ENVVAR4
value: "{{rand 250}}"
- name: ROUTE_ENDPOINT
value: "https://cluster-density-{{.Replica}}-cluster-density-{{.Iteration}}.{{ .ingressDomain }}/256.html"
value: "https://cluster-density-{{.Replica}}-cluster-density-v2-{{.Iteration}}.{{ .ingressDomain }}/256.html"
- name: SERVICE_ENDPOINT
value: "http://cluster-density-{{randInteger 1 5}}/256.html"
volumes:
Expand Down
5 changes: 5 additions & 0 deletions cmd/kube-burner/ocp-config/cluster-density-v2/imagestream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
name: cluster-density-{{.Replica}}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: cluster-density-{{.Iteration}}
kubernetes.io/metadata.name: cluster-density-v2-{{.Iteration}}
podSelector:
matchLabels:
name: client
Expand Down
11 changes: 11 additions & 0 deletions cmd/kube-burner/ocp-config/cluster-density-v2/route.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: cluster-density-{{.Replica}}
spec:
to:
kind: Service
name: cluster-density-{{.Replica}}
tls:
termination: edge
7 changes: 7 additions & 0 deletions cmd/kube-burner/ocp-config/cluster-density-v2/secret.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Secret
metadata:
name: {{.JobName}}-{{.Replica}}
data:
top-secret: "{{rand 2048}}"
14 changes: 14 additions & 0 deletions cmd/kube-burner/ocp-config/cluster-density-v2/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
kind: Service
apiVersion: v1
metadata:
name: cluster-density-{{.Replica}}
spec:
selector:
name: nginx
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
22 changes: 3 additions & 19 deletions cmd/kube-burner/ocp-config/cluster-density/cluster-density.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,19 @@ jobs:
- objectTemplate: build.yml
replicas: 1

- objectTemplate: deployment-server.yml
replicas: 3
inputVars:
podReplicas: 2

- objectTemplate: deployment-client.yml
replicas: 2
- objectTemplate: deployment.yml
replicas: 5
inputVars:
podReplicas: 2
ingressDomain: {{.INGRESS_DOMAIN}}

- objectTemplate: service.yml
replicas: 5

- objectTemplate: route.yml
replicas: 2
replicas: 1

- objectTemplate: secret.yml
replicas: 10

- objectTemplate: configmap.yml
replicas: 10
{{ if eq .NETWORK_POLICIES "true" }}
- objectTemplate: np-deny-all.yml
replicas: 1

- objectTemplate: np-allow-from-clients.yml
replicas: 1

- objectTemplate: np-allow-from-ingress.yml
replicas: 1
{{ end }}
104 changes: 104 additions & 0 deletions cmd/kube-burner/ocp-config/cluster-density/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: cluster-density-{{.Replica}}
spec:
replicas: {{.podReplicas}}
selector:
matchLabels:
app: cluster-density-{{.Replica}}
template:
metadata:
labels:
app: cluster-density-{{.Replica}}
spec:
nodeSelector:
node-role.kubernetes.io/worker: ""
containers:
- args:
- sleep
- infinity
image: k8s.gcr.io/pause:3.1
resources:
requests:
memory: "10Mi"
cpu: "10m"
volumeMounts:
- name: secret-1
mountPath: /secret1
- name: secret-2
mountPath: /secret2
- name: secret-3
mountPath: /secret3
- name: secret-4
mountPath: /secret4
- name: configmap-1
mountPath: /configmap1
- name: configmap-2
mountPath: /configmap2
- name: configmap-3
mountPath: /configmap3
- name: configmap-4
mountPath: /configmap4
- name: podinfo
mountPath: /etc/podlabels
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8443
protocol: TCP
name: cluster-density
env:
- name: ENVVAR1
value: "{{rand 250}}"
- name: ENVVAR2
value: "{{rand 250}}"
- name: ENVVAR3
value: "{{rand 250}}"
- name: ENVVAR4
value: "{{rand 250}}"
volumes:
- name: secret-1
secret:
secretName: {{.JobName}}-1
- name: secret-2
secret:
secretName: {{.JobName}}-2
- name: secret-3
secret:
secretName: {{.JobName}}-3
- name: secret-4
secret:
secretName: {{.JobName}}-4
- name: configmap-1
configMap:
name: {{.JobName}}-1
- name: configmap-2
configMap:
name: {{.JobName}}-2
- name: configmap-3
configMap:
name: {{.JobName}}-3
- name: configmap-4
configMap:
name: {{.JobName}}-4
- name: podinfo
downwardAPI:
items:
- path: "labels"
fieldRef:
fieldPath: metadata.labels
# Add not-ready/unreachable tolerations for 15 minutes so that node
# failure doesn't trigger pod deletion.
tolerations:
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 900
- key: "node.kubernetes.io/unreachable"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 900

Loading

0 comments on commit 9bac817

Please sign in to comment.