From 154e7fef94c1cfb2ef6f0bee940347bab5b43809 Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 31 Mar 2020 02:33:16 +0300 Subject: [PATCH] Added log_level parameter to Terraform deployment (#1438) minor fix --- build/includes/terraform.mk | 4 ++++ build/terraform/gke/module.tf | 5 +++++ examples/terraform-submodules/aks/module.tf | 5 +++++ examples/terraform-submodules/eks/module.tf | 5 +++++ examples/terraform-submodules/gke/module.tf | 5 +++++ install/terraform/modules/helm/helm.tf | 5 +++++ install/terraform/modules/helm/variables.tf | 4 ++++ site/content/en/docs/Installation/Terraform/aks.md | 3 +++ site/content/en/docs/Installation/Terraform/eks.md | 1 + site/content/en/docs/Installation/Terraform/gke.md | 1 + 10 files changed, 38 insertions(+) diff --git a/build/includes/terraform.mk b/build/includes/terraform.mk index 517af8ce12..03b3bc8ab1 100644 --- a/build/includes/terraform.mk +++ b/build/includes/terraform.mk @@ -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 @@ -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)" \ -var node_count=$(GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT)' GCP_CLUSTER_NAME=$(GCP_TF_CLUSTER_NAME) $(MAKE) gcloud-auth-cluster @@ -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")) @@ -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 diff --git a/build/terraform/gke/module.tf b/build/terraform/gke/module.tf index d17f2b47f5..59bab6c100 100644 --- a/build/terraform/gke/module.tf +++ b/build/terraform/gke/module.tf @@ -88,6 +88,10 @@ variable "image_pull_secret" { default = "" } +variable "log_level" { + default = "info" +} + module "gke_cluster" { source = "../../../install/terraform/modules/gke" @@ -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" { diff --git a/examples/terraform-submodules/aks/module.tf b/examples/terraform-submodules/aks/module.tf index 9b7ca4b815..ce05dcfc70 100644 --- a/examples/terraform-submodules/aks/module.tf +++ b/examples/terraform-submodules/aks/module.tf @@ -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" @@ -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" { diff --git a/examples/terraform-submodules/eks/module.tf b/examples/terraform-submodules/eks/module.tf index 5b4184cdc3..d7ec17e7bd 100644 --- a/examples/terraform-submodules/eks/module.tf +++ b/examples/terraform-submodules/eks/module.tf @@ -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" @@ -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" { diff --git a/examples/terraform-submodules/gke/module.tf b/examples/terraform-submodules/gke/module.tf index 7d3afdc2fd..f7458992ee 100644 --- a/examples/terraform-submodules/gke/module.tf +++ b/examples/terraform-submodules/gke/module.tf @@ -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 @@ -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" { diff --git a/install/terraform/modules/helm/helm.tf b/install/terraform/modules/helm/helm.tf index ea2e9350b6..f0f825383d 100644 --- a/install/terraform/modules/helm/helm.tf +++ b/install/terraform/modules/helm/helm.tf @@ -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" diff --git a/install/terraform/modules/helm/variables.tf b/install/terraform/modules/helm/variables.tf index e58d4a4256..0292eef189 100644 --- a/install/terraform/modules/helm/variables.tf +++ b/install/terraform/modules/helm/variables.tf @@ -26,6 +26,10 @@ variable "udp_expose" { default = "true" } +variable "log_level" { + default = "info" +} + variable "host" {} variable "token" {} diff --git a/site/content/en/docs/Installation/Terraform/aks.md b/site/content/en/docs/Installation/Terraform/aks.md index d84bbdffa2..ded6e5ba66 100644 --- a/site/content/en/docs/Installation/Terraform/aks.md +++ b/site/content/en/docs/Installation/Terraform/aks.md @@ -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: diff --git a/site/content/en/docs/Installation/Terraform/eks.md b/site/content/en/docs/Installation/Terraform/eks.md index ed18394f8e..b5aaf6be43 100644 --- a/site/content/en/docs/Installation/Terraform/eks.md +++ b/site/content/en/docs/Installation/Terraform/eks.md @@ -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: ``` diff --git a/site/content/en/docs/Installation/Terraform/gke.md b/site/content/en/docs/Installation/Terraform/gke.md index 05900687f7..9f1d87e0ba 100644 --- a/site/content/en/docs/Installation/Terraform/gke.md +++ b/site/content/en/docs/Installation/Terraform/gke.md @@ -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"`