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. WorkingDirectory = <directory of the Kuma install >
  8. ExecStart = ./bin/kuma-cp run --config-file=./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 = < 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