mirror of
				https://github.com/yeslayla/nakama-helm-chart.git
				synced 2025-10-31 04:23:04 +01:00 
			
		
		
		
	Update ReadMe.md; Create Network LoadBalancer
This commit is contained in:
		| @ -16,9 +16,8 @@ Parameters, `DatabaseUsername`, `DatabasePassword`, `DatabaseEndpoint`, and `Dat | |||||||
|  |  | ||||||
| ## To Do | ## To Do | ||||||
|  |  | ||||||
| - [ ] Load Balancing | - [x] Load Balancing | ||||||
|     - [x] Portal |     - [ ] [Clustering](https://heroiclabs.com/nakama-enterprise/) | ||||||
|     - [ ] Application |  | ||||||
| - [ ] Auto Scaling | - [ ] Auto Scaling | ||||||
| - [x] Dynamic Port Routing | - [x] Dynamic Port Routing | ||||||
| - [x] HTTPS | - [x] HTTPS | ||||||
| @ -29,3 +28,4 @@ Parameters, `DatabaseUsername`, `DatabasePassword`, `DatabaseEndpoint`, and `Dat | |||||||
| - [ ] Custom security keys | - [ ] Custom security keys | ||||||
| - [ ] Formatted Launch Parameters | - [ ] Formatted Launch Parameters | ||||||
| - [ ] Informative `ReadMe.md` | - [ ] Informative `ReadMe.md` | ||||||
|  | - [ ] Load Server Modules | ||||||
|  | |||||||
| @ -65,6 +65,8 @@ Resources: | |||||||
|         Image: "heroiclabs/nakama:2.7.0" |         Image: "heroiclabs/nakama:2.7.0" | ||||||
|         MemoryReservation: 800 |         MemoryReservation: 800 | ||||||
|         PortMappings: |         PortMappings: | ||||||
|  |         - HostPort: 0 | ||||||
|  |           ContainerPort: 7348 | ||||||
|         - HostPort: 0 |         - HostPort: 0 | ||||||
|           ContainerPort: 7349 |           ContainerPort: 7349 | ||||||
|         - HostPort: 0 |         - HostPort: 0 | ||||||
|  | |||||||
| @ -126,9 +126,103 @@ Resources: | |||||||
|   #----------------- |   #----------------- | ||||||
|   # Load Balancing  |   # Load Balancing  | ||||||
|   #----------------- |   #----------------- | ||||||
|  |  | ||||||
|  |   #-- Network Load Balancer --# | ||||||
|  |   PublicNLB: | ||||||
|  |     Type: AWS::ElasticLoadBalancingV2::LoadBalancer | ||||||
|  |     Properties: | ||||||
|  |       Type: network | ||||||
|  |       LoadBalancerAttributes: | ||||||
|  |         - Key: deletion_protection.enabled | ||||||
|  |           Value: false | ||||||
|  |       Scheme: internet-facing | ||||||
|  |       Subnets: !Split [",", !Ref PublicSubnets] | ||||||
|  |       Tags: | ||||||
|  |         - Key: Name | ||||||
|  |           Value: !Sub "Nakama-${environment}-NLB" | ||||||
|  |         - Key: environment | ||||||
|  |           Value: !Ref environment | ||||||
|  |  | ||||||
|  |   # Target group for HTTP api | ||||||
|  |   HttpApiTargetGroup: | ||||||
|  |     Type: AWS::ElasticLoadBalancingV2::TargetGroup | ||||||
|  |     Properties: | ||||||
|  |       Port: 7350 | ||||||
|  |       Protocol: TCP | ||||||
|  |       TargetGroupAttributes: | ||||||
|  |         - Key: deregistration_delay.timeout_seconds | ||||||
|  |           Value: '20' | ||||||
|  |       VpcId: !Ref 'VpcId' | ||||||
|  |       Tags: | ||||||
|  |         - Key: Name | ||||||
|  |           Value: !Sub 'nakama-http-${release}' | ||||||
|  |  | ||||||
|  |   # Listener for HTTP | ||||||
|  |   HttpApiNlbListener: | ||||||
|  |     Type: AWS::ElasticLoadBalancingV2::Listener | ||||||
|  |     Properties: | ||||||
|  |       DefaultActions: | ||||||
|  |         - Type: forward | ||||||
|  |           TargetGroupArn: !Ref HttpApiTargetGroup | ||||||
|  |       LoadBalancerArn: !Ref PublicNLB | ||||||
|  |       Port: 7350 | ||||||
|  |       Protocol: TCP | ||||||
|  |  | ||||||
|  |   # Target group for gRPC API | ||||||
|  |   GRpcApiTargetGroup: | ||||||
|  |     Type: AWS::ElasticLoadBalancingV2::TargetGroup | ||||||
|  |     Properties: | ||||||
|  |       Port: 7349 | ||||||
|  |       Protocol: TCP_UDP | ||||||
|  |       TargetGroupAttributes: | ||||||
|  |         - Key: deregistration_delay.timeout_seconds | ||||||
|  |           Value: '20' | ||||||
|  |       VpcId: !Ref 'VpcId' | ||||||
|  |       Tags: | ||||||
|  |         - Key: Name | ||||||
|  |           Value: !Sub 'nakama-GRpc-${release}' | ||||||
|  |  | ||||||
|  |   # Listener for gRPC API | ||||||
|  |   GRpcNlbListener: | ||||||
|  |     Type: AWS::ElasticLoadBalancingV2::Listener | ||||||
|  |     Properties: | ||||||
|  |       DefaultActions: | ||||||
|  |         - Type: forward | ||||||
|  |           TargetGroupArn: !Ref GRpcApiTargetGroup | ||||||
|  |       LoadBalancerArn: !Ref PublicNLB | ||||||
|  |       Port: 7349 | ||||||
|  |       Protocol: TCP_UDP | ||||||
|  |  | ||||||
|  |   # Target group for gRPC embeded console | ||||||
|  |   GRpcEApiTargetGroup: | ||||||
|  |     Type: AWS::ElasticLoadBalancingV2::TargetGroup | ||||||
|  |     Properties: | ||||||
|  |       Port: 7348 | ||||||
|  |       Protocol: TCP_UDP | ||||||
|  |       TargetGroupAttributes: | ||||||
|  |         - Key: deregistration_delay.timeout_seconds | ||||||
|  |           Value: '20' | ||||||
|  |       VpcId: !Ref 'VpcId' | ||||||
|  |       Tags: | ||||||
|  |         - Key: Name | ||||||
|  |           Value: !Sub 'nakama-GRpc-${release}' | ||||||
|  |  | ||||||
|  |   # Listener for gRPC embeded console | ||||||
|  |   GRpcENlbListener: | ||||||
|  |     Type: AWS::ElasticLoadBalancingV2::Listener | ||||||
|  |     Properties: | ||||||
|  |       DefaultActions: | ||||||
|  |         - Type: forward | ||||||
|  |           TargetGroupArn: !Ref GRpcEApiTargetGroup | ||||||
|  |       LoadBalancerArn: !Ref PublicNLB | ||||||
|  |       Port: 7348 | ||||||
|  |       Protocol: TCP_UDP | ||||||
|  |  | ||||||
|  |   #-- Application Load Balancer --# | ||||||
|   PublicALB: |   PublicALB: | ||||||
|     Type: AWS::ElasticLoadBalancingV2::LoadBalancer |     Type: AWS::ElasticLoadBalancingV2::LoadBalancer | ||||||
|     Properties: |     Properties: | ||||||
|  |       Type: application | ||||||
|       LoadBalancerAttributes: |       LoadBalancerAttributes: | ||||||
|         - Key: deletion_protection.enabled |         - Key: deletion_protection.enabled | ||||||
|           Value: false |           Value: false | ||||||
| @ -176,33 +270,6 @@ Resources: | |||||||
|           ToPort: "65535" |           ToPort: "65535" | ||||||
|           CidrIp: 0.0.0.0/0 |           CidrIp: 0.0.0.0/0 | ||||||
|  |  | ||||||
|   # Target group for HTTP api |  | ||||||
|   HttpApiTargetGroup: |  | ||||||
|     Type: AWS::ElasticLoadBalancingV2::TargetGroup |  | ||||||
|     Properties: |  | ||||||
|       Port: 7350 |  | ||||||
|       Protocol: HTTP |  | ||||||
|       TargetGroupAttributes: |  | ||||||
|         - Key: deregistration_delay.timeout_seconds |  | ||||||
|           Value: '20' |  | ||||||
|       VpcId: !Ref 'VpcId' |  | ||||||
|       Tags: |  | ||||||
|         - Key: Name |  | ||||||
|           Value: !Sub 'nakama-http-${release}' |  | ||||||
|  |  | ||||||
|   # HTTPS for HTTP Api |  | ||||||
|   HttpApiAlbListener: |  | ||||||
|     Type: AWS::ElasticLoadBalancingV2::Listener |  | ||||||
|     Properties: |  | ||||||
|       Certificates: |  | ||||||
|         - CertificateArn: !Ref PortalCertificate |  | ||||||
|       DefaultActions: |  | ||||||
|         - Type: forward |  | ||||||
|           TargetGroupArn: !Ref HttpApiTargetGroup |  | ||||||
|       LoadBalancerArn: !Ref PublicALB |  | ||||||
|       Port: 7350 |  | ||||||
|       Protocol: HTTPS |  | ||||||
|  |  | ||||||
|   # Target group for admin portal port |   # Target group for admin portal port | ||||||
|   AdminPortalTargetGroup: |   AdminPortalTargetGroup: | ||||||
|     Type: AWS::ElasticLoadBalancingV2::TargetGroup |     Type: AWS::ElasticLoadBalancingV2::TargetGroup | ||||||
| @ -254,6 +321,7 @@ Resources: | |||||||
|       LoadBalancerArn: !Ref PublicALB |       LoadBalancerArn: !Ref PublicALB | ||||||
|       Port: 80 |       Port: 80 | ||||||
|       Protocol: HTTP |       Protocol: HTTP | ||||||
|  |        | ||||||
|  |  | ||||||
|   #------------------- |   #------------------- | ||||||
|   # ECS Task & Service |   # ECS Task & Service | ||||||
| @ -280,4 +348,13 @@ Resources: | |||||||
|       LoadBalancers:   |       LoadBalancers:   | ||||||
|         - ContainerName: "nakama" |         - ContainerName: "nakama" | ||||||
|           ContainerPort: 7351 |           ContainerPort: 7351 | ||||||
|           TargetGroupArn: !Ref 'AdminPortalTargetGroup' |           TargetGroupArn: !Ref AdminPortalTargetGroup | ||||||
|  |         - ContainerName: "nakama" | ||||||
|  |           ContainerPort: 7350 | ||||||
|  |           TargetGroupArn: !Ref HttpApiTargetGroup | ||||||
|  |         - ContainerName: "nakama" | ||||||
|  |           ContainerPort: 7349 | ||||||
|  |           TargetGroupArn: !Ref GRpcApiTargetGroup | ||||||
|  |         - ContainerName: "nakama" | ||||||
|  |           ContainerPort: 7348 | ||||||
|  |           TargetGroupArn: !Ref GRpcEApiTargetGroup | ||||||
		Reference in New Issue
	
	Block a user