# AWS (EKS)

{% hint style="danger" %}
When you have previously registered an existing EKS cluster in Cocktail and need to delete it, simply <mark style="color:red;">**delete the cluster from the AWS console**</mark>. Please keep this in mind.
{% endhint %}

## 1. EKS Cluster Registration

1\) Register the created EKS cluster with the Cocktail Cloud using the following procedure.

### 1.1 Move to the Cluster Registration screen

1\) Click on the "+ Register cluster in use" button in the upper right corner of the \[Infrastructure] - \[Clusters] tab.

### 1.2 Choose Cluster Provider and Type

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FoPAl5gdehU2owhb5vgDA%2Fimage.png?alt=media&#x26;token=142ca1eb-c5f7-4525-a1df-351a60fd3b5b" alt=""><figcaption><p>[Screen] Cluster Configuration Form</p></figcaption></figure>

1\) Select 'Amazon Web Service' as the provider in the cluster configuration form.

2\) Choose the type attribute as 'EKS'.

3\) Once these two attributes are selected, the Cluster ID setting will be displayed in the cluster configuration form.

4\) Choose the region as the one where EKS was created (Example: Seoul (ap-northeast-2)).

{% hint style="info" %}

* The Provider and Type fields are mandatory.
  {% endhint %}

### 1.3 Cluster Registration

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FxJkHIUkX0lL9rBebZOLT%2Fimage.png?alt=media&#x26;token=e776fbb0-5b5d-441e-939a-cd76109d2009" alt=""><figcaption><p>[Screen] Cluster Information in AWS Console</p></figcaption></figure>

<table><thead><tr><th width="303.06306306306305">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td> Cluster ID*</td><td>Cluster name managed by AWS EKS<br>- Retrieve from the Kubernetes config file for the cluster to be registered (~/.kube/config)<br>- Alternatively, check in the AWS console under EKS > Clusters and input the information.</td></tr><tr><td>ID*</td><td>The content written for the cluster ID remains the same<br>- Must not overlap with the IDs of other already registered clusters</td></tr><tr><td>Kubernetes Version*</td><td>Enter the Kubernetes Version for the Cluster to be registered</td></tr><tr><td>Cluster Name*</td><td>The Cluster Name to be used in Cocktail Cloud</td></tr><tr><td>Description</td><td>Description of the Cluster to be registered</td></tr><tr><td>Master address*</td><td>Kubernetes Master API Address<br>-Alternatively, check AWS Console > EKS > API Server Endpoint section and enter</td></tr><tr><td>Node Port Host Address*</td><td>Enter the Public IP of Kubernetes</td></tr><tr><td>Node Port Range*</td><td>Input the port range 30000-32767, which is available in Kubernetes</td></tr><tr><td>Cluster CA Certification*</td><td><p>Cluster CA Certificate</p><p>-  check AWS Console > EKS > Certificate authority section and enter.</p></td></tr><tr><td>Access Key ID*</td><td>ACCESS_KEY of the AWS IAM user with access to the cluster to be registered<br>- Confirm and retrieve from AWS Console > IAM > Users.</td></tr><tr><td>Secret Access Key*</td><td><p>SECRET_ACCESS_KEY of the AWS IAM user with access to the cluster to be registered</p><p>- Confirm and retrieve from AWS Console > IAM > Users.</p></td></tr></tbody></table>

1\) Click the "Save" button in the menu bar to save the cluster registration.

2\) After registration is complete, the cluster list will be displayed.

## 2. Create Storage Class

1\) To use PV/PVC, you need to create a new storage class.

### 2.1 Move to the storage class creation screen

1\) Click on the "+ Create" button at the top right corner of the \[Storage] - \[Storage Classes] tab, then select AWS EBS CSI.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FWLC9SWg0JIPFhjEDvOpg%2Fimage.png?alt=media&#x26;token=19108dfc-3f49-46ee-aa8b-e16cfc26bf63" alt=""><figcaption><p>[Screen] Initial Storage Class Screen</p></figcaption></figure>

### 2.2 Configure Storage Class

1\) Fill out the settings form accordingly, then click the "Save" button.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FQu49Z0oyiFzCUlHaM4Kb%2Fimage.png?alt=media&#x26;token=532cf78a-be37-450f-9de2-01a463f1b039" alt=""><figcaption><p>[Screen] Storage Class Configuration Screen</p></figcaption></figure>

| Item (\* is required) | Content                                                                                                                                                                                      |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name\*                | Storage Controller Name                                                                                                                                                                      |
| Description           | Description of the Storage Controller                                                                                                                                                        |
| Base Storage          | Default Storage Settings for Use in this Cluster                                                                                                                                             |
| Volume Binding Mode\* | <p>Volume Binding Mode Selection</p><p>- Immediate: Operates at the time PVC is created.</p><p>- WaitForFirstConsumer: Operates at the time Pod is created</p>                               |
| Reclaim Policy\*      | <p>- RETAIN: The storage remains when deleted and is automatically reattached upon recreation.</p><p>- DELETE: The storage is deleted along with the resource.</p>                           |
| Parameters            | Name and Value are separated. In each server, enter the IP of the server-side (target) for server, and for share, enter the mount path of the server-side (target).                          |
| Mount Options         | Only values can be registered. For each, enter "hard" for the value and specify the NFS version (nfsvers). For default OS, set nfsversion to 4.1, and for NAS or other storage, set it to 3. |

### 2.3 Storage Class Creation Completed

1\) You can now verify the created storage class

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2F1CeXwo9bIWSDz7VxzadY%2Fimage.png?alt=media&#x26;token=0f6e536d-f0ab-4223-b65d-d9162c45d6f0" alt=""><figcaption><p>[Screen] Storage Class Creation Screen</p></figcaption></figure>
