LoginSignup
0
0

More than 1 year has passed since last update.

Service Account について

Last updated at Posted at 2022-01-29

Service Accountは、Namespaceに紐づくresource.
Pod起動時には、必ずService Accountを1つ割り当てる必要があり、Service Accountベースで認証/認可を行なっている。
割り当てない場合には、Default Service Accountが割り当てられる。

スクリーンショット 2022-01-29 20.20.20.png

Command

## Application Podを調べて、PodにマウントされているService Accountを調べる。
kubectl describe pod
Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-xxxxx (ro)
## SAを作成
kubectl create serviceaccount xxxxx

YAMLで作成

## Deployment で、Service Accountを指定したい場合、以下記載
    spec:
      serviceAccountName: xxxxx  

参考

https://kubernetes.io/ja/docs/reference/access-authn-authz/authentication/
Kubernetes完全ガイド (impress top gear)
https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests/

参考にさせていただきました。ありがとうございます。

備考

トークンの自動マウントなど、トークンとSAについても、今後まとめたい。
何か間違っている記載ありましたら教えていただけると嬉しいです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0