Skip to content

Commit

Permalink
Update Node TTL to v0.0.6 and enable monitoring (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
phillebaba authored Feb 14, 2023
1 parent cab1a42 commit 770d2c1
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed

- [#928](https://github.com/XenitAB/terraform-modules/pull/928) Enable Node TTL by default.
- [#935](https://github.com/XenitAB/terraform-modules/pull/935) Update Node TTL to v0.0.6 and enable monitoring.
- [#933](https://github.com/XenitAB/terraform-modules/pull/933) Change from starboard to trivy-operator.

## 2023.02.1
Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes/aks-core/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ module "prometheus" {
node_local_dns_enabled = var.node_local_dns_enabled
grafana_agent_enabled = var.grafana_agent_enabled
promtail_enabled = var.promtail_enabled
node_ttl_enabled = var.node_ttl_enabled
}

module "control_plane_logs" {
Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes/eks-core/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ module "prometheus" {
vpa_enabled = var.vpa_enabled
node_local_dns_enabled = var.node_local_dns_enabled
promtail_enabled = var.promtail_enabled
node_ttl_enabled = var.node_ttl_enabled
}

# trivy
Expand Down
2 changes: 1 addition & 1 deletion modules/kubernetes/node-ttl/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "helm_release" "this" {
chart = "oci://ghcr.io/xenitab/helm-charts/node-ttl"
name = "node-ttl"
namespace = kubernetes_namespace.this.metadata[0].name
version = "v0.0.5"
version = "v0.0.6"
max_history = 3
values = [templatefile("${path.module}/templates/values.yaml.tpl", {
status_config_map_namespace = var.status_config_map_namespace
Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ No modules.
| <a name="input_linkerd_enabled"></a> [linkerd\_enabled](#input\_linkerd\_enabled) | Should linkerd be enabled | `bool` | `false` | no |
| <a name="input_namespace_selector"></a> [namespace\_selector](#input\_namespace\_selector) | Kind labels to look for in namespaces | `list(string)` | <pre>[<br> "platform"<br>]</pre> | no |
| <a name="input_node_local_dns_enabled"></a> [node\_local\_dns\_enabled](#input\_node\_local\_dns\_enabled) | Should node local DNS be enabled | `bool` | `false` | no |
| <a name="input_node_ttl_enabled"></a> [node\_ttl\_enabled](#input\_node\_ttl\_enabled) | Should Node TTL be enabled | `bool` | `false` | no |
| <a name="input_opa_gatekeeper_enabled"></a> [opa\_gatekeeper\_enabled](#input\_opa\_gatekeeper\_enabled) | Should OPA Gatekeeper be enabled | `bool` | `false` | no |
| <a name="input_promtail_enabled"></a> [promtail\_enabled](#input\_promtail\_enabled) | Should promtail be enabled | `bool` | `false` | no |
| <a name="input_region"></a> [region](#input\_region) | The region in which the prometheus instance is deployed | `string` | n/a | yes |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,23 @@ spec:
app.kubernetes.io/instance: promtail
app.kubernetes.io/name: promtail
{{- end }}
{{- if .Values.enabledMonitors.nodeTtl }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
xkf.xenit.io/monitoring: platform
name: node-ttl
namespace: node-ttl
spec:
selector:
matchLabels:
app.kubernetes.io/name: node-ttl
app.kubernetes.io/instance: node-ttl
endpoints:
- port: metrics
{{- end }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes/prometheus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ resource "helm_release" "prometheus_extras" {
grafana_agent_enabled = var.grafana_agent_enabled
node_local_dns_enabled = var.node_local_dns_enabled
promtail_enabled = var.promtail_enabled
node_ttl_enabled = var.node_ttl_enabled
})]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ enabledMonitors:
grafanaAgent: ${grafana_agent_enabled}
nodeLocalDNS: ${node_local_dns_enabled}
promtail: ${promtail_enabled}
nodeTtl: ${node_ttl_enabled}
6 changes: 6 additions & 0 deletions modules/kubernetes/prometheus/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,9 @@ variable "promtail_enabled" {
type = bool
default = false
}

variable "node_ttl_enabled" {
description = "Should Node TTL be enabled"
type = bool
default = false
}

0 comments on commit 770d2c1

Please sign in to comment.