Skip to content

Commit 22a5690

Browse files
authored
Merge pull request #487 from balintTobik/remove_peeroverhead
KATA-3270: pod overhead for peer pods reduce actual worker capacity
2 parents 4325a09 + ce52f59 commit 22a5690

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

controllers/openshift_controller.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,16 @@ const (
7878
peerpodsCrioMachineConfigYaml = "mc-50-crio-config.yaml"
7979
peerpodsKataRemoteMachineConfig = "40-worker-kata-remote-config"
8080
peerpodsKataRemoteMachineConfigYaml = "mc-40-kata-remote-config.yaml"
81-
peerpodsRuntimeClassName = "kata-remote"
82-
peerpodsRuntimeClassCpuOverhead = "0.25"
83-
peerpodsRuntimeClassMemOverhead = "350Mi"
81+
// Use same Pod Overhead as upstream kata-deploy using, see
82+
// https://github.com/kata-containers/kata-containers/blob/main/tools/packaging/kata-deploy/runtimeclasses/kata-qemu.yaml#L7
83+
kataRuntimeClassName = "kata"
84+
kataRuntimeClassCpuOverhead = "0.25"
85+
// We need a higher value than upstream (see https://github.com/openshift/sandboxed-containers-operator/pull/84)
86+
kataRuntimeClassMemOverhead = "350Mi"
87+
// https://github.com/kata-containers/kata-containers/blob/main/tools/packaging/kata-deploy/runtimeclasses/kata-remote.yaml#L7
88+
peerpodsRuntimeClassName = "kata-remote"
89+
peerpodsRuntimeClassCpuOverhead = "0.25"
90+
peerpodsRuntimeClassMemOverhead = "120Mi"
8491
)
8592

8693
// +kubebuilder:rbac:groups=kataconfiguration.openshift.io,resources=kataconfigs;kataconfigs/finalizers,verbs=get;list;watch;create;update;patch;delete
@@ -696,8 +703,6 @@ func (r *KataConfigOpenShiftReconciler) createRuntimeClass(runtimeClassName stri
696703
Name: runtimeClassName,
697704
},
698705
Handler: runtimeClassName,
699-
// Use same values for Pod Overhead as upstream kata-deploy using, see
700-
// https://github.com/kata-containers/packaging/blob/f17450317563b6e4d6b1a71f0559360b37783e19/kata-deploy/k8s-1.18/kata-runtimeClasses.yaml#L7
701706
Overhead: &nodeapi.Overhead{
702707
PodFixed: corev1.ResourceList{
703708
corev1.ResourceCPU: resource.MustParse(cpuOverhead),
@@ -1169,7 +1174,7 @@ func (r *KataConfigOpenShiftReconciler) processKataConfigInstallRequest() (ctrl.
11691174
if !isMcoUpdating {
11701175
r.Log.Info("create runtime class")
11711176
r.resetInProgressCondition()
1172-
err := r.createRuntimeClass("kata", "0.25", "350Mi")
1177+
err := r.createRuntimeClass(kataRuntimeClassName, kataRuntimeClassCpuOverhead, kataRuntimeClassMemOverhead)
11731178
if err != nil {
11741179
// Give sometime for the error to go away before reconciling again
11751180
return reconcile.Result{Requeue: true, RequeueAfter: 15 * time.Second}, err

0 commit comments

Comments
 (0)