Skip to content

Commit 6cb6cb3

Browse files
author
lamai93
committed
small changes.
1 parent 5c80920 commit 6cb6cb3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pkg/deployment/resources/pod_creator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ func (r *Resources) createPodForMember(spec api.DeploymentSpec, memberID string,
690690
}
691691
if err := k8sutil.CreateArangoSyncPod(kubecli, spec.IsDevelopment(), apiObject, role, m.ID, m.PodName, imageID, lifecycleImage, spec.GetImagePullPolicy(), terminationGracePeriod, args, env,
692692
livenessProbe, tolerations, serviceAccountName, tlsKeyfileSecretName, clientAuthCASecretName, masterJWTSecretName, clusterJWTSecretName, affinityWithRole, groupSpec.GetNodeSelector(),
693-
groupSpec.PriorityClassName); err != nil {
693+
groupSpec.PriorityClassName, groupSpec.Resources); err != nil {
694694
return maskAny(err)
695695
}
696696
log.Debug().Str("pod-name", m.PodName).Msg("Created pod")

pkg/util/k8sutil/pods.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func arangodContainer(image string, imagePullPolicy v1.PullPolicy, args []string
321321

322322
// arangosyncContainer creates a container configured to run `arangosync`.
323323
func 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))
@@ -580,7 +581,7 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
580581
func CreateArangoSyncPod(kubecli kubernetes.Interface, developmentMode bool, deployment APIObject, role, id, podName, image, lifecycleImage string, imagePullPolicy v1.PullPolicy,
581582
terminationGracePeriod time.Duration, args []string, env map[string]EnvValue, livenessProbe *HTTPProbeConfig, tolerations []v1.Toleration, serviceAccountName string,
582583
tlsKeyfileSecretName, clientAuthCASecretName, masterJWTSecretName, clusterJWTSecretName, affinityWithRole string, nodeSelector map[string]string,
583-
podPriorityClassName string) error {
584+
podPriorityClassName string, resources v1.ResourceRequirements) error {
584585
// Prepare basic pod
585586
p := newPod(deployment.GetName(), deployment.GetNamespace(), role, id, podName, nil, tolerations, serviceAccountName, nodeSelector)
586587
terminationGracePeriodSeconds := int64(math.Ceil(terminationGracePeriod.Seconds()))
@@ -606,7 +607,7 @@ func CreateArangoSyncPod(kubecli kubernetes.Interface, developmentMode bool, dep
606607
p.Spec.Volumes = append(p.Spec.Volumes, lifecycleVolumes...)
607608

608609
// Add arangosync container
609-
c := arangosyncContainer(image, imagePullPolicy, args, env, livenessProbe, lifecycle, lifecycleEnvVars)
610+
c := arangosyncContainer(image, imagePullPolicy, args, env, livenessProbe, lifecycle, lifecycleEnvVars, resources)
610611
if tlsKeyfileSecretName != "" {
611612
c.VolumeMounts = append(c.VolumeMounts, tlsKeyfileVolumeMounts()...)
612613
}

0 commit comments

Comments
 (0)