max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]; for more information

2025. 3. 1. 19:13k8s/EFK

원인: node의 max_map_count 용량이 작아서 발생한 문제

조치

방법1: node에 직접 설정

# 임시
sudo sysctl -w vm.max_map_count=262144

# 영구
echo "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

방법2: daemonset 추가

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: sysctl-settings
  namespace: kube-system
spec:
  selector:
    matchLabels:
      name: sysctl-settings
  template:
    metadata:
      labels:
        name: sysctl-settings
    spec:
      hostPID: true
      containers:
      - name: sysctl
        image: busybox
        securityContext:
          privileged: true
        command: ["sh", "-c", "sysctl -w vm.max_map_count=262144"]

방법2: initContaienrs 이용

      initContainers:
      - name: set-sysctl
        image: busybox
        securityContext:
          privileged: true
        command: ["sh", "-c", "sysctl -w vm.max_map_count=262144"]

확인

sysctl vm.max_map_count