@@ -384,7 +384,7 @@ func initLifecycleContainer(image string) (v1.Container, error) {
384384}
385385
386386// newPod creates a basic Pod for given settings.
387- func newPod (deploymentName , ns , role , id , podName string , finalizers []string , tolerations []v1.Toleration ) v1.Pod {
387+ func newPod (deploymentName , ns , role , id , podName string , finalizers []string , tolerations []v1.Toleration , serviceAccountName string ) v1.Pod {
388388 hostname := CreatePodHostName (deploymentName , role , id )
389389 p := v1.Pod {
390390 ObjectMeta : metav1.ObjectMeta {
@@ -393,10 +393,11 @@ func newPod(deploymentName, ns, role, id, podName string, finalizers []string, t
393393 Finalizers : finalizers ,
394394 },
395395 Spec : v1.PodSpec {
396- Hostname : hostname ,
397- Subdomain : CreateHeadlessServiceName (deploymentName ),
398- RestartPolicy : v1 .RestartPolicyNever ,
399- Tolerations : tolerations ,
396+ Hostname : hostname ,
397+ Subdomain : CreateHeadlessServiceName (deploymentName ),
398+ RestartPolicy : v1 .RestartPolicyNever ,
399+ Tolerations : tolerations ,
400+ ServiceAccountName : serviceAccountName ,
400401 },
401402 }
402403 return p
@@ -409,10 +410,10 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
409410 role , id , podName , pvcName , image , lifecycleImage string , imagePullPolicy v1.PullPolicy ,
410411 engine string , requireUUID bool , terminationGracePeriod time.Duration ,
411412 args []string , env map [string ]EnvValue , finalizers []string ,
412- livenessProbe * HTTPProbeConfig , readinessProbe * HTTPProbeConfig , tolerations []v1.Toleration ,
413+ livenessProbe * HTTPProbeConfig , readinessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
413414 tlsKeyfileSecretName , rocksdbEncryptionSecretName string ) error {
414415 // Prepare basic pod
415- p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , finalizers , tolerations )
416+ p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , finalizers , tolerations , serviceAccountName )
416417 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
417418 p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
418419
@@ -510,10 +511,10 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
510511// If the pod already exists, nil is returned.
511512// If another error occurs, that error is returned.
512513func CreateArangoSyncPod (kubecli kubernetes.Interface , developmentMode bool , deployment APIObject , role , id , podName , image , lifecycleImage string , imagePullPolicy v1.PullPolicy ,
513- terminationGracePeriod time.Duration , args []string , env map [string ]EnvValue , livenessProbe * HTTPProbeConfig , tolerations []v1.Toleration ,
514+ terminationGracePeriod time.Duration , args []string , env map [string ]EnvValue , livenessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
514515 tlsKeyfileSecretName , clientAuthCASecretName , masterJWTSecretName , clusterJWTSecretName , affinityWithRole string ) error {
515516 // Prepare basic pod
516- p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , nil , tolerations )
517+ p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , nil , tolerations , serviceAccountName )
517518 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
518519 p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
519520
0 commit comments