제가 겪은 상황은 spark-submit을 kubernetes cluster상에 namespace를 생성하고, 해당 namespace에 istio-injection:enabled를 했을 경우 겪게 되었던 “Initial Job has not accepted any resources: check your cluster UI to ensure that workers are registered and have sufficient resources”에 대한 트러블 슈팅에 대한 내용입니다. 특히 kubeflow를 설치시 istio관련 많은 컴포넌트들이 설치되는데 이로 인해서 위와 같은 에러 상황을 마주하게 되었습니다.
해결책은 spark-submit시 istio-injection을 false처리하는 것입니다. 이를 통해서 spark-submit시 (특히 client mode시) spark driver와 spark executor의 communication이 되지 않아 발생하는 “Initial Job has not accepted any resources: check your cluster UI to ensure that workers are registered and have sufficient resources” 의 트러블 슈팅이 가능합니다.
kubernetes에서 spark-submit을 수행하기 위해서는 다음과 같은 절차를 따릅니다.
1) Namespace 생성 & Service Account 생성 & ClusterRoleBinding 수행
2) spark-submit시 “—conf spark.kubernetes.executor.annotation.sidecar.istio.io/inject=false” 옵션을 추가하는데, 이는 istio환경에서 POD를 구동시 istio가 side-car를 injection하면서 kubernetes cluster 외부에 있는 spark driver와 kubernetes cluster내부에 있는 spark client의 communication을 blocking하기 때문에 side-car injection을 하지 않게 하는 것입니다.
“—conf spark.kubernetes.authenticate.oauthTokenFile=“과 “—conf spark.kubernetes.authenticate.caCertFile=“은 위에서 생성한 service account의 secret에 있는 token값과 ca.crt내용입니다.