我正在尝试使用K8s -cloud-deployer-kubernetes在spring集群上运行带有远程分区的spring batch。即使我已经配置了服务帐户并在我的应用程序属性中以下面的方式提到
spring.cloud.deployer.kubernetes.deployment-service-account-name=scdf-sa尽管如此,主任务仍然无法生成worker pod,并且在spring cloud dataflow UI中启动任务时,它似乎没有选择属性,并在主pod中抛出以下错误:
io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://<IP>/api/v1/namespaces/test/pods/batchsampleappworker-aeghj644g. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods "batchsampleappworker-j3ljqq3de9" is forbidden: User "system:serviceaccount:test:default" cannot get resource "pods" in API group "" in the namespace "test".PS:我使用的是spring-cloud-deployer-kubernetes 2.5.0版本
请给出一些关于如何正确配置服务帐户的提示?提前感谢!
发布于 2021-08-27 10:22:34
根据spring cloud dataflow here的官方文档,将以下代码添加到SCDF服务器配置图中为我解决了这个问题。
data:
application.yaml: |-
spring:
cloud:
dataflow:
task:
platform:
kubernetes:
accounts:
default:
deploymentServiceAccountName: myserviceaccountnamehttps://stackoverflow.com/questions/68916168
复制相似问题