반응형

개요

AWS상에서 EKS를 구성하고 실습해 보는 교재 중 최고는 개인적으로 "AWS EKS 워크샵 스튜디오"라고 생각한다. 다만 이 워크샵을 그대로 따라 진행한다고 해도 예상치 못하는 몇몇 문제를 만나곤 하는데 이 포스팅은 진행시 만날 수 있는 에러에 대해 해결방법을 정리한 것이다. 

 

 

Workshop Studio

 

catalog.us-east-1.prod.workshops.aws

 

aws의 eks-workshop을 따라하다가 아래와 같이 AWS콘솔에서 EKS노드를 보기위해 권한을 주는 작업인 assumedrolename 명령어 수행시 "  An error occurred (ValidationError) when calling the GetRole operation: The specified value for roleName is invalid. It must contain only alphanumeric characters and/or the following: +=,.@_-  " 에러가 아래와 같이 나온다면

poc-admin:~/environment $ rolearn=$(aws cloud9 describe-environment-memberships --environment-id=$C9_PID | jq -r '.memberships[].userArn')
poc-admin:~/environment $ echo ${rolearn}
arn:aws:iam::9000000052:user/poc-admin
poc-admin:~/environment $ assumedrolename=$(echo ${rolearn} | awk -F/ '{print $(NF-1)}')
poc-admin:~/environment $ rolearn=$(aws iam get-role --role-name ${assumedrolename} --query Role.Arn --output text) 
An error occurred (ValidationError) when calling the GetRole operation: The specified value for roleName is invalid. It must contain only alphanumeric characters and/or the following: +=,.@_-

이건 기 진행한 명령어(아래)에서 assumed-role이 없는 상태인데도 위 명령어 'rolearn=$(aws iam get-role --role-name ${assumedrolename} --query Role.Arn --output text) '와 그 아래 roalearn을 실행한 이유때문 이 두 명령어 (assumedroleanename~과 그 아래 rolearn=$는 실행 시킬 필요 없이 그냥 아래 명령어 실행 후 바로 eksctl create iamidentitymapping --cluster eks-demo --arn ${rolearn} --group system:masters --username admin 를 실행시키면 된다.

rolearn=$(aws cloud9 describe-environment-memberships --environment-id=$C9_PID | jq -r '.memberships[].userArn')

echo ${rolearn}

 

 

kubectl apply -f v2_4_1_full.yaml 실행시 'unable to recognize ~' 에러가 발생한다면

poc-user:~/environment/manifests/alb-ingress-controller $ kubectl apply -f v2_4_1_full.yaml 
customresourcedefinition.apiextensions.k8s.io/ingressclassparams.elbv2.k8s.aws created
customresourcedefinition.apiextensions.k8s.io/targetgroupbindings.elbv2.k8s.aws created
role.rbac.authorization.k8s.io/aws-load-balancer-controller-leader-election-role created
clusterrole.rbac.authorization.k8s.io/aws-load-balancer-controller-role created
rolebinding.rbac.authorization.k8s.io/aws-load-balancer-controller-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/aws-load-balancer-controller-rolebinding created
service/aws-load-balancer-webhook-service created
deployment.apps/aws-load-balancer-controller created
certificate.cert-manager.io/aws-load-balancer-serving-cert created
issuer.cert-manager.io/aws-load-balancer-selfsigned-issuer created
mutatingwebhookconfiguration.admissionregistration.k8s.io/aws-load-balancer-webhook created
validatingwebhookconfiguration.admissionregistration.k8s.io/aws-load-balancer-webhook created
ingressclass.networking.k8s.io/alb created
error: unable to recognize "v2_4_1_full.yaml": no matches for kind "IngressClassParams" in version "elbv2.k8s.aws/v1beta1"

설치했던 v2_4_1_full.yaml 파일을 바로 삭제 후 

kubectl delete -f v2_4_1_full.yaml

아래의 명령어 실행 후

kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master"

다시 kubectl apply -f v2_4_1_full.yaml 하면 에러가 안남

 

 

 

KubeOpsView를 helm으로 설치할 때 stable 관련 에러가 발생한다면 아래의 명령어로 repository에 stable 추가

helm repo add stable https://charts.helm.sh/stable
반응형

+ Recent posts