Skip to content

Commit

Permalink
chore(Resources): VM Memory Tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurVardevanyan committed Dec 24, 2024
1 parent 4735617 commit 69f5c9a
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 19 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ end

| NAME | ROLES | Machine | vCPU | Mem | Storage |
| -------- | -------------- | ------- | ---- | ----- | --------------- |
| server-1 | cp,etcd,master | kvm-1 | 8 | 34.0G | N/A |
| server-2 | cp,etcd,master | kvm-2 | 8 | 34.0G | N/A |
| server-3 | cp,etcd,master | kvm-1 | 8 | 34.0G | N/A |
| infra-1 | infra,worker | kvm-1 | 6 | 30.0G | 1x4TB CEPH NVME |
| infra-2 | infra,worker | kvm-2 | 6 | 30.0G | 1x4TB CEPH NVME |
| infra-3 | infra,worker | kvm-3 | 6 | 30.0G | 1x4TB CEPH NVME |
| server-1 | cp,etcd,master | kvm-1 | 8 | 35.0G | N/A |
| server-2 | cp,etcd,master | kvm-2 | 8 | 35.0G | N/A |
| server-3 | cp,etcd,master | kvm-1 | 8 | 35.0G | N/A |
| infra-1 | infra,worker | kvm-1 | 6 | 29.0G | 1x4TB CEPH NVME |
| infra-2 | infra,worker | kvm-2 | 6 | 29.0G | 1x4TB CEPH NVME |
| infra-3 | infra,worker | kvm-3 | 6 | 29.0G | 1x4TB CEPH NVME |
| worker-1 | worker | kvm-1 | 12 | 57.0G | N/A |
| worker-2 | worker | kvm-2 | 12 | 57.0G | N/A |
| worker-3 | worker | kvm-3 | 12 | 57.0G | N/A |
Expand Down
13 changes: 12 additions & 1 deletion main.bash
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ test_overlays_k3s() {
fi
}
stateful_workload_stop() {
kubectl patch cronjobs -n netbox netbox-housekeeping -p '{"spec" : {"suspend" : true }}'
kubectl patch cronjobs -n photoprism photoprism-cron -p '{"spec" : {"suspend" : true }}'
kubectl patch cronjobs -n nextcloud nextcloud-preview -p '{"spec" : {"suspend" : true }}'
kubectl patch cronjobs -n nextcloud nextcloud-rsync -p '{"spec" : {"suspend" : true }}'
Expand Down Expand Up @@ -195,6 +196,9 @@ stateful_workload_stop() {
kubectl scale --replicas=0 -n awx deployment/awx-task
kubectl scale --replicas=0 -n awx deployment/awx-web

kubectl scale --replicas=0 -n awx deployment/netbox
kubectl scale --replicas=0 -n awx deployment/netbox-worker

kubectl delete jobs -A --all
kubectl delete pipelineruns -A --all
}
Expand Down Expand Up @@ -223,11 +227,14 @@ stateful_workload_start_pre() {
kubectl patch postgresCluster photoprism -n postgres --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster stackrox -n stackrox --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster awx -n awx --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster netbox -n netbox --type=merge -p '{"spec":{"shutdown":false}}'

kubectl scale --replicas=1 -n zitadel statefulset/pihole
}

stateful_workload_start() {

kubectl patch cronjobs -n netbox netbox-housekeeping -p '{"spec" : {"suspend" : false }}'
kubectl patch cronjobs -n photoprism photoprism-cron -p '{"spec" : {"suspend" : false }}'
kubectl patch cronjobs -n nextcloud nextcloud-preview -p '{"spec" : {"suspend" : false }}'
kubectl patch cronjobs -n nextcloud nextcloud-rsync -p '{"spec" : {"suspend" : false }}'
Expand Down Expand Up @@ -280,7 +287,8 @@ stateful_workload_start() {
kubectl patch postgresCluster nextcloud -n nextcloud --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster photoprism -n postgres --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster stackrox -n stackrox --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster awx -n awx --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster awx -n awx --type=merge -p '{"spec":{"shutdown":true}}'
kubectl patch postgresCluster netbox -n netbox --type=merge -p '{"spec":{"shutdown":true}}'

kubectl scale --replicas=1 -n argocd deployment/argocd-operator-controller-manager
kubectl scale --replicas=1 -n argocd statefulset/argocd-application-controller
Expand All @@ -300,6 +308,9 @@ stateful_workload_start() {
kubectl scale --replicas=1 -n loki-operator deployment/loki-operator-controller-manager
kubectl scale --replicas=1 -n awx deployment/awx-operator-controller-manager

kubectl scale --replicas=1 -n awx deployment/netbox
kubectl scale --replicas=1 -n awx deployment/netbox-worker

# echo -e "\nkubectl exec -it vault-0 -n vault -- vault operator unseal --tls-skip-verify"
}

Expand Down
12 changes: 6 additions & 6 deletions okd/vm-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ vm:
server-1:
host: kvm-1
cpu: 8
ram: 34816
ram: 35840
disk: 160
mac: 10:00:00:00:01:01
server-2:
host: kvm-2
cpu: 8
ram: 34816
ram: 35840
disk: 160
mac: 10:00:00:00:01:02
server-3:
host: kvm-3
cpu: 8
ram: 34816
ram: 35840
disk: 160
mac: 10:00:00:00:01:03
infra-1:
host: kvm-1
cpu: 6
ram: 30720
ram: 29696
disk: 160
storage: 8000
mac: 10:00:00:00:01:21
infra-2:
host: kvm-2
cpu: 6
ram: 30720
ram: 29696
disk: 160
storage: 8000
mac: 10:00:00:00:01:22
infra-3:
host: kvm-3
cpu: 6
ram: 30720
ram: 29696
disk: 160
storage: 8000
mac: 10:00:00:00:01:23
Expand Down
2 changes: 1 addition & 1 deletion okd/vms/scripts/infra-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export LIBGUESTFS_BACKEND=direct
export HOME=/home/arthur
export NODE=infra-1
export VCPUS=6
export RAM_MB=30720
export RAM_MB=29696
export IMAGE="/home/okd/${NODE}.raw"
export IGNITION_CONFIG="/var/lib/libvirt/images/worker.ign"
export SIZE="160G"
Expand Down
2 changes: 1 addition & 1 deletion okd/vms/scripts/infra-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export LIBGUESTFS_BACKEND=direct
export HOME=/home/arthur
export NODE=infra-2
export VCPUS=6
export RAM_MB=30720
export RAM_MB=29696
export IMAGE="/home/okd/${NODE}.raw"
export IGNITION_CONFIG="/var/lib/libvirt/images/worker.ign"
export SIZE="160G"
Expand Down
2 changes: 1 addition & 1 deletion okd/vms/scripts/infra-3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export LIBGUESTFS_BACKEND=direct
export HOME=/home/arthur
export NODE=infra-3
export VCPUS=6
export RAM_MB=30720
export RAM_MB=29696
export IMAGE="/home/okd/${NODE}.raw"
export IGNITION_CONFIG="/var/lib/libvirt/images/worker.ign"
export SIZE="160G"
Expand Down
2 changes: 1 addition & 1 deletion okd/vms/scripts/server-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export LIBGUESTFS_BACKEND=direct
export HOME=/home/arthur
export NODE=server-1
export VCPUS=8
export RAM_MB=34816
export RAM_MB=35840
export IMAGE="/mnt/${NODE}/${NODE}.raw"
export IGNITION_CONFIG="/var/lib/libvirt/images/master.ign"
export SIZE="160G"
Expand Down
2 changes: 1 addition & 1 deletion okd/vms/scripts/server-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export LIBGUESTFS_BACKEND=direct
export HOME=/home/arthur
export NODE=server-2
export VCPUS=8
export RAM_MB=34816
export RAM_MB=35840
export IMAGE="/mnt/${NODE}/${NODE}.raw"
export IGNITION_CONFIG="/var/lib/libvirt/images/master.ign"
export SIZE="160G"
Expand Down
2 changes: 1 addition & 1 deletion okd/vms/scripts/server-3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export LIBGUESTFS_BACKEND=direct
export HOME=/home/arthur
export NODE=server-3
export VCPUS=8
export RAM_MB=34816
export RAM_MB=35840
export IMAGE="/mnt/${NODE}/${NODE}.raw"
export IGNITION_CONFIG="/var/lib/libvirt/images/master.ign"
export SIZE="160G"
Expand Down

0 comments on commit 69f5c9a

Please sign in to comment.