Skip to content

Instantly share code, notes, and snippets.

@fahminlb33
Last active March 17, 2022 05:17
Show Gist options
  • Save fahminlb33/208f1615aad12ec2a93d777ed38268e7 to your computer and use it in GitHub Desktop.
Save fahminlb33/208f1615aad12ec2a93d777ed38268e7 to your computer and use it in GitHub Desktop.
apiVersion: batch/v1
kind: Job
metadata:
name: sysbench-cpu
#namespace: logeect-stage
labels:
app: sysbench-cpu
spec:
template:
metadata:
labels:
app: sysbench-cpu
spec:
containers:
- name: fio
image: homeine/sysbench:latest
command: ["sh"]
args: ["-c", "sysbench cpu --cpu-max-prime=20000 --threads=4 --time=60 run"]
resources:
limits:
memory: 1Gi
imagePullPolicy: Always
restartPolicy: Never
apiVersion: apps/v1
kind: Deployment
metadata:
name: iperf-server
#namespace: logeect-stage
labels:
app: iperf-server
spec:
replicas: 1
selector:
matchLabels:
app: iperf-server
template:
metadata:
labels:
app: iperf-server
spec:
containers:
- name: iperf-server
image: networkstatic/iperf3
ports:
- containerPort: 5201
protocol: TCP
command: ["iperf3"]
args:
- "-s"
imagePullPolicy: Always
resources:
limits:
memory: 1Gi
dnsPolicy: ClusterFirst
restartPolicy: Always
apiVersion: batch/v1
kind: Job
metadata:
name: sysbench-memory
#namespace: logeect-stage
labels:
app: sysbench-memory
spec:
template:
metadata:
labels:
app: sysbench-memory
spec:
containers:
- name: fio
image: homeine/sysbench:latest
command: ["sh"]
args: ["-c", "sysbench memory --memory-oper=write --memory-block-size=1K --memory-scope=global --memory-total-size=100G --threads=4 --time=30 run"]
resources:
limits:
memory: 4Gi
imagePullPolicy: Always
restartPolicy: Never
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgresql
labels:
app: postgresql
spec:
strategy:
type: Recreate
replicas: 1
selector:
matchLabels:
app: postgresql
template:
metadata:
labels:
app: postgresql
spec:
containers:
- name: postgresql
image: postgres:11
env:
- name: POSTGRES_PASSWORD
value: supersecret
ports:
- containerPort: 5432
resources:
limits:
memory: 2Gi
volumeMounts:
- name: postgresql
mountPath: /var/lib/pgsql/data
volumes:
- name: postgresql
persistentVolumeClaim:
claimName: postgresql-pv
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: registry-kpc-k3s-1-stage-flou
restartPolicy: Always
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgresql-pv
labels:
app: postgresql
spec:
accessModes:
- ReadWriteOnce
storageClassName: microk8s-hostpath
resources:
requests:
storage: 25Gi
---
kind: ConfigMap
apiVersion: v1
metadata:
name: fio-job-config-throughput
#namespace: logeect-stage
labels:
app: fio-benchmark-throughput
data:
fio.job: |-
[global]
bs=64K
iodepth=64
direct=1
ioengine=libaio
group_reporting
time_based
runtime=120
numjobs=4
name=raw-readwrite
rw=randrw
[randreadwrite]
size=5Gb
filename=/scratch/job
---
apiVersion: batch/v1
kind: Job
metadata:
name: fio-benchmark-throughput
#namespace: logeect-stage
labels:
app: fio-benchmark-throughput
spec:
template:
metadata:
labels:
app: fio-benchmark-throughput
spec:
containers:
- name: fio
image: joshuarobinson/fio:3.19
command: ["sh"]
args: ["-c", "fio /configs/fio.job"]
volumeMounts:
- name: fio-config-vol
mountPath: /configs
- name: fio-data
mountPath: /scratch
resources:
limits:
memory: 4Gi
imagePullPolicy: Always
restartPolicy: Never
volumes:
- name: fio-config-vol
configMap:
name: fio-job-config-throughput
- name: fio-data
persistentVolumeClaim:
claimName: fio-claim-throughput
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: fio-claim-throughput
#namespace: logeect-stage
labels:
app: fio-claim-throughput
spec:
storageClassName: microk8s-hostpath
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 25Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment