So I am deploying an EMR application using EKS, following the EMR-EKS workshop by AWS, declaring the Fargate profile.
I tried everything to be serverless, so even my EKS Cluster runs on Fargate (kube-sytem, default, etc).
I created a custom namespace with a Fargate profile, and submit a Spark job. The job stayed at Pending status.
When I added some managed nodegroups, the job was submitted successfully.
I tried submitting very light jobs and by the time I removed the managed node groups, spark jobs stay at pending status.
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 33s (x7 over 5m43s) default-scheduler 0/2 nodes are available: 2 node(s) had taint {eks.amazonaws.com/compute-type: fargate}, that the pod didn't tolerate.
eksworkshop-eksctl.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eksworkshop-eksctl
region: ${AWS_REGION}
version: "1.21"
availabilityZones: ["${AZS[0]}", "${AZS[1]}", "${AZS[2]}", "${AZS[3]}"]
fargateProfiles:
- name: default
selectors:
# All workloads in the "default" Kubernetes namespace will be
# scheduled onto Fargate:
- namespace: default
# All workloads in the "kube-system" Kubernetes namespace will be
# scheduled onto Fargate:
- namespace: kube-system
Create the EKS cluster:
eksctl create cluster -f eksworkshop-eksctl.yaml
Create namespace and fargate profile:
kubectl create namespace spark
eksctl create fargateprofile --cluster eksworkshop-eksctl --name emr \
--namespace spark --labels type=etl
Create virtual cluster:
I have already added the labels under sparkSubmitParameters, but it is still stuck in Pending state. :( Is there additional configuration I need to add when creating virtual cluster:
aws emr-containers create-virtual-cluster \
--name eksworkshop-eksctl \
--container-provider '{
"id": "eksworkshop-eksctl",
"type": "EKS",
"info": {
"eksInfo": {
"namespace": "spark"
}
}
}'
Submit the spark job:
aws emr-containers start-job-run --virtual-cluster-id $VIRTUAL_CLUSTER_ID --name spark-pi-logging --execution-role-arn $EMR_ROLE_ARN --release-label emr-6.2.0-latest --job-driver '{
"sparkSubmitJobDriver": {
"entryPoint": "s3://aws-data-analytics-workshops/emr-eks-workshop/scripts/pi.py",
"sparkSubmitParameters": "--conf spark.kubernetes.driver.label.type=etl --conf spark.kubernetes.executor.label.type=etl --conf spark.executor.instances=2 --conf spark.executor.memory=2G --conf spark.executor.cores=2 --conf spark.driver.cores=1"
}
}' --configuration-overrides '{
"applicationConfiguration": [
{
"classification": "spark-defaults",
"properties": {
"spark.driver.memory":"2G"
}
}
],
"monitoringConfiguration": {
"cloudWatchMonitoringConfiguration": {
"logGroupName": "/emr-containers/jobs",
"logStreamNamePrefix": "emr-eks-workshop"
},
"s3MonitoringConfiguration": {
"logUri": "'"$s3DemoBucket"'/logs/"
}
}
}'
For EKS cluster, is NodeGroup must be declared and is mandatory, and we can't run Spark Job just be using Fargate only?
kubectl describe
to the pending job and paste to your question? – gohm'c