-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Update documentation to align format across project (as much as…
… possible) (#1759)
- Loading branch information
1 parent
4cf6f14
commit 2d96b78
Showing
40 changed files
with
1,008 additions
and
1,853 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```sh | ||
terraform destroy -target="module.eks_blueprints_addons" -auto-approve | ||
terraform destroy -target="module.eks" -auto-approve | ||
terraform destroy -auto-approve | ||
``` | ||
|
||
See [here](https://aws-ia.github.io/terraform-aws-eks-blueprints/main/getting-started/#destroy) for more details on cleaning up the resources created. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,154 +1,63 @@ | ||
# Amazon EKS Deployment with Agones Gaming Kubernetes Controller | ||
|
||
This example shows how to deploy and run Gaming applications on Amazon EKS with Agones Kubernetes Controller | ||
This pattern shows how to deploy and run gaming applications on Amazon EKS using the Agones Kubernetes Controller | ||
|
||
- Deploy Private VPC, Subnets and all the required VPC endpoints | ||
- Deploy EKS Cluster with one managed node group in an VPC | ||
- Deploy Agones Kubernetes Controller using Helm Providers | ||
- Deploy a simple gaming server and test the application | ||
|
||
# What is Agones | ||
|
||
Agones is an Open source Kubernetes Controller with custom resource definitions and is used to create, run, manage and scale dedicated game server processes within Kubernetes clusters using standard Kubernetes tooling and APIs. | ||
Agones is an open source Kubernetes controller that provisions and manages dedicated game server | ||
processes within Kubernetes clusters using standard Kubernetes tooling and APIs. | ||
This model also allows any matchmaker to interact directly with Agones via the Kubernetes API to provision a dedicated game server | ||
|
||
# What is GameLift | ||
|
||
Amazon GameLift enables developers to deploy, operate, and scale dedicated, low-cost servers in the cloud for session-based, multiplayer games. | ||
Built on AWS global computing infrastructure, GameLift helps deliver high-performance, high-reliability, low-cost game servers while dynamically scaling your resource usage to meet worldwide player demand. | ||
|
||
## How to Deploy | ||
|
||
### Prerequisites: | ||
|
||
Ensure that you have installed the following tools in your Mac or Windows Laptop before start working with this module and run Terraform Plan and Apply | ||
|
||
1. [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) | ||
2. [Kubectl](https://Kubernetes.io/docs/tasks/tools/) | ||
3. [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) | ||
|
||
### Deployment Steps | ||
|
||
#### Step 1: Clone the repo using the command below | ||
|
||
```sh | ||
git clone https://github.com/aws-ia/terraform-aws-eks-blueprints.git | ||
``` | ||
|
||
#### Step 2: Run Terraform INIT | ||
|
||
Initialize a working directory with configuration files | ||
|
||
```sh | ||
cd patterns/game-tech/agones-game-controller | ||
terraform init | ||
``` | ||
|
||
#### Step 3: Run Terraform PLAN | ||
|
||
Verify the resources created by this execution | ||
|
||
```sh | ||
export AWS_REGION=<ENTER YOUR REGION> # Select your own region | ||
terraform plan | ||
``` | ||
|
||
#### Step 4: Finally, Terraform APPLY | ||
|
||
**Deploy the pattern** | ||
|
||
```sh | ||
terraform apply | ||
``` | ||
|
||
Enter `yes` to apply. | ||
Built on AWS global computing infrastructure, GameLift helps deliver high-performance, high-reliability, | ||
low-cost game servers while dynamically scaling your resource usage to meet worldwide player demand. See below | ||
for more information on how GameLift FleetIQ can be integrated with Agones deployed on Amazon EKS. | ||
|
||
Amazon GameLift FleetIQ optimizes the use of low-cost Spot Instances for cloud-based game hosting with Amazon EC2. | ||
With GameLift FleetIQ, you can work directly with your hosting resources in Amazon EC2 and Auto Scaling while | ||
taking advantage of GameLift optimizations to deliver inexpensive, resilient game hosting for your players | ||
and makes the use of low-cost Spot Instances viable for game hosting | ||
|
||
#### Configure `kubectl` and test cluster | ||
This [blog](https://aws.amazon.com/blogs/gametech/introducing-the-gamelift-fleetiq-adapter-for-agones/) walks | ||
through the details of deploying EKS Cluster using eksctl and deploy Agones with GameLift FleetIQ. | ||
|
||
EKS Cluster details can be extracted from terraform output or from AWS Console to get the name of cluster. | ||
This following command used to update the `kubeconfig` in your local machine where you run kubectl commands to interact with your EKS Cluster. | ||
## Deploy | ||
|
||
#### Step 5: Run `update-kubeconfig` command | ||
See [here](https://aws-ia.github.io/terraform-aws-eks-blueprints/main/getting-started/#prerequisites) for the prerequisites and steps to deploy this pattern. | ||
|
||
`~/.kube/config` file gets updated with cluster details and certificate from the below command | ||
## Validate | ||
|
||
$ aws eks --region <enter-your-region> update-kubeconfig --name <cluster-name> | ||
|
||
#### Step 6: List all the worker nodes by running the command below | ||
|
||
$ kubectl get nodes | ||
|
||
#### Step 7: List all the pods running in `agones-system` namespace | ||
|
||
$ kubectl get pods -n agones-system | ||
|
||
#### Step 8: Install K9s (OPTIONAL) | ||
|
||
This step is to install K9s client tool to interact with EKS Cluster | ||
|
||
curl -sS https://webinstall.dev/k9s | bash | ||
|
||
Just type k9s after the installation and then you will see the output like this | ||
|
||
k9s | ||
|
||
![Alt Text](https://github.com/aws-ia/terraform-aws-eks-blueprints/blob/9c6f8ea3e710f7b0137be07835653a2bf4f9fdfe/images/k9s-agones-cluster.png "K9s") | ||
|
||
|
||
#### Step 9: Deploying the Sample game server | ||
1. Deploy the sample game server | ||
|
||
```sh | ||
kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.32.0/examples/simple-game-server/gameserver.yaml | ||
|
||
|
||
kubectl get gs | ||
``` | ||
|
||
Output looks like below | ||
|
||
```text | ||
NAME STATE ADDRESS PORT NODE AGE | ||
simple-game-server-7r6jr Ready 34.243.345.22 7902 ip-10-1-23-233.eu-west-1.compute.internal 11h | ||
``` | ||
|
||
#### Step 10: Testing the Sample Game Server | ||
|
||
sudo yum install netcat | ||
|
||
nc -u <ADDRESS> <PORT> | ||
|
||
e.g., nc -u 34.243.345.22 7902 | ||
2. Test the sample game server using [`netcat`](https://netcat.sourceforge.net/) | ||
|
||
Output looks like below | ||
```sh | ||
echo -n "UDP test - Hello EKS Blueprints!" | nc -u 34.243.345.22 7902 | ||
``` | ||
|
||
TeamRole:~/environment/eks-blueprints (main) $ echo -n "UDP test - Hello Workshop" | nc -u 34.243.345.22 7902 | ||
Hello Workshop | ||
ACK: Hello Workshop | ||
```text | ||
Hello EKS Blueprints! | ||
ACK: Hello EKS Blueprints! | ||
EXIT | ||
ACK: EXIT | ||
``` | ||
|
||
# Deploy GameLift FleetIQ | ||
|
||
Amazon GameLift FleetIQ optimizes the use of low-cost Spot Instances for cloud-based game hosting with Amazon EC2. With GameLift FleetIQ, you can work directly with your hosting resources in Amazon EC2 and Auto Scaling while taking advantage of GameLift optimizations to deliver inexpensive, resilient game hosting for your players and makes the use of low-cost Spot Instances viable for game hosting | ||
|
||
This [blog](https://aws.amazon.com/blogs/gametech/introducing-the-gamelift-fleetiq-adapter-for-agones/) will go through the details of deploying EKS Cluster using eksctl and deploy Agones with GameLift FleetIQ | ||
|
||
Download the sh and execute | ||
## Destroy | ||
|
||
curl -O https://raw.githubusercontent.com/awslabs/fleetiq-adapter-for-agones/master/Agones_EKS_FleetIQ_Integration_Package%5BBETA%5D/quick_install/fleet_eks_agones_quickinstall.sh | ||
|
||
## Cleanup | ||
|
||
To clean up your environment, destroy the Terraform modules in reverse order. | ||
|
||
Destroy the Kubernetes Add-ons, EKS cluster with Node groups and VPC | ||
Delete the resources created by the sample game server first: | ||
|
||
```sh | ||
terraform destroy -target="helm_release.agones" -auto-approve | ||
terraform destroy -target="module.eks_blueprints_addons" -auto-approve | ||
terraform destroy -target="module.eks" -auto-approve | ||
terraform destroy -target="module.vpc" -auto-approve | ||
kubectl -n default delete gs --all || true | ||
``` | ||
|
||
Finally, destroy any additional resources that are not in the above modules | ||
|
||
```sh | ||
terraform destroy -auto-approve | ||
``` | ||
{% | ||
include-markdown "../../docs/_partials/destroy.md" | ||
%} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.