--token-auth-file=SOMEFILE.csv
전달 (kube-apiserver 수정 필요)SOMEFILE.csv 내용
password1,user1,uid001,"group1"
password2,user2,uid002
password3,user3,uid003
password4,user4,uid004
Authorization: Bearer 31ada4fd-adec-460c-809a-9e56ceb75269
$ TOKEN=password1
$ APISERVER=https://127.0.0.1:6443
$ curl -X GET $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
$ kubectl config set-credentials user1 --token=password1
$ kubectl config set-context user1-context --cluster=kubernetes --namespace=frontend --user=user1
$ kubectl get pod --user user1
C:\Users\ur2ku>kubectl get sa
NAME SECRETS AGE
default 0 42d
C:\Users\ur2ku>kubectl get sa default -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: "2023-07-21T09:08:56Z"
name: default
namespace: default
resourceVersion: "228"
uid: 4ee4d89c-8a0c-4321-8f74-588c1917a5dd
C:\Users\ur2ku>kubectl create serviceaccount sa1
serviceaccount/sa1 created
C:\Users\ur2ku>kubectl get sa
NAME SECRETS AGE
default 0 42d
sa1 0 7s
C:\Users\ur2ku>kubectl get sa sa1 -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: "2023-09-02T09:02:51Z"
name: sa1
namespace: default
resourceVersion: "30164136"
uid: f3b9cd4e-7c5f-4319-8560-ca4977c37120