~/.aws/credentials
.
In that file, add the following values:
docker build --platform linux/amd64 -tag [image_name]:latest .
docker tag [image_name]:latest [registry_uuid].dkr.ecr.[region].amazonaws.com/[image_name]:latest
docker push [registry_uuid].dkr.ecr.[region].amazonaws.com/[image_name]:latest
./aws/env_vars.json
file, you can edit the following variables, which are used by the tool while
running in the cloud:
Change the value of the variables with the following names to match the actual
values you want the tool to use while running in the cloud:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
Values
The values in your env_vars.json
must be strings. Wrap each value in double
quotes.
mage-data-prep
in it (if you
changed the app name, then find the load balancer with that app name).exec /bin/sh: exec format error
If your cluster is running and the service launches a task that eventually
stops, check the logs for the stopped task. If the logs contain the error above,
try re-building your image with the platform flag --platform linux/amd64
.
cluster_name
This is the name of your AWS ECS cluster. Go to the AWS ECS dashboard to view the clusters and find the cluster with the name that contains theapp_name
fromvariables.tf
.
service_name
This is the name of your AWS ECS service running in your AWS ECS cluster with
the name identified from above.
mage-data-prep-sg
to whitelist IPs.
Add a new inbound rule for HTTP port 80 and use your IP address.
mage-data-prep
in it (if you
changed the app name, then find the load balancer with that app name).mage-data-prep-production-tg
by default){app_name}-execution-task-role
.
You can grant the ECS task permissions to access other AWS services by attaching IAM policies to this ECS task execution role.
For example, if you want to list the AWS events that can be used for event triggers, you can attach IAM Policy CloudWatchEventsReadOnlyAccess
to your ECS task execution role.
Apply terraform
terraform apply
to provision the EKS clusterConfigure kubectl
kubectl
with command aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
Configure PVC
EFS_VOLUME_ID
in kube/efs-pvc.yaml to the efs id in terraform outputInstall EFS CSI Driver
kubectl apply -k "github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master"
to install efs csi driverDeploy app to EKS
kubectl apply -f kube/
to deploy app or use Helm to deploy Mage.Whitelist IP in EKS node's security group
Access Mage on EKS
kubectl get nodes -o wide
and access Mage with http://[ip]:{node_port}