Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Service Token : GitLab 서비스 토큰을 사용하여 Kubernetes에 대해 인증

Code Block
languageyaml
## gitlab-admin token 생성 및 등록

$ vi gitlab-admin-service-account.yaml
-------------- yaml 내용 ---------------
apiVersion: v1
kind: ServiceAccount
metadata:
  name: gitlab-admin
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: gitlab-admin
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: gitlab-admin
  namespace: kube-system
-------------- yaml 내용 끝 --------------

$ kubectl apply -f gitlab-admin-service-account.yaml --username=admin --password=admin
$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep gitlab-admin | awk '{print $1}')
출력에서 token값 복사

...