@@ -321,7 +321,7 @@ func arangodContainer(image string, imagePullPolicy v1.PullPolicy, args []string
321321
322322// arangosyncContainer creates a container configured to run `arangosync`.
323323func arangosyncContainer (image string , imagePullPolicy v1.PullPolicy , args []string , env map [string ]EnvValue , livenessProbe * HTTPProbeConfig ,
324- lifecycle * v1.Lifecycle , lifecycleEnvVars []v1.EnvVar ) v1.Container {
324+ lifecycle * v1.Lifecycle , lifecycleEnvVars []v1.EnvVar , resources v1. ResourceRequirements ) v1.Container {
325325 c := v1.Container {
326326 Command : append ([]string {"/usr/sbin/arangosync" }, args ... ),
327327 Name : ServerContainerName ,
@@ -335,6 +335,7 @@ func arangosyncContainer(image string, imagePullPolicy v1.PullPolicy, args []str
335335 Protocol : v1 .ProtocolTCP ,
336336 },
337337 },
338+ Resources : filterStorageResourceRequirement (resources ), // Storage is handled via pvcs
338339 }
339340 for k , v := range env {
340341 c .Env = append (c .Env , v .CreateEnvVar (k ))
@@ -456,7 +457,8 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
456457 args []string , env map [string ]EnvValue , finalizers []string ,
457458 livenessProbe * HTTPProbeConfig , readinessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
458459 tlsKeyfileSecretName , rocksdbEncryptionSecretName string , clusterJWTSecretName string , nodeSelector map [string ]string ,
459- resources v1.ResourceRequirements ) error {
460+ podPriorityClassName string , resources v1.ResourceRequirements ) error {
461+
460462 // Prepare basic pod
461463 p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , finalizers , tolerations , serviceAccountName , nodeSelector )
462464 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
@@ -491,6 +493,9 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
491493 }
492494 p .Spec .Containers = append (p .Spec .Containers , c )
493495
496+ // Add priorityClassName
497+ p .Spec .PriorityClassName = podPriorityClassName
498+
494499 // Add UUID init container
495500 if alpineImage != "" {
496501 p .Spec .InitContainers = append (p .Spec .InitContainers , arangodInitContainer ("uuid" , id , engine , alpineImage , requireUUID ))
@@ -575,7 +580,8 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
575580// If another error occurs, that error is returned.
576581func CreateArangoSyncPod (kubecli kubernetes.Interface , developmentMode bool , deployment APIObject , role , id , podName , image , lifecycleImage string , imagePullPolicy v1.PullPolicy ,
577582 terminationGracePeriod time.Duration , args []string , env map [string ]EnvValue , livenessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
578- tlsKeyfileSecretName , clientAuthCASecretName , masterJWTSecretName , clusterJWTSecretName , affinityWithRole string , nodeSelector map [string ]string ) error {
583+ tlsKeyfileSecretName , clientAuthCASecretName , masterJWTSecretName , clusterJWTSecretName , affinityWithRole string , nodeSelector map [string ]string ,
584+ podPriorityClassName string , resources v1.ResourceRequirements ) error {
579585 // Prepare basic pod
580586 p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , nil , tolerations , serviceAccountName , nodeSelector )
581587 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
@@ -601,7 +607,7 @@ func CreateArangoSyncPod(kubecli kubernetes.Interface, developmentMode bool, dep
601607 p .Spec .Volumes = append (p .Spec .Volumes , lifecycleVolumes ... )
602608
603609 // Add arangosync container
604- c := arangosyncContainer (image , imagePullPolicy , args , env , livenessProbe , lifecycle , lifecycleEnvVars )
610+ c := arangosyncContainer (image , imagePullPolicy , args , env , livenessProbe , lifecycle , lifecycleEnvVars , resources )
605611 if tlsKeyfileSecretName != "" {
606612 c .VolumeMounts = append (c .VolumeMounts , tlsKeyfileVolumeMounts ()... )
607613 }
@@ -616,6 +622,9 @@ func CreateArangoSyncPod(kubecli kubernetes.Interface, developmentMode bool, dep
616622 }
617623 p .Spec .Containers = append (p .Spec .Containers , c )
618624
625+ // Add priorityClassName
626+ p .Spec .PriorityClassName = podPriorityClassName
627+
619628 // TLS keyfile secret mount (if any)
620629 if tlsKeyfileSecretName != "" {
621630 vol := v1.Volume {
0 commit comments