

# Tutorial: Create an unmanaged compute environment using Amazon EKS resources
<a name="create-compute-environment-unmanaged-eks"></a>

Complete the following steps to create an unmanaged compute environment using Amazon Elastic Kubernetes Service (Amazon EKS) resources.

1. Open the Amazon Batch console at [https://console.amazonaws.cn/batch/](https://console.amazonaws.cn/batch/).

1. From the navigation bar on top of the page, select the Amazon Web Services Region to use.

1. In the navigation pane, choose **Compute environments**.

1. Choose **Create**.

1. Configure the environment.

   1. For **Compute environment configuration**, choose **Amazon Elastic Kubernetes Service (Amazon EKS)**.

   1. For **Orchestration type**, choose **Unmanaged**.

1. For **Name**, specify a unique name for your compute environment. The name can be up to 128 characters in length. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (\_).

1. For **EKS cluster**, choose an existing Amazon EKS cluster. To create a new EKS cluster, follow the steps on [Create an Amazon EKS cluster page](https://docs.amazonaws.cn/eks/latest/userguide/create-cluster.html).
**Note**  
Amazon Batch does not run jobs on [Amazon EKS Auto Mode](https://docs.amazonaws.cn/eks/latest/userguide/automode.html) worker nodes today — Amazon Batch's unmanaged Amazon EKS compute environment requires persistent, customer-labeled nodes, whereas Auto Mode provisions nodes dynamically via Karpenter based on pending-pod pressure.  
An unmanaged Amazon EKS compute environment can coexist with an Amazon EKS cluster that has Auto Mode enabled for other workloads, as long as the Amazon Batch compute environment points at a dedicated node group not managed by Auto Mode. Auto Mode will continue to manage the non-Amazon Batch workloads independently without interfering with the Amazon Batch node group.

1. For **Namespace**, enter a Kubernetes namespace to group your Amazon Batch processes in the cluster.

1. (Optional) For **Maximum vCPUs**, specify the maximum number of vCPUs available for job scheduling from your provisioned capacity.

1. (Optional) Expand **Tags**. Choose **Add tag** and then enter a key-value pair.

1. Choose **Next page**.

1. For **Review**, review the configuration steps. If you need to make changes, choose **Edit**. When you're finished, choose **Create compute environment**.

**Assigning Amazon EKS cluster nodes to unmanaged compute environment**  
After creating the unmanaged compute environment, you need to label your Amazon EKS nodes with the compute environment UUID.  
First, get the compute environment UUID from the `DescribeComputeEnvironments` API result:  

```
$ aws batch describe-compute-environments \
    --compute-environments {{unmanagedEksCE}} \
    --query "computeEnvironments[].{name: computeEnvironmentName, uuid: uuid}"
```
Get the node information:  

```
kubectl get nodes -o name
```
Label the nodes with the Amazon Batch compute environment UUID:  

```
kubectl label {{<node-name>}} batch.amazonaws.com/compute-environment-uuid={{uuid}}
```