Create an IAM User in AWS and assign it the necessary policies. It's important to assign only the permissions needed for the operations that DARC will perform to adhere to the principle of least privilege.
Note: Temporarily, you may use the AdministratorAccess
policy for convenience, but it's crucial to identify and apply more granular policies tailored to your requirements for security best practices.
Here follows the procedure to set up the necessary technologies for AWS provider, the provider available in this prototype. For other providers, please consult the relevant documentation.
- Install the AWS CLI following the instructions from the official AWS documentation.
- Configure the AWS CLI by running
aws configure
and inputting your new IAM user's access key ID and secret access key when prompted.
Before executing the Terraform code, set up the KUBECONFIG
environment variable to point to your Kubernetes configuration file. This step is necessary for kubectl
to interact with your cluster.
On Unix-like systems, you can set the variable by adding the following line to your shell profile:
export KUBECONFIG="~/.kube/config"
To deploy the infrastructure with Terraform:
- Initialize Terraform to download all necessary modules and files:
terraform init
- Apply the Terraform code to provision the resources:
terraform apply
To configure kubectl
to interact with the new cluster:
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
Specify the service account to run the workflow with by assigning serviceAccountName
in the spec
. For example, use "argo-workflow":
...
spec:
serviceAccountName: argo-workflow
...
- Submit the argo workflow:
argo submit -n argo --watch matrixmul.yaml
- Observe the increase in pods:
kubectl get pods -n kube-system
- Check for an increase in nodes:
kubectl get nodes
- Apply the cluster-autoscaler deployment (initially set to 0 replicas):
kubectl apply -f cluster-autoscaler-deployment.yaml
- Increase the number of replicas to trigger autoscaling:
kubectl scale deployment inflate --replicas=5
- Observe the increase in pods:
kubectl get pods -n kube-system
- Check for an increase in nodes:
kubectl get nodes