LogoLogo
English
English
  • Diarkis Help Center
  • Overview of Diarkis
  • Getting Started
    • Diarkis Server Template
    • Diarkis Client SDK
    • Tutorials
      • 1. Launch Diarkis Server in Local Environment
      • 2. Perform Connectivity Check with Test Client
      • 3. Implement Custom Command
      • Connect to Server from Diarkis Client
    • Samples
  • Diarkis Modules
    • Room Module
      • Set Up Room Module on Server
      • Room Sample
        • room_broadcast
      • Utilizing Room Module from Client
      • Additional Features of Room
    • MatchMaker Module
      • Set Up MatchMaker Module on Server
    • Field Module
      • Set Up Field Module on Server
    • P2P Module
      • Set Up P2P Module on Server
      • P2P Sample
    • DM (Direct Message) Module
      • Set Up DM Module on Server
    • Notifier Module
      • Set Up Notifier Module on Server
    • Session Module
      • Set Up Session Module on Server
    • Group Module
      • Set Up Group Module on Server
  • Diarkis Server
    • Launch Diarkis Server in Cloud Environment
      • AWS
    • Launch Diarkis Server on Windows Environment
    • MARS Server
    • UDP Server
    • TCP Server
    • HTTP Server
    • Metrics API
    • Inter-server Communication - Mesh
  • Diarkis Client
    • Runtime Library
      • Diarkis RUDP
    • Diarkis Module
      • Initialization and Termination of Diarkis Module
      • Customization of Diarkis Module
      • Logging System of Diarkis Module
      • Migration
      • Threads of Diarkis
    • Samples
      • C++
        • room_broadcast
        • directmessage_simple
        • group_sample
        • matching_and_turn
        • matchmaker_ticket
        • p2p_rudp_sample
        • session_simple
      • Unreal Engine Plugin
        • FieldWalker
      • Unity Plugin
        • FieldWalker
          • HowToReplicatePosition.md
  • Diarkis Tools
    • Diarkis CLI
      • Procedures to Switch to Diarkis CLI v3
  • References
    • API Reference
    • Release Notes
      • v1.0
      • v1.0.1
      • v1.0.2
      • v1.0.3
      • v1.0.4
      • v1.0.5
      • v1.0.6
  • Support
    • License and Billing
Powered by GitBook
On this page
  • Overview
  • Requirements
  • Setup Guide
  • Create ECR for Diarkis Images
  • Create and Connect to EKS for Diarkis
  • Open EKS Firewall
  • Tag the Server Image and Push
  • Apply Manifest
  • Check Diarkis Cluster
  • Setup Cluster Autoscaler
  • Setup Log Collector

Was this helpful?

  1. Diarkis Server
  2. Launch Diarkis Server in Cloud Environment

AWS

This document will help guide you through understanding the process of building, deploying, and orchestrating Diarkis on AWS (EKS).

PreviousLaunch Diarkis Server in Cloud EnvironmentNextLaunch Diarkis Server on Windows Environment

Last updated 1 month ago

Was this helpful?

Overview

Using Diarkis is easy if you make use of our provided k8s configurations. However, please note that these configurations are in a primitive state, so feel free to modify them as necessary.


Requirements

  1. Docker with one of the following configurations:

    1. MacOS - Install Docker for MacOS. See the installation guide .

    2. Linux - Install Docker for your particular distribution of Linux according to the installation guide . Note: Docker provides .deb and .rpm packages for major distributions of Linux on x86_64/amd64 architecture, as well as for Arch-based distributions.

    3. Windows (with WSL2 or Hyper-V backend) - See the installation guide . If installing Docker for the first time, please consider your use-case prior to backend selection.

  2. AWS account with billing enabled. If you do not have an AWS account nor project created already, please see to get started.

  3. AWS CLI (aws command) with proper authentication. See the installation guide (Note: AWS CLI supports all major operating systems). Please check for help on CLI authentication.

  4. Kubernetes CLI (kubectl command) available for download .

  5. EKS CLI (eksctl command) available for download on the AWS Workshop .


Setup Guide

In the following steps we will guide you through the process of building, deploying, and orchestrating a template Diarkis server cluster. These instructions should be enough to help you get started.

Create ECR for Diarkis Images

aws sts get-caller-identity  # Verify the correct target  
aws ecr create-repository --repository-name http  
aws ecr create-repository --repository-name udp  
aws ecr create-repository --repository-name tcp  
aws ecr create-repository --repository-name mars  

Create and Connect to EKS for Diarkis

eksctl create cluster -f cloud/aws/cluster_config.yaml  # takes about 10 minutes  

Note: If an error occurs regarding NAT gateway compatibility in the selected AZ, choose a different AZ

aws eks --region ap-northeast-1 update-kubeconfig --name diarkis  # Get k8s credentials  

Open EKS Firewall

Allow TCP and UDP traffic for ports 7000-8000 from 0.0.0.0/0 to EKS nodes. We recommend setting this in the security group named: eks-cluster-sg-diarkis-*.


Tag the Server Image and Push

From the project root generated by server-template, run the following commands:

make build-local  

After generating server executables (udp, tcp, http, mars) in ./remote_bin, build the container image:

make setup-aws  
make build-container-aws  
make push-container-aws  

Apply Manifest

kustomize build k8s/aws/overlays/dev0 | kubectl apply -f -  

Check if the following four components are running:

$ kubectl get po -n dev0
NAME                    READY   STATUS    RESTARTS   AGE  
http-5c7dbbb6d7-lhjlm   1/1     Running   0          3d14h  
mars-0                  1/1     Running   0          3d14h  
tcp-88dc5f97d-7sqk9     1/1     Running   0          3d14h  
udp-fdc6bbccc-dwc5w     1/1     Running   0          3d14h  

Check Diarkis Cluster

First, retrieve the public endpoint:

EXTERNAL_IP=$(kubectl get svc http -o json -n dev0 | jq -r '.status.loadBalancer.ingress[].hostname')  
kubectl get svc -n dev0 -o wide  # Alternatively, use this command  

Send an HTTP GET request to the obtained EXTERNAL_IP:

curl ${EXTERNAL_IP}/auth/1  

If you receive a response like the following, it is working correctly:

{
  "TCP": "ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com:7201",
  "UDP": "ec2-yy-yy-yy-yy.ap-northeast-1.compute.amazonaws.com:7101",
  "sid": "xxxxxxxxxx",
  "encryptionKey": "xxxxxxxxxx",
  "encryptionIV": "xxxxxxxxxx",
  "encryptionMacKey": "xxxxxxxxxx"
}

If there are missing items, there may be an issue with one of the deployed components. At this point, we recommend you to contact Diarkis support for further assistance.


Setup Cluster Autoscaler

kubectl apply -f cluster-autoscaler-autodiscover.yaml  

This file is pre-configured for the cluster name diarkis. If using a different cluster name, modify references to diarkis in the manifest.


Setup Log Collector

Logs from containers can be aggregated using CloudWatch Logs. fluent-bit is already deployed in the amazon-cloudwatch namespace, but permissions are not set.

Assign the CloudWatchAgentServerPolicy to diarkis-public and diarkis-private nodes to aggregate logs. Logs will appear under /aws/containerinsights/Cluster_Name/application, allowing for filtering.

Before we can push our Diarkis component images for deployment, we must first prepare remote ECR registries. As a base image we make use of alpine by default, it can be retrieved from .

here
here
experimental support
here
here
here
here
here
here
Docker Hub