Systemd

When using Kuma on VMs it is recommended to use a process manager like systemd. Here are examples of systemd configurations

kuma-cp

  1. [Unit]
  2. Description = Kuma Control Plane
  3. After = network.target
  4. Documentation=https://kuma.io
  5. [Service]
  6. User=kuma
  7. Environment=KUMA_MODE=standalone
  8. ExecStart = /path/to/kuma/bin/kuma-cp run --config-file=/home/kuma/cp-config.yaml
  9. # if you need your Control Plane to be able to handle a non-trivial number of concurrent connections
  10. # (a total of both incoming and outgoing connections), you need to set proper resource limits on
  11. # the `kuma-cp` process, especially maximum number of open files.
  12. #
  13. # it happens that `systemd` units are not affected by the traditional `ulimit` configuration,
  14. # and you must set resource limits as part of `systemd` unit itself.
  15. #
  16. # to check effective resource limits set on a running `kuma-cp` instance, execute
  17. #
  18. # $ cat /proc/`pgrep kuma-cp`/limits
  19. #
  20. # Limit Soft Limit Hard Limit Units
  21. # ...
  22. # Max open files 1024 4096 files
  23. # ...
  24. #
  25. # for Kuma demo setup, we chose the same limit as `docker` and `containerd` set by default.
  26. # See https://github.com/containerd/containerd/issues/3201
  27. LimitNOFILE=1048576
  28. Restart=always
  29. RestartSec=1s
  30. # disable rate limiting on start attempts
  31. StartLimitIntervalSec=0
  32. StartLimitBurst=0
  33. [Install]
  34. WantedBy = multi-user.target

kuma-dp

  1. [Unit]
  2. Description=Kuma data plane proxy
  3. After=network.target
  4. Documentation=https://kuma.io
  5. [Service]
  6. User=kuma
  7. ExecStart=/home/kuma/kong-mesh-1.9.1/bin/kuma-dp run \
  8. --cp-address=https://<kuma-cp-address>:5678 \
  9. --dataplane-token-file=/home/kuma/echo-service-universal.token \
  10. --dataplane-file=/home/kuma/dataplane-notransparent.yaml \
  11. --ca-cert-file=/home/kuma/ca.pem
  12. Restart=always
  13. RestartSec=1s
  14. # disable rate limiting on start attempts
  15. StartLimitIntervalSec=0
  16. StartLimitBurst=0
  17. [Install]
  18. WantedBy=multi-user.target