@@ -390,7 +390,7 @@ func initLifecycleContainer(image string) (v1.Container, error) {
390
390
}
391
391
392
392
// 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 {
394
394
hostname := CreatePodHostName (deploymentName , role , id )
395
395
p := v1.Pod {
396
396
ObjectMeta : metav1.ObjectMeta {
@@ -399,10 +399,11 @@ func newPod(deploymentName, ns, role, id, podName string, finalizers []string, t
399
399
Finalizers : finalizers ,
400
400
},
401
401
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 ,
406
407
},
407
408
}
408
409
return p
@@ -415,10 +416,10 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
415
416
role , id , podName , pvcName , image , lifecycleImage string , imagePullPolicy v1.PullPolicy ,
416
417
engine string , requireUUID bool , terminationGracePeriod time.Duration ,
417
418
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 ,
419
420
tlsKeyfileSecretName , rocksdbEncryptionSecretName string ) error {
420
421
// 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 )
422
423
terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
423
424
p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
424
425
@@ -516,10 +517,10 @@ func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deploy
516
517
// If the pod already exists, nil is returned.
517
518
// If another error occurs, that error is returned.
518
519
func 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 ,
520
521
tlsKeyfileSecretName , clientAuthCASecretName , masterJWTSecretName , clusterJWTSecretName , affinityWithRole string ) error {
521
522
// 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 )
523
524
terminationGracePeriodSeconds := int64 (math .Ceil (terminationGracePeriod .Seconds ()))
524
525
p .Spec .TerminationGracePeriodSeconds = & terminationGracePeriodSeconds
525
526
0 commit comments