Skip to content

Commit 3f6ef4e

Browse files
committed
Tried another stting
1 parent 79f0856 commit 3f6ef4e

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

docs/memgraph-troubleshooting.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,27 @@ python examples/10-azure-memgraph-test.py
8787

8888
### VM Max Map Count Error
8989

90-
If you see an error like "Max virtual memory areas vm.max_map_count 65530 is too low", this is fixed in the latest deployment configuration with an init container.
90+
If you see an error like "Max virtual memory areas vm.max_map_count 65530 is too low" or a `SysctlForbidden` error message with "forbidden sysctl: vm.max_map_count", this can be fixed in two ways:
91+
92+
1. **AKS Cluster Level Fix (Preferred)**:
93+
The AKS cluster should be configured with proper sysctl permissions in its Terraform configuration:
94+
```tf
95+
default_node_pool {
96+
# Other settings...
97+
linux_os_config {
98+
sysctl_config {
99+
vm_max_map_count = 262144
100+
}
101+
}
102+
}
103+
```
104+
105+
2. **Pod Level Fix**:
106+
The Memgraph pod configuration includes both:
107+
- securityContext with sysctls to request the setting
108+
- An init container that attempts to set the value if privileged mode is allowed
109+
110+
If you're still seeing this issue, check that your AKS cluster's security policies allow sysctls.
91111

92112
### Authentication Errors
93113

infra/azure/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ resource "azurerm_kubernetes_cluster" "this" {
5252
name = "default"
5353
node_count = 1
5454
vm_size = var.node_vm_size
55+
56+
# Enable allowed sysctls specifically for Memgraph
57+
linux_os_config {
58+
sysctl_config {
59+
vm_max_map_count = 262144
60+
}
61+
}
5562
}
5663

5764
identity { type = "SystemAssigned" }

infra/k8s/memgraph.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ spec:
3636
# ── pod security context for mounted volumes ─────
3737
securityContext:
3838
fsGroup: 1000 # proper perms for mounted volumes
39+
sysctls:
40+
- name: vm.max_map_count
41+
value: "262144"
3942

4043
# schedule on B2ms nodes if available
4144
affinity:
@@ -48,7 +51,16 @@ spec:
4851

4952
tolerations:
5053
- { key: "node.kubernetes.io/memory-pressure", operator: "Exists", effect: "NoSchedule" }
51-
54+
55+
# init container to set vm.max_map_count if needed and permitted
56+
initContainers:
57+
- name: increase-vm-max-map-count
58+
image: busybox
59+
imagePullPolicy: IfNotPresent
60+
command: ["sysctl", "-w", "vm.max_map_count=262144"]
61+
securityContext:
62+
privileged: true
63+
5264
containers:
5365
- name: memgraph
5466
image: memgraph/memgraph-mage:latest

0 commit comments

Comments
 (0)