Systemd

It’s recommended to use a process manager like systemd when using Kuma on VMs. 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 = < user to use to run the process >
  7. Environment = KUMA_MODE=standalone
  8. WorkingDirectory = <directory of the Kuma install >
  9. ExecStart = ./bin/kuma-cp run --config-file=./cp-config.yaml
  10. # if you need your Control Plane to be able to handle a non-trivial number of concurrent connections
  11. # (a total of both incoming and outgoing connections), you need to set proper resource limits on
  12. # the `kuma-cp` process, especially maximum number of open files.
  13. #
  14. # it happens that `systemd` units are not affected by the traditional `ulimit` configuration,
  15. # and you must set resource limits as part of `systemd` unit itself.
  16. #
  17. # to check effective resource limits set on a running `kuma-cp` instance, execute
  18. #
  19. # $ cat /proc/$(pgrep kuma-cp)/limits
  20. #
  21. # Limit Soft Limit Hard Limit Units
  22. # ...
  23. # Max open files 1024 4096 files
  24. # ...
  25. #
  26. # for Kuma demo setup, we chose the same limit as `docker` and `containerd` set by default.
  27. # See https://github.com/containerd/containerd/issues/3201
  28. LimitNOFILE = 1048576
  29. Restart = always
  30. RestartSec = 1s
  31. # disable rate limiting on start attempts
  32. StartLimitIntervalSec = 0
  33. StartLimitBurst = 0
  34. [Install]
  35. 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 = < user to use to run the process >
  7. WorkingDirectory = <directory of the Kuma install >
  8. ExecStart = ./bin/kuma-dp run \
  9. --cp-address=https://<kuma-cp-address>:5678 \
  10. --dataplane-token-file=./echo-service-universal.token \
  11. --dataplane-file=./dataplane-notransparent.yaml \
  12. --ca-cert-file=./ca.pem
  13. Restart = always
  14. RestartSec = 1s
  15. # disable rate limiting on start attempts
  16. StartLimitIntervalSec = 0
  17. StartLimitBurst = 0
  18. [Install]
  19. WantedBy = multi-user.target