Create User
kubectl apply -f eks-admin-service-account.yaml
1 | apiVersion: v1 |
kubectl apply -f eks-admin-cluster-role-binding.yaml
1 | apiVersion: rbac.authorization.k8s.io/v1beta1 |
Get certificate
1 | kubectl get secret default-token-cvn2d -o jsonpath="{['data']['ca\.crt']}" | base64 --decode |
Get Token
1 | kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}') |
Test If the role works
Setup credential
1 | kubectl config set-cluster kubernetes --certificate-authority=ca.crt --server=$K8S_SERVER_URL |
Test command
1 | kubectl get pod |