> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon EKS

> Provides installation and configuration of Apinizer on Amazon EKS (Elastic Kubernetes Service). Provides AWS EKS cluster installation, resource creation and Apinizer installation steps on EKS. Includes VPC, IAM roles, worker nodes and Apinizer deployment configurations.

<Note>
  This document describes the necessary steps for installing Apinizer on Amazon EKS (Elastic Kubernetes Service). In the first 6 sections, AWS EKS installation, resource creation and usage steps are described step by step from the beginning. If there is a ready EKS cluster on AWS, you can start directly from [section 7](#7-eks-installation-test-and-sample-deployment).
</Note>

## 1. Introduction

### Minimum System Requirements

For Apinizer installation on AWS EKS Cluster, the total CPU Cores of Compute Nodes to be defined in the Node Group must be at least **6 cores**.

<CardGroup cols={2}>
  <Card title="t3.medium Example" icon="server">
    If **t3.medium** type server is selected, 3 are required.
  </Card>

  <Card title="t3.xlarge Example" icon="server">
    If you add **t3.xlarge** type server, 2 will be sufficient.
  </Card>
</CardGroup>

### What is AWS EKS (Elastic Kubernetes Service)?

**Amazon Elastic Kubernetes Service (Amazon EKS)** is a managed service you can use to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes Control Plane (Master) or nodes (Worker Nodes).

**Kubernetes** is an open-source system for automating deployment, scaling, and management of containerized applications.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/eks-overview.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=63971fde75348909fd3490b74f135506" alt="Amazon EKS Overview" width="1000" height="431" data-path="images/setup/bulut/amazon-eks/eks-overview.png" />
</Frame>

## 2. Configure EKS VPC and Subnets

### What is AWS VPC and Subnet?

**Amazon AWS VPC (Virtual Private Cloud)** is a private virtual network within AWS. In other words, it can be called AWS's network infrastructure component. It is an advanced virtual network infrastructure developed by Amazon AWS for all components to be created on AWS to communicate with each other.

Within VPC, we can create networks, subnets, gateways specific to our own use. Connections between different networks and subnets can be provided with Route tables belonging to them.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/vpc-topology.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=f8e46400484d9d9dfa398d41b5c7d6e1" alt="VPC Topology" width="1000" height="758" data-path="images/setup/bulut/amazon-eks/vpc-topology.png" />
</Frame>

**VPC Subnet:** After creating a specific network on AWS, subnets belonging to this network can be created. By following the steps below, subnets can be created on AWS VPC.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/vpc-subnets.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=e19b26b7ca3fa627855ac65ca3f472b2" alt="VPC Subnets" width="1000" height="1319" data-path="images/setup/bulut/amazon-eks/vpc-subnets.png" />
</Frame>

VPC and Subnets for EKS need to be set correctly and subnets need to be defined as specified in AWS documentation. If you don't know VPC and subnet definition, you can use AWS's ready template.

For details: [AWS EKS VPC Documentation](https://docs.aws.amazon.com/eks/latest/userguide/create-public-private-vpc.html)

### Creating and Configuring AWS VPC

By following the steps below, the network structure suitable for EKS will be installed automatically.

For details: [AWS CloudFormation Console](https://console.aws.amazon.com/cloudformation/)

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/23-vpc-cloudformation.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=9fc6d348e522ffe0c562d0af7d5c5f6c" alt="AWS CloudFormation Console" width="1000" height="700" data-path="images/setup/bulut/amazon-eks/23-vpc-cloudformation.png" />
</Frame>

## 3. Configure EKS IAM Roles

### What is AWS Identity and Access Management (IAM) Role?

Using **AWS Identity and Access Management (IAM)**, you can determine who can access AWS services and resources under what conditions.

IAM is a feature of your AWS account and is provided at no additional charge. IAM is not something running like an instance or a database in terms of structure, but entirely manages permissions for us, managing all users who have access to the AWS account used, from who can access which service in what way.

IAM manages **6 main topics** in terms of main concept:

* Users
* Groups
* Roles
* IAM Access Policies
* API Keys
* Password policy, MFA

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/iam-overview.jpg?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=a3994c06738fe8103342772c3925bb7d" alt="IAM Overview" width="1000" height="434" data-path="images/setup/bulut/amazon-eks/iam-overview.jpg" />
</Frame>

<Note>
  For detailed information: [What is AWS IAM?](https://emirozbirdeveloper.medium.com/aws-iam-kimsin-sen-c84b677387b9)
</Note>

### Creating and Configuring AWS IAM

Go to the **Roles** page from the left menu and create a new **Role**.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/55-iam-roles-page.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=a03b91d7d83d15ccb63688093b9230b8" alt="IAM Roles Page" width="1000" height="225" data-path="images/setup/bulut/amazon-eks/55-iam-roles-page.png" />
</Frame>

In this section, we need to create two **Roles**. The first is the Role to be used for **EKS cluster**, and the second is the Role information that **Worker Node Groups** within EKS will use.

#### 1. Creating the Role to be Used by EKS Cluster

To create a role, the operations in the given images should be performed in order.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/54-iam-roles.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=12898e5e24de20decf27baf825ad918e" alt="IAM Roles" width="200" height="186" data-path="images/setup/bulut/amazon-eks/54-iam-roles.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/53-iam-create-role.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=1b7d1cbb00d6e94abfe96d76a4c0f3a6" alt="Create Role" width="1000" height="1049" data-path="images/setup/bulut/amazon-eks/53-iam-create-role.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/52-iam-eks-service.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=beac9684a504bd4d5d46e807ff098a57" alt="EKS Service" width="1000" height="524" data-path="images/setup/bulut/amazon-eks/52-iam-eks-service.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/51-iam-permissions.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=9eb3f9af5e245130274446facbe0245a" alt="Permissions" width="1000" height="1113" data-path="images/setup/bulut/amazon-eks/51-iam-permissions.png" />
</Frame>

Continue on the incoming page without entering any key-value information.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/50-iam-review.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=7716682767e73d18bf995620d70146be" alt="Review" width="1000" height="1097" data-path="images/setup/bulut/amazon-eks/50-iam-review.png" />
</Frame>

The IAM role to be used by the EKS cluster should be created. This role should contain the necessary permissions for the EKS cluster to access AWS services.

#### 2. Creating the Role to be Used by EKS Cluster Worker Node Groups

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/48-iam-worker-role.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=c17d1942816f69a1847a168261b2cd04" alt="Worker Node Role" width="1000" height="41" data-path="images/setup/bulut/amazon-eks/48-iam-worker-role.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/47-iam-worker-policies.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=a54eac32a44c3dd253080794da7bad69" alt="Worker Policies" width="1000" height="532" data-path="images/setup/bulut/amazon-eks/47-iam-worker-policies.png" />
</Frame>

The following Policies should be selected for this Role.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/46-iam-worker-policies-alt.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=00cca7803a894b1e356a5a7ba085f3a3" alt="Worker Policies Alt" width="1000" height="41" data-path="images/setup/bulut/amazon-eks/46-iam-worker-policies-alt.png" />
</Frame>

The IAM role to be used by Worker Node Groups should be created. This role should contain the necessary permissions for worker nodes to access AWS services (EC2, EBS, ELB, etc.).

## 4. Installing EKS Master Node

### Creating and Configuring AWS EKS (Elastic Kubernetes Service)

After completing the above steps, AWS EKS installation can be started.

Continue the process by typing EKS in the search section.

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/45-eks-search.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=521171cf19aa391e6c9a0da6d9a76342" alt="EKS Search" width="1000" height="215" data-path="images/setup/bulut/amazon-eks/45-eks-search.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/44-eks-create.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=f3be99f04304962b81d0ef82310eb10c" alt="EKS Create" width="1000" height="284" data-path="images/setup/bulut/amazon-eks/44-eks-create.png" />
</Frame>

Select the cluster name, the kubernetes version we want to use, and the IAM role we created earlier.

<Steps>
  <Step title="Configure cluster">
    Select cluster name, Kubernetes version and IAM role.

    <Frame>
      <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/43-eks-cluster-config.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=978e31566abbbc150aeada0a4e0507ad" alt="Cluster Config" width="1000" height="1093" data-path="images/setup/bulut/amazon-eks/43-eks-cluster-config.png" />
    </Frame>
  </Step>

  <Step title="Specify network communication">
    Select VPC and subnets. It is recommended to select at least 2 subnets for EKS.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/22-eks-subnet.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=66df2570fe7a641ebd195c9f8dbdc70f" alt="Subnet" width="1000" height="788" data-path="images/setup/bulut/amazon-eks/22-eks-subnet.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/42-eks-network.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=7294224916487dacaf6456d6bd276a9a" alt="Network" width="1000" height="361" data-path="images/setup/bulut/amazon-eks/42-eks-network.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/41-eks-security-group.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=2b40e0e2d19c7ae30c989df12250edc6" alt="Security Group" width="1000" height="870" data-path="images/setup/bulut/amazon-eks/41-eks-security-group.png" />
    </Frame>
  </Step>

  <Step title="Configure logging">
    Select CloudWatch Log Group or create a new log group. This section can be configured as desired.

    <Frame>
      <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/40-eks-logging.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=c168d07e3cf7d2694e2e3bdb7c2f004d" alt="Logging" width="1000" height="757" data-path="images/setup/bulut/amazon-eks/40-eks-logging.png" />
    </Frame>
  </Step>

  <Step title="Review and create">
    Finally, the defined information is displayed. At this stage, no error is seen. Start creating the cluster by saying **Create**.

    <Frame>
      <img src="https://mintcdn.com/apinizer/n7lg0UCnwxDLvPwK/images/setup/bulut/amazon-eks/39-eks-creating.png?fit=max&auto=format&n=n7lg0UCnwxDLvPwK&q=85&s=26ecb53e06c74a91e09e0d363d04e888" alt="Creating" width="1000" height="351" data-path="images/setup/bulut/amazon-eks/39-eks-creating.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/38-eks-review.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=2d32239f4b83fd32b3bfece11af90b67" alt="Review" width="1000" height="206" data-path="images/setup/bulut/amazon-eks/38-eks-review.png" />
    </Frame>
  </Step>
</Steps>

<Note>
  The EKS Cluster is being created. This process takes approximately 5 minutes. While this process continues, we can download and configure the necessary tools to access and manage EKS from our Client computer.
</Note>

## 5. Installing and Configuring AWS CLI and kubectl

Download the necessary tools from the addresses below. Since Windows will be used as the Client computer in this document, versions suitable for Windows are downloaded.

### AWS CLI Installation

After installing the downloaded **.msi** tool, configure it according to your Cluster information as follows.

For details: [AWS CLI Getting Started Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)

<Steps>
  <Step title="Getting credential information by going to IAM service">
    Access Key and Secret Key information are obtained from IAM Console.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/37-iam-user.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=c2d18270b348133796743d17ef99441b" alt="IAM User" width="1000" height="208" data-path="images/setup/bulut/amazon-eks/37-iam-user.png" />
    </Frame>

    Go to **Access** information by clicking the **Manage access keys** button from the incoming screen.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/36-iam-manage-access-keys.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=8fbb2c9bd536cc7f72e26eaaa90421c7" alt="Manage Access Keys" width="1000" height="447" data-path="images/setup/bulut/amazon-eks/36-iam-manage-access-keys.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/35-access-key-dialog.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=4d6f484ed91d2036d7beb4606a6785ac" alt="Access Key Dialog" width="1000" height="392" data-path="images/setup/bulut/amazon-eks/35-access-key-dialog.png" />
    </Frame>

    **Access Key** and **Secret** information are displayed in the window below. This information should be saved somewhere before closing the window.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/34-access-key-secret.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=09457478b2d5d363c733b0ddffcdb038" alt="Access Key Secret" width="1000" height="375" data-path="images/setup/bulut/amazon-eks/34-access-key-secret.png" />
    </Frame>
  </Step>

  <Step title="Making AWS configuration in Windows CLI">
    ```powershell theme={null}
    aws configure
    ```

    Start the configuration process by entering the **Access Key** and **Secret** information recorded earlier.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/33-aws-cli-access-key.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=6949a742652d521bdf6b3eb4861d5da5" alt="AWS CLI Access Key" width="1000" height="257" data-path="images/setup/bulut/amazon-eks/33-aws-cli-access-key.png" />
    </Frame>
  </Step>
</Steps>

### KUBECTL Installation

Kubectl should be downloaded to match the cluster version.

For details: [AWS EKS kubectl Installation Guide](https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html)

<Steps>
  <Step title="Downloading KUBECTL">
    Kubectl is downloaded for Windows and added to PATH.
  </Step>

  <Step title="Defining necessary information to connect to EKS Cluster on Windows client machine">
    ```powershell theme={null}
    # Example Configuration Command
    aws eks update-kubeconfig --region [EKS_Region] --name [EKS_Cluster_Name]
    ```

    Here, **region** information can be obtained from the top menu as seen in the image below. Similarly, the cluster name can be obtained by going to the EKS page.

    <Note>
      The section we need is **eu-central-1**.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/32-aws-region.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=665baaf26a9f6978bd7758bfa2d8c64a" alt="AWS Region" width="200" height="422" data-path="images/setup/bulut/amazon-eks/32-aws-region.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/31-eks-cluster-name.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=f419881830f879e2a05c0860c7689638" alt="EKS Cluster Name" width="1000" height="146" data-path="images/setup/bulut/amazon-eks/31-eks-cluster-name.png" />
    </Frame>
  </Step>
</Steps>

To check cluster status:

```powershell theme={null}
aws eks --region eu-central-1 describe-cluster --name apinizer-eks-cluster1 --query cluster.status
```

If multiple clusters are managed, **kubeconfig** information should be updated as follows:

```powershell theme={null}
aws eks --region eu-central-1 update-kubeconfig --name apinizer-eks-cluster2
```

## 6. Creating EKS Worker Nodes

This section describes the creation of Worker Nodes for EKS. Go to AWS Console again and apply the following steps.

<Steps>
  <Step title="Creating Node Group">
    Create a new node group with the "Add Node Group" option from EKS Console.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/29-node-group-create.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=bc65de1ac0ff06acf37eed86f85d4a67" alt="Node Group Create" width="1000" height="395" data-path="images/setup/bulut/amazon-eks/29-node-group-create.png" />
    </Frame>
  </Step>

  <Step title="Node Group Configuration">
    For node group:

    * Node group name
    * IAM role (worker node role created earlier)
    * Instance type (e.g.: t3.medium, t3.xlarge)
    * Disk size

    are selected.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/28-node-group-config.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=be3aaac408388701e47c51b8aeec75d5" alt="Node Group Config" width="1000" height="1112" data-path="images/setup/bulut/amazon-eks/28-node-group-config.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/27-node-group-config-alt.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=95d2dd75c7aff446388b5a15963c97fb" alt="Node Group Config Alt" width="154" height="44" data-path="images/setup/bulut/amazon-eks/27-node-group-config-alt.png" />
    </Frame>
  </Step>

  <Step title="Setting Compute and Scaling Configuration">
    Minimum, maximum and desired node numbers are determined for node group.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/26-node-group-scaling.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=09dd2b905c144c7608b90f5ff5b71fa7" alt="Node Group Scaling" width="1000" height="1013" data-path="images/setup/bulut/amazon-eks/26-node-group-scaling.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/25-node-group-scaling-alt.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=9bba6e7577aae1a5df3467d640821f9d" alt="Node Group Scaling Alt" width="1000" height="587" data-path="images/setup/bulut/amazon-eks/25-node-group-scaling-alt.png" />
    </Frame>
  </Step>

  <Step title="Specifying Network Communication">
    Subnets are selected and SSH key pair is determined.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/21-node-group-network.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=adab73771b0bb1783c1789ec978f5f0f" alt="Node Group Network" width="1000" height="551" data-path="images/setup/bulut/amazon-eks/21-node-group-network.png" />
    </Frame>
  </Step>

  <Step title="Review and Create">
    Finally, the defined information is displayed. If no error is seen at this stage, start creating the cluster by saying **Create**.

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/20-node-group-review.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=abcb553ac64ef69ab06dbfbcaa4be144" alt="Node Group Review" width="1000" height="70" data-path="images/setup/bulut/amazon-eks/20-node-group-review.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/24-node-group-creating.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=fca00d58269b9c650bb07eeed7e63142" alt="Node Group Creating" width="1000" data-path="images/setup/bulut/amazon-eks/24-node-group-creating.png" />
    </Frame>
  </Step>
</Steps>

This process takes approximately 5 minutes. After the installation is completed and activated, deployment etc. operations can be done with the previously configured kubectl.

The image showing that Node Group installation is completed is below:

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/19-node-group-ready-alt.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=00542a1a5ac8204f4c27d159957e5f01" alt="Node Group Ready Alt" width="1000" height="130" data-path="images/setup/bulut/amazon-eks/19-node-group-ready-alt.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/18-node-group-ready.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=dcc02d33bc846ee8984102e51e232ef9" alt="Node Group Ready" width="1000" height="257" data-path="images/setup/bulut/amazon-eks/18-node-group-ready.png" />
</Frame>

## 7. EKS Installation Test and Sample Deployment

From this stage, checking the kubernetes cluster with kubectl whose installation and definitions were made earlier and testing it with a sample nginx application is described.

### AWS EKS Environment Test

Kubernetes cluster resources should be checked by following the commands below.

```powershell theme={null}
aws eks --region eu-central-1 describe-cluster --name apinizer-eks-cluster --query cluster.status
aws eks --region eu-central-1 update-kubeconfig --name apinizer-eks-cluster
kubectl get nodes
```

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/30-aws-cli-configure.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=2de2f4b9c93a6265fc5dac25520b7410" alt="AWS CLI Configure" width="1000" data-path="images/setup/bulut/amazon-eks/30-aws-cli-configure.png" />
</Frame>

### Loading and Testing Sample Application

In this section, loading the Nginx application defined in the .yaml file below as an example to the kubernetes cluster is described and tested after being exposed.

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-nginx
spec:
  selector:
    matchLabels:
      run: my-nginx
  replicas: 4
  template:
    metadata:
      labels:
        run: my-nginx
    spec:
      containers:
      - name: my-nginx
        image: nginx
        ports:
        - containerPort: 80
```

```powershell theme={null}
kubectl apply -f nginx.yaml
kubectl get pods
```

The application is seen to be successfully loaded to the kubernetes cluster.

Open the application as a service with the following command:

```powershell theme={null}
kubectl expose deployment/my-nginx --port=80 --target-port=80 --name=my-nginx-service --type=LoadBalancer
kubectl get svc
```

For testing:

```powershell theme={null}
curl -k <EXTERNAL-IP>
```

## 8. Installing Apinizer on EKS

What is described under this heading describes the definition of opening Apinizer as a service, different from Apinizer installation documents.

### Apinizer Management Console installation

A **.yaml** file should be created for Apinizer and loaded to AWS EKS cluster.

As stated in the Installation and Configuration document, **Replicaset MongoDB** and **Elasticsearch** are needed.

* For MongoDB, go to [MongoDB Atlas](https://account.mongodb.com/account/register) and create an account, and it can be used free of charge up to a limited DB size. Apinizer does not need a large database because it only keeps configuration definitions in MongoDB.

* Similarly, for Elasticsearch, Apinizer can be defined by going to [Elastic Cloud](https://cloud.elastic.co/registration) and using an elastic service in the cloud environment.

Or you can install **Replicaset MongoDB** and **Elasticsearch** on an **EC2** server in AWS and define them.

Example **apinizer-deployment.yaml** file settings are below:

```yaml theme={null}
apiVersion: v1
kind: Namespace
metadata:
  name: apinizer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: manager
  namespace: apinizer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: manager
      version: 'v1'
  template:
    metadata:
      labels:
        app: manager
        version: 'v1'
    spec:
      containers:
      - name: manager
        image: apinizercloud/manager:2023.01.1
        imagePullPolicy: IfNotPresent
        env:
        - name: SPRING_PROFILES_ACTIVE
          value: prod
        - name: SPRING_DATA_MONGODB_DATABASE
          value: apinizerdb-aws
        - name: SPRING_DATA_MONGODB_URI
          value: 'YOUR_MONGODB_URL'
        - name: JAVA_OPTS
          value: ' -Xmx1400m -Xms1400m'
        resources:
          requests:
            memory: '2Gi'
            cpu: '1'
          limits:
            memory: '2Gi'
            cpu: '1'
        ports:
        - name: http
          containerPort: 8080
```

```powershell theme={null}
kubectl apply -f apinizer-deployment.yaml
kubectl get pods -n apinizer
```

After Apinizer Management Console is loaded to EKS environment, a database named **apinizerdb** will be created in MongoDB database. The license key provided to you by Apinizer should be entered into the **general\_settings** table.

The following permissions should be defined for Apinizer Management Console to access and manage Kubernetes resources.

Example **service.yaml** file settings are below:

```yaml theme={null}
apiVersion: v1
kind: Namespace
metadata:
  name: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kube-system
```

Example **adminuser.yaml** file settings are below:

```yaml theme={null}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kube-system
```

```powershell theme={null}
kubectl apply -f service.yaml
kubectl apply -f adminuser.yaml
kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts
kubectl create clusterrolebinding apinizer -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-system:apinizer
```

### Creating Access Service for Apinizer Management Console

After the installation is completed, a service is needed to access Apinizer Management Console.

A service is created by following the steps below. It may take a minute or two to get the external IP sometimes.

```powershell theme={null}
kubectl expose -n apinizer deployment.apps/manager --port=80 --target-port=8080 --name=apinizer-console-service --type=LoadBalancer
kubectl get svc -n apinizer
```

After the service is created, Apinizer Management Console can be accessed from the **EXTERNAL-IP** address.

### Apinizer Management Console Login

Login is made by writing the service access address in step 2 to the browser's address bar. You can contact Apinizer support team for default username password.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/17-apinizer-console-login.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=35377c2696d88a51dcaaadb4ee01b0c8" alt="Apinizer Console Login" width="1000" data-path="images/setup/bulut/amazon-eks/17-apinizer-console-login.png" />
</Frame>

## 9. Apinizer Configurations

### Defining Log Servers

Apinizer stores API traffic and metric information in Elasticsearch database. To continue the installation process, Elasticsearch cluster definitions need to be made.

Go to **Administration → Server Management → Elasticsearch Clusters** page from the menu in Apinizer Management Console application.

**The image containing Elasticsearch cluster definition settings is given below:**

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/03-elasticsearch-cluster.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=237775085aa83cce313cf11e8e58e179" alt="Elasticsearch Cluster" width="1000" height="521" data-path="images/setup/bulut/amazon-eks/03-elasticsearch-cluster.png" />
</Frame>

**Test Connection** button can be used to test Elasticsearch server connection with Apinizer.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/16-elasticsearch-test.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=8595e6c718ea18551c4a1c99cfbbb495" alt="Elasticsearch Test" width="1000" data-path="images/setup/bulut/amazon-eks/16-elasticsearch-test.png" />
</Frame>

### Environment Definition

At least one environment needs to be loaded (**deploy**) for an *API Proxy* to be accessible. Apinizer also allows an API Proxy to be loaded to multiple environments.

Go to **Administration → Server Management → Gateway Environment** page from the menu in Apinizer Management Console application.

**The image containing environment definition settings is given below:**

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/02-gateway-environment.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=ac8252e706a093b7391c35155f9b6a0c" alt="Gateway Environment" width="1000" height="461" data-path="images/setup/bulut/amazon-eks/02-gateway-environment.png" />
</Frame>

The following values are the default values of the servers. They can be changed according to your cluster resources.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/15-environment-config.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=959d4436d0fdc0430574f2758610e261" alt="Environment Config" width="1000" height="482" data-path="images/setup/bulut/amazon-eks/15-environment-config.png" />
</Frame>

The environment definition process is completed by clicking the **Create Environment** button.

When environments are listed, the **Prod** type environment is deployed to EKS by clicking the **Unpublished** button showing the status of the relevant environment on the screen and then the **Publish** button.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/01-environment-publish.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=10508e52459084b8f13e158cdef63876" alt="Environment Publish" width="1000" data-path="images/setup/bulut/amazon-eks/01-environment-publish.png" />
</Frame>

<Note>
  The environment loading process will be loaded to EKS in approximately 3 minutes.
</Note>

<Note>
  For detailed information about Gateway Runtime environment definition and publishing operations, see [Gateway Runtimes page](/en/admin/server-management/gateway-runtimes).
</Note>

### Opening Environment as Service

Finally, a service needs to be created to access APIs that will run in the Environment we published.

```powershell theme={null}
kubectl expose -n prod deployment.apps/worker --port=80 --target-port=8091 --name=apinizer-worker-service --type=LoadBalancer
kubectl get svc -n prod
```

The **LoadBalancer (EXTERNAL-IP)** value produced by AWS should be assigned as the **Access URL** value of the defined Prod Environment.

First, click the edit button in the **Environment Info** table of the page where the environment is edited.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/14-environment-edit.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=231654412e4a72101d0cf2795bff22c7" alt="Environment Edit" width="1000" height="108" data-path="images/setup/bulut/amazon-eks/14-environment-edit.png" />
</Frame>

Then, click the edit button and change the Access URL information of the environment.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/13-environment-access-url.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=a8b98bfeed23ed5a82696d7c6e9d8fdc" alt="Environment Access URL" width="1000" data-path="images/setup/bulut/amazon-eks/13-environment-access-url.png" />
</Frame>

## 10. Publishing and Testing the First API in Apinizer

In the last step, opening an API to Apinizer as an API Proxy through a sample API definition file is described.

The project where the API Proxy will be registered is selected from the navbar menu.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/12-api-proxy-project.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=0d7a6ba30587c1893f5417bff0317cb1" alt="API Proxy Project" width="1000" height="200" data-path="images/setup/bulut/amazon-eks/12-api-proxy-project.png" />
</Frame>

Go to **Development → API Proxies** page from the project menu in Apinizer Management Console application.

Click the **+ Proxy** button to define a new API Proxy.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/11-add-proxy.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=9924307ca0836868b24934a824912f86" alt="Add Proxy" width="204" data-path="images/setup/bulut/amazon-eks/11-add-proxy.png" />
</Frame>

Select the source from which the API Proxy will be created with the selected link in the image below.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/10-api-source.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=d5b721f2d876b232e1a9021810411585" alt="API Source" width="1000" height="304" data-path="images/setup/bulut/amazon-eks/10-api-source.png" />
</Frame>

Enter the link of the API Definition file and **Parse** it.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/09-api-parse.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=770d98467c05ec05e8ffaf18e11e987c" alt="API Parse" width="1000" height="111" data-path="images/setup/bulut/amazon-eks/09-api-parse.png" />
</Frame>

Enter API Proxy information and click the **Save** button.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/08-api-save.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=878018ca4f5b4561d76ffbb48539e1f3" alt="API Save" width="1000" data-path="images/setup/bulut/amazon-eks/08-api-save.png" />
</Frame>

The **Deploy** button selected in the image below is used to load (deploy) the API Proxy.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/07-api-deploy.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=e4ad93098da08e7381d47ad2508bccbc" alt="API Deploy" width="1000" data-path="images/setup/bulut/amazon-eks/07-api-deploy.png" />
</Frame>

The loading process is confirmed.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/06-api-deploy-confirm.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=6a38fe93a62f6f0872211a4502bc2170" alt="API Deploy Confirm" width="1000" data-path="images/setup/bulut/amazon-eks/06-api-deploy-confirm.png" />
</Frame>

Come to the endpoint (endpoint) you want to test from the **Develop** tab of the API Proxy and click the **Test Endpoint** button.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/05-api-test-endpoint.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=37d696c07dc7bd4fcaae91a980f8aeca" alt="API Test Endpoint" width="1000" height="532" data-path="images/setup/bulut/amazon-eks/05-api-test-endpoint.png" />
</Frame>

The image containing the test dialog is given below.

<Frame>
  <img src="https://mintcdn.com/apinizer/74TMnSOZDvjtaICJ/images/setup/bulut/amazon-eks/04-api-test-dialog.png?fit=max&auto=format&n=74TMnSOZDvjtaICJ&q=85&s=3d671b04182c8604893644348ea3a360" alt="API Test Dialog" width="1000" height="398" data-path="images/setup/bulut/amazon-eks/04-api-test-dialog.png" />
</Frame>

<Note>
  For detailed information about API Proxy, see [Developer Guide](/en/develop/quick-start).

  For detailed information about Test Console, see [Test Console page](/en/develop/test-debug-tools/test-console).
</Note>
