Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added log_level parameter to Terraform deployment #1438

Merged
merged 1 commit into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build/includes/terraform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT ?= 4
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_MACHINETYPE ?= n1-standard-4
gcloud-terraform-cluster: AGONES_VERSION ?= ''
gcloud-terraform-cluster: GCP_TF_CLUSTER_NAME ?= agones-tf-cluster
gcloud-terraform-cluster: LOG_LEVEL ?= debug
gcloud-terraform-cluster: $(ensure-build-image)
gcloud-terraform-cluster:
ifndef GCP_PROJECT
Expand All @@ -41,6 +42,7 @@ endif
-var name=$(GCP_TF_CLUSTER_NAME) -var machine_type="$(GCP_CLUSTER_NODEPOOL_MACHINETYPE)" \
-var values_file="" \
-var zone="$(GCP_CLUSTER_ZONE)" -var project="$(GCP_PROJECT)" \
-var log_level="$(LOG_LEVEL)" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

-var node_count=$(GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT)'
GCP_CLUSTER_NAME=$(GCP_TF_CLUSTER_NAME) $(MAKE) gcloud-auth-cluster

Expand All @@ -54,6 +56,7 @@ gcloud-terraform-install: IMAGE_PULL_POLICY := "Always"
gcloud-terraform-install: PING_SERVICE_TYPE := "LoadBalancer"
gcloud-terraform-install: CRD_CLEANUP := true
gcloud-terraform-install: GCP_TF_CLUSTER_NAME ?= agones-tf-cluster
gcloud-terraform-install: LOG_LEVEL ?= debug
gcloud-terraform-install:
ifndef GCP_PROJECT
$(eval GCP_PROJECT=$(shell sh -c "gcloud config get-value project 2> /dev/null"))
Expand All @@ -68,6 +71,7 @@ endif
-var chart="../../../install/helm/agones/" \
-var name=$(GCP_TF_CLUSTER_NAME) -var machine_type="$(GCP_CLUSTER_NODEPOOL_MACHINETYPE)" \
-var zone=$(GCP_CLUSTER_ZONE) -var project=$(GCP_PROJECT) \
-var log_level=$(LOG_LEVEL) \
-var node_count=$(GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT)'
GCP_CLUSTER_NAME=$(GCP_TF_CLUSTER_NAME) $(MAKE) gcloud-auth-cluster

Expand Down
5 changes: 5 additions & 0 deletions build/terraform/gke/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ variable "image_pull_secret" {
default = ""
}

variable "log_level" {
default = "info"
}


module "gke_cluster" {
source = "../../../install/terraform/modules/gke"
Expand Down Expand Up @@ -115,6 +119,7 @@ module "helm_agones" {
image_pull_secret = var.image_pull_secret
crd_cleanup = var.crd_cleanup
ping_service_type = var.ping_service_type
log_level = var.log_level
}

output "host" {
Expand Down
5 changes: 5 additions & 0 deletions examples/terraform-submodules/aks/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ variable "client_secret" {

variable "machine_type" { default = "Standard_D2_v2" }

variable "log_level" {
default = "info"
}

module "aks_cluster" {
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/aks/?ref=master"

Expand All @@ -63,6 +67,7 @@ module "helm_agones" {
host = module.aks_cluster.host
token = module.aks_cluster.token
cluster_ca_certificate = module.aks_cluster.cluster_ca_certificate
log_level = var.log_level
}

output "host" {
Expand Down
5 changes: 5 additions & 0 deletions examples/terraform-submodules/eks/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ provider "aws" {

variable "machine_type" { default = "t2.large" }

variable "log_level" {
default = "info"
}

module "eks_cluster" {
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/eks/?ref=master"

Expand All @@ -65,6 +69,7 @@ module "helm_agones" {
host = module.eks_cluster.host
token = data.aws_eks_cluster_auth.example.token
cluster_ca_certificate = module.eks_cluster.cluster_ca_certificate
log_level = var.log_level
}

output "host" {
Expand Down
5 changes: 5 additions & 0 deletions examples/terraform-submodules/gke/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ variable "network" {
description = "The name of the VPC network to attach the cluster and firewall rule to"
}

variable "log_level" {
default = "info"
}

module "gke_cluster" {
// ***************************************************************************************************
// Update ?ref= to the agones release you are installing. For example, ?ref=release-1.3.0 corresponds
Expand Down Expand Up @@ -87,6 +91,7 @@ module "helm_agones" {
host = module.gke_cluster.host
token = module.gke_cluster.token
cluster_ca_certificate = module.gke_cluster.cluster_ca_certificate
log_level = var.log_level
}

output "host" {
Expand Down
5 changes: 5 additions & 0 deletions install/terraform/modules/helm/helm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ resource "helm_release" "agones" {
value = var.ping_service_type
}

set {
name = "agones.controller.logLevel"
value = var.log_level
}

version = var.agones_version
namespace = "agones-system"

Expand Down
4 changes: 4 additions & 0 deletions install/terraform/modules/helm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ variable "udp_expose" {
default = "true"
}

variable "log_level" {
default = "info"
}

variable "host" {}

variable "token" {}
Expand Down
3 changes: 3 additions & 0 deletions site/content/en/docs/Installation/Terraform/aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Check that you have access to the Kubernetes cluster:
kubectl get nodes
```

Configurable parameters:
- log_level - possible values: Fatal, Error, Warn, Info, Debug (default is "info")

## Uninstall the Agones and delete AKS cluster

Run next command to delete all Terraform provisioned resources:
Expand Down
1 change: 1 addition & 0 deletions site/content/en/docs/Installation/Terraform/eks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Configurable parameters:
- agones_version - the version of agones to install (default is the latest version from the [Helm repository](https://agones.dev/chart/stable))
- machine_type - EC2 instance type for hosting game servers (default is "t2.large")
- node_count - count of game server nodes for the default node pool (default is "4")
- log_level - possible values: Fatal, Error, Warn, Info, Debug (default is "info")

Now you can create an EKS cluster and deploy Agones on EKS:
```
Expand Down
1 change: 1 addition & 0 deletions site/content/en/docs/Installation/Terraform/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Configurable parameters:
- zone - the name of the [zone](https://cloud.google.com/compute/docs/regions-zones) you want your cluster to be
created in. (default is "us-west1-c")
- network - the name of the VPC network you want your cluster and firewall rules be connected to (default is "default")
- log_level - possible values: Fatal, Error, Warn, Info, Debug (default is "info")

{{% alert title="Warning" color="warning"%}}
On the lines that read `source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/gke/?ref=master"`
Expand Down