@@ -390,7 +390,7 @@ func initLifecycleContainer(image string) (v1.Container, error) {
390390}
391391
392392// newPod creates a basic Pod for given settings.
393- func newPod (deploymentName , ns , role , id , podName string , finalizers []string , tolerations []v1.Toleration ) v1.Pod {
393+ func newPod (deploymentName , ns , role , id , podName string , finalizers []string , tolerations []v1.Toleration , serviceAccountName string ) v1.Pod {
394394 hostname := CreatePodHostName (deploymentName , role , id )
395395 p := v1.Pod {
396396 ObjectMeta : metav1.ObjectMeta {
@@ -399,10 +399,11 @@ func newPod(deploymentName, ns, role, id, podName string, finalizers []string, t
399399 Finalizers : finalizers ,
400400 },
401401 Spec : v1.PodSpec {
402- Hostname : hostname ,
403- Subdomain : CreateHeadlessServiceName (deploymentName ),
404- RestartPolicy : v1 .RestartPolicyNever ,
405- Tolerations : tolerations ,
402+ Hostname : hostname ,
403+ Subdomain : CreateHeadlessServiceName (deploymentName ),
404+ RestartPolicy : v1 .RestartPolicyNever ,
405+ Tolerations : tolerations ,
406+ ServiceAccountName : serviceAccountName ,
406407 },
407408 }
408409 return p
@@ -415,10 +416,10 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
415416 role , id , podName , pvcName , image , lifecycleImage string , imagePullPolicy v1.PullPolicy ,
416417 engine string , requireUUID bool , terminationGracePeriod time.Duration ,
417418 args []string , env map [string ]EnvValue , finalizers []string ,
418- livenessProbe * HTTPProbeConfig , readinessProbe * HTTPProbeConfig , tolerations []v1.Toleration ,
419+ livenessProbe * HTTPProbeConfig , readinessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
419420 tlsKeyfileSecretName , rocksdbEncryptionSecretName string ) error {
420421 // Prepare basic pod
421- p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , finalizers , tolerations )
422+ p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , finalizers , tolerations , serviceAccountName )
422423 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
423424 p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
424425
@@ -516,10 +517,10 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
516517// If the pod already exists, nil is returned.
517518// If another error occurs, that error is returned.
518519func CreateArangoSyncPod (kubecli kubernetes.Interface , developmentMode bool , deployment APIObject , role , id , podName , image , lifecycleImage string , imagePullPolicy v1.PullPolicy ,
519- terminationGracePeriod time.Duration , args []string , env map [string ]EnvValue , livenessProbe * HTTPProbeConfig , tolerations []v1.Toleration ,
520+ terminationGracePeriod time.Duration , args []string , env map [string ]EnvValue , livenessProbe * HTTPProbeConfig , tolerations []v1.Toleration , serviceAccountName string ,
520521 tlsKeyfileSecretName , clientAuthCASecretName , masterJWTSecretName , clusterJWTSecretName , affinityWithRole string ) error {
521522 // Prepare basic pod
522- p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , nil , tolerations )
523+ p := newPod (deployment .GetName (), deployment .GetNamespace (), role , id , podName , nil , tolerations , serviceAccountName )
523524 terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
524525 p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
525526
0 commit comments