spring-cloud / spring-cloud-deployer-kubernetes

The Spring Cloud Deployer implementation for Kubernetes
Apache License 2.0
157 stars 98 forks source link

Service account is not getting set #467

Closed sabbyanandan closed 2 years ago

sabbyanandan commented 2 years ago

@gurugubelli commented on Tue Jul 06 2021

Even though environment variable SPRING_CLOUD_SCHEDULER_KUBERNETES_TASK_SERVICE_ACCOUNT_NAME exists used to work in spring cloud dataflow 2.5.x but stopped working in 2.8.1. Service account getting set default always rather than custom account.


@ilayaperumalg commented on Mon Jul 12 2021

Hi @gurugubelli, Thanks for reporting this. This is a bug and we'll try to address this in the upcoming release. Since this needs to be fixed at the SCDF level, I need to move this there.


@ilayaperumalg commented on Mon Jul 12 2021

You can work around this problem by passing the scheduler properties when creating the scheduler for the task in SCDF as follows:

scheduler.kubernetes.taskServiceAccountName=<sa-name>

@ilayaperumalg commented on Wed Nov 10 2021

@cppwfs Could you confirm if the changes from https://github.com/spring-cloud/spring-cloud-deployer-kubernetes/pull/457 fixes this issue please?


@cppwfs commented on Wed Nov 10 2021

Hello @ilayaperumalg This appears to be another issue. We will need to investigate further.


@ilayaperumalg commented on Fri Nov 12 2021

Yes, after some investigation I found that the DeploymentPropertiesResolver in the K8s deployer still has the references (here and here) to the deprecated K8s scheduler properties which need to be fixed.

Also, from the scheduler properties deprecation efforts, the K8s scheduler switched to use the K8s deployer properties instead. Hence, the resolution for the issue reported in here is eventually fixing the support for taskServiceAccountName as a K8s deployer property set as platform properties instead of scheduler property.


@cppwfs commented on Fri Nov 12 2021

@ilayaperumalg thanks for looking into this. I have also assigned myself to this issue.