참고 - https://aws.amazon.com/ko/premiumsupport/knowledge-center/eks-iam-permissions-namespaces/
참고 3 - https://bscnote.tistory.com/129
https://kubernetes.io/docs/reference/access-authn-authz/rbac/
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::<<Account Number>>:role/EKS-Developer-Policy"
},
{
"Effect": "Allow",
"Action": [
"eks:DescribeCluster",
"eks:ListClusters"
],
"Resource": "*"
}
]
}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: dev-access-role
namespace: dev
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: dev-access-role-binding
namespace: dev
## Role
roleRef:
kind: Role
name: dev-access-role
apiGroup: rbac.authorization.k8s.io
## Service Account
subjects:
- kind: Group
apiGroup: rbac.authorization.k8s.io
name: developer
apiVersion: v1
data:
mapRoles: |
- groups:
- system:bootstrappers
- system:nodes
rolearn: arn:aws:iam::111111111111:role/eks_worker_role
username: system:node:{{EC2PrivateDNSName}}
mapUsers: |
- userarn: arn:aws:iam::680360122082:root
groups:
- system:masters
- userarn: arn:aws:iam::111111111111:user/developer_hongGu #이 부분을 추가해야합니다.
username: developer_hongGu
groups:
- developer
kind: ConfigMap
kubectl create namespace dev