@@ -389,7 +389,7 @@ func initLifecycleContainer(image string) (v1.Container, error) {
389389}
390390
391391// newPod creates a basic Pod for given settings.
392- func newPod (deploymentName , ns , role , id , podName string , finalizers []string , tolerations []v1.Toleration , serviceAccountName string ) v1.Pod {
392+ func newPod (deploymentName , ns , role , id , podName string , finalizers []string , tolerations []v1.Toleration , serviceAccountName string , nodeSelector map [ string ] string ) v1.Pod {
393393 hostname := CreatePodHostName (deploymentName , role , id )
394394 p := v1.Pod {
395395 ObjectMeta : metav1.ObjectMeta {
@@ -403,6 +403,7 @@ func newPod(deploymentName, ns, role, id, podName string, finalizers []string, t
403403 RestartPolicy : v1 .RestartPolicyNever ,
404404 Tolerations : tolerations ,
405405 ServiceAccountName : serviceAccountName ,
406+ NodeSelector : nodeSelector ,
406407 },
407408 }
408409 return p
@@ -416,9 +417,9 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
416417 engine string , requireUUID bool , terminationGracePeriod time.Duration ,
417418 args []string , env map [string ]EnvValue , finalizers []string ,
418419 livenessProbe * HTTPProbeConfig , readinessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
419- tlsKeyfileSecretName , rocksdbEncryptionSecretName string ) error {
420+ tlsKeyfileSecretName , rocksdbEncryptionSecretName string , nodeSelector map [ string ] string ) error {
420421 // Prepare basic pod
421- p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , finalizers , tolerations , serviceAccountName )
422+ p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , finalizers , tolerations , serviceAccountName , nodeSelector )
422423 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
423424 p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
424425
@@ -519,9 +520,9 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
519520// If another error occurs, that error is returned.
520521func CreateArangoSyncPod (kubecli kubernetes.Interface , developmentMode bool , deployment APIObject , role , id , podName , image , lifecycleImage string , imagePullPolicy v1.PullPolicy ,
521522 terminationGracePeriod time.Duration , args []string , env map [string ]EnvValue , livenessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
522- tlsKeyfileSecretName , clientAuthCASecretName , masterJWTSecretName , clusterJWTSecretName , affinityWithRole string ) error {
523+ tlsKeyfileSecretName , clientAuthCASecretName , masterJWTSecretName , clusterJWTSecretName , affinityWithRole string , nodeSelector map [ string ] string ) error {
523524 // Prepare basic pod
524- p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , nil , tolerations , serviceAccountName )
525+ p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , nil , tolerations , serviceAccountName , nodeSelector )
525526 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
526527 p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
527528
0 commit comments