Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Flag option to enable OMS agent for AKS container monitoring (fixes #9)…
Browse files Browse the repository at this point in the history
… (#10)
  • Loading branch information
s1mark authored Mar 2, 2020
1 parent 2dee4c3 commit d196ee4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion azurerm_kubernetes_cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ variable "agent_disk_size" {
variable "log_analytics_workspace_sku" {
type = string
description = "The pricing level of the Log Analytics workspace (https://azure.microsoft.com/pricing/details/monitor)"
default = "PerGB2018"
}
variable "aks_oms_agent" {
type = bool
description = "Enable Log Analytics agent to monitor containers"
default = false
}
```
## Testing
The `./test/fixtures/tf_module` contains an example on how to invoke the module. This is also wrapped around with `kitchen` which has the following configuration defined in `.kitchen.yaml`
Expand Down
2 changes: 1 addition & 1 deletion azurerm_kubernetes_cluster/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "azurerm_kubernetes_cluster" "k8s" {
}
addon_profile {
oms_agent {
enabled = true
enabled = var.aks_oms_agent
log_analytics_workspace_id = azurerm_log_analytics_workspace.log-workspace.id
}
}
Expand Down
5 changes: 5 additions & 0 deletions azurerm_kubernetes_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,8 @@ variable "log_analytics_workspace_sku" {
description = "The pricing level of the Log Analytics workspace (https://azure.microsoft.com/pricing/details/monitor)"
default = "PerGB2018"
}
variable "aks_oms_agent" {
type = bool
description = "Enable Log Analytics agent to monitor containers"
default = false
}

0 comments on commit d196ee4

Please sign in to comment.