Advertisement
drpanwe

/etc/systemd/system/kubic-init.service

Jan 22nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. [Unit]
  2. Description=Kubic Initialization Container
  3. After=crio.service docker.service
  4.  
  5. # Check if the kubic-init.yaml configuration file exists
  6. # if it doesn't, just skip this service...
  7. ConditionPathExists=/etc/kubic/kubic-init.yaml
  8.  
  9. [Service]
  10. TimeoutStartSec=0
  11. RestartSec=30
  12.  
  13. Restart=always
  14. SyslogIdentifier=kubic-init
  15.  
  16. # TODO: see https://www.freedesktop.org/software/systemd/man/systemd.unit.html#OnFailure=
  17. # OnFailure=kubic-init-reset.service
  18.  
  19. # Define configuration files and don't start if they don't exist
  20. Environment="KUBECONFIG=/etc/kubernetes/admin.conf"
  21. Environment="KUBIC_INIT_CFG=/etc/kubic/kubic-init.yaml"
  22.  
  23. EnvironmentFile=-/etc/sysconfig/kubic-init
  24.  
  25. ExecStartPre=-/bin/sh -c '/usr/bin/podman stop kubic-init >/dev/null 2>&1'
  26. ExecStartPre=-/bin/sh -c '/usr/bin/podman rm kubic-init >/dev/null 2>&1'
  27.  
  28. ExecStart=/bin/sh -c '${KUBIC_INIT_RUNNER} run --rm --privileged=true --net=host --security-opt seccomp:unconfined --cap-add=SYS_ADMIN --name=kubic-init -v /etc/kubic:/etc/kubic -v /etc/kubernetes:/etc/kubernetes -v /usr/bin/kubelet:/usr/bin/kubelet:ro -v /var/lib/kubelet:/var/lib/kubelet -v /etc/cni/net.d:/etc/cni/net.d -v /var/lib/etcd:/var/lib/etcd -v /var/run/dbus:/var/run/dbus -v /usr/lib/systemd:/usr/lib/systemd:ro -v /run/systemd:/run/systemd:ro -v /var/run/crio:/var/run/crio -v /sys/fs/cgroup:/sys/fs/cgroup -v /lib/modules:/lib/modules:ro localhost/kubic-project/kubic-init:latest kubic-init bootstrap --v 3 --config=/etc/kubic/kubic-init.yaml'
  29.  
  30. [Install]
  31. WantedBy=multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement