-
Notifications
You must be signed in to change notification settings - Fork 22
/
etcd3_attach_dep_service.go
36 lines (33 loc) · 1.06 KB
/
etcd3_attach_dep_service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package template
const Etcd3AttachDepService = `
[Unit]
Description=Attach etcd dependencies
Requires=network.target
After=network.target
Before=k8s-kubelet.service
[Service]
# image is from https://github.com/giantswarm/aws-attach-etcd-dep
Environment="IMAGE={{ .RegistryDomain }}/giantswarm/aws-attach-etcd-dep:0.4.0"
Environment="NAME=%p.service"
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "docker run --rm -i \
-v /dev:/dev \
-v /etc/systemd/network:/etc/systemd/network \
--privileged \
--name ${NAME} \
${IMAGE} \
--eni-device-index=1 \
--eni-tag-key=Name \
--eni-tag-value={{ .MasterENIName }} \
--volume-device-name=/dev/xvdh \
--volume-device-filesystem-type=ext4 \
--volume-device-label=etcd \
--volume-tag-key=Name \
--volume-tag-value={{ .MasterEtcdVolumeName }}"
# use 'networkctl reload' instead of restarting systemd-networkd to avoid bug in systemd
# https://github.com/systemd/systemd/issues/18108
ExecStartPost=/usr/bin/networkctl reload
[Install]
WantedBy=multi-user.target
`