역할과 바인딩
1. 역할과 바인딩 생성하기
unset AWS_SECRET_ACCESS_KEY
unset AWS_ACCESS_KEY_IDaws sts get-caller-identity
2. 역할과 바인딩 검증하기



Last updated
unset AWS_SECRET_ACCESS_KEY
unset AWS_ACCESS_KEY_IDaws sts get-caller-identity



Last updated
cat << EoF > rbacuser-role.yaml
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: rbac-test
name: pod-reader
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["list","get","watch"]
- apiGroups: ["extensions","apps"]
resources: ["deployments"]
verbs: ["get", "list", "watch"]
EoF
cat << EoF > rbacuser-role-binding.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: read-pods
namespace: rbac-test
subjects:
- kind: User
name: rbac-user
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: pod-reader
apiGroup: rbac.authorization.k8s.io
EoF
kubectl apply -f rbacuser-role.yaml
kubectl apply -f rbacuser-role-binding.yaml. rbacuser_creds.sh; aws sts get-caller-identitykubectl get pods -n rbac-testkubectl get pods -n kube-system