Skip to content

Commit 1798f87

Browse files
committed
tweak resource requests/limits for sidecars, vault auto-unseal, and enrollment-operator
they were too low to sucessfully spin up minikube 🙃 also fixes cAdvisor metrics in minikube
1 parent 8d8480b commit 1798f87

4 files changed

Lines changed: 31 additions & 10 deletions

File tree

minikube/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ module "cabotage" {
7474
rustfs_disks_per_replica = 1 # FS mode — no erasure coding
7575
loki_standalone = true # single all-in-one process
7676
mimir_standalone = true
77+
# Minikube's kubelet uses a serving cert signed by minikube-cabotage-ca,
78+
# which is NOT the same CA as the projected serviceaccount/ca.crt
79+
# (minikubeCA). Production EKS uses cluster-CA-signed kubelet certs so
80+
# verification works there.
81+
alloy_cadvisor_insecure_skip_verify = true
7782
consul_replicas = 1
7883
consul_storage_size = "1Gi"
7984
vault_replicas = 1

modules/cabotage/manifests/enrollment-operator/03-deployment.yml.tftpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ spec:
4141
volumeMounts:
4242
- name: vault-token
4343
mountPath: /var/run/secrets/vault
44+
startupProbe:
45+
exec:
46+
command:
47+
- sh
48+
- -c
49+
- test -f /var/run/secrets/vault/vault-token && test -f /var/run/secrets/vault/consul-token
50+
periodSeconds: 1
51+
failureThreshold: 30
4452
containers:
4553
- name: enrollment-operator
4654
image: cabotage/enrollment-operator:4.4.4

modules/cabotage/monitoring.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ resource "kubectl_manifest" "alloy_clusterrolebinding" {
3131
}
3232

3333
resource "kubectl_manifest" "alloy_configmap" {
34-
yaml_body = file("${path.module}/manifests/resident-monitoring/alloy/02-configmap.yml")
34+
yaml_body = templatefile("${path.module}/manifests/resident-monitoring/alloy/02-configmap.yml.tftpl", {
35+
cadvisor_insecure_skip_verify = var.alloy_cadvisor_insecure_skip_verify
36+
})
3537

3638
depends_on = [kubernetes_namespace_v1.cabotage]
3739
}

modules/cabotage/variables.tf

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ variable "cabotage_sidecar_resources" {
165165
memory = "16Mi"
166166
}
167167
limits = {
168-
cpu = "10m"
168+
cpu = "25m"
169169
memory = "16Mi"
170170
}
171171
}
@@ -261,7 +261,7 @@ variable "cabotage_app_worker_beat_resources" {
261261
memory = "256Mi"
262262
}
263263
limits = {
264-
cpu = "25m"
264+
cpu = "100m"
265265
memory = "256Mi"
266266
}
267267
}
@@ -452,8 +452,8 @@ variable "vault_consul_agent_resources" {
452452
memory = "48Mi"
453453
}
454454
limits = {
455-
cpu = "25m"
456-
memory = "48Mi"
455+
cpu = "50m"
456+
memory = "96Mi"
457457
}
458458
}
459459
}
@@ -476,7 +476,7 @@ variable "cert_watcher_resources" {
476476
memory = "8Mi"
477477
}
478478
limits = {
479-
cpu = "5m"
479+
cpu = "25m"
480480
memory = "8Mi"
481481
}
482482
}
@@ -500,7 +500,7 @@ variable "vault_auto_unseal_resources" {
500500
memory = "32Mi"
501501
}
502502
limits = {
503-
cpu = "10m"
503+
cpu = "50m"
504504
memory = "32Mi"
505505
}
506506
}
@@ -524,8 +524,8 @@ variable "vault_resources" {
524524
memory = "128Mi"
525525
}
526526
limits = {
527-
cpu = "50m"
528-
memory = "128Mi"
527+
cpu = "100m"
528+
memory = "256Mi"
529529
}
530530
}
531531
}
@@ -796,7 +796,7 @@ variable "enrollment_operator_resources" {
796796
memory = "128Mi"
797797
}
798798
limits = {
799-
cpu = "25m"
799+
cpu = "100m"
800800
memory = "128Mi"
801801
}
802802
}
@@ -832,6 +832,12 @@ variable "s3_storage" {
832832

833833
# --- Resident Monitoring ---
834834

835+
variable "alloy_cadvisor_insecure_skip_verify" {
836+
description = "Skip TLS verification when scraping cadvisor from the kubelet. Required for minikube where the kubelet serving cert is signed by a CA not present in the projected service account bundle. Should remain false in production where the kubelet uses cluster-CA-signed certs."
837+
type = bool
838+
default = false
839+
}
840+
835841
variable "alloy_resources" {
836842
description = "CPU/memory requests and limits for the Alloy DaemonSet"
837843
type = object({

0 commit comments

Comments
 (0)