How to configure a non-default serviceAccount on a deployment

后端 未结 1 961
梦毁少年i
梦毁少年i 2021-01-07 16:47

My Understanding of this doc page is, that I can configure service accounts with Pods and hopefully also deployments, so I can access the k8s API in Kubernetes 1.6+. In orde

相关标签:
1条回答
  • 2021-01-07 17:27

    As you will need to specify 'podSpec' in Deployment as well, you should be able to configure the service account in the same way. Something like:

    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: my-deployment
    spec:
      template:
        # Below is the podSpec.
        metadata:
          name: ...
        spec:
          serviceAccountName: build-robot
          automountServiceAccountToken: false
          ...
    
    0 讨论(0)
提交回复
热议问题