Skip to content

Instantly share code, notes, and snippets.

@brianm
Last active September 27, 2017 23:36
Show Gist options
  • Save brianm/b560188bdb8adb58796a2aa3322d2394 to your computer and use it in GitHub Desktop.
Save brianm/b560188bdb8adb58796a2aa3322d2394 to your computer and use it in GitHub Desktop.
[Unit]
Description=standalone kubelet
After=docker.service
Requires=docker.service
[Service]
User=root
ExecStartPre=-/bin/docker kill kubby
ExecStartPre=-/bin/docker rm kubby
ExecStartPre=-/bin/docker create \
--net=host \
--pid=host \
--privileged \
--name kubby \
-v /dev:/dev \
-v /sys:/sys:ro \
-v /var/run:/var/run:rw \
-v /var/lib/docker/:/var/lib/docker:rw \
-v /var/lib/kubelet/:/var/lib/kubelet:shared \
-v /var/log:/var/log:shared \
-v /etc/kubernetes:/etc/kubernetes:ro \
gcr.io/google_containers/hyperkube-amd64:v1.7.6 \
/kubelet --pod-manifest-path=/etc/kubernetes/manifests \
--sync-frequency 30s \
--minimum-image-ttl-duration 300s \
--file-check-frequency 30s \
--allow-privileged
ExecStart=/bin/docker start -a kubby
ExecStop=/usr/bin/docker stop -t 10 kubby
[Install]
WantedBy=multi-user.target
@brianm
Copy link
Author

brianm commented Sep 27, 2017

^^ quick hack, only tested on Centos7.

I don't love the --net=host and hostNetwork=true approach as it makes running more than one pod pretty dodgy. That said, quick hack and running standalone kubelet is pretty special case :-)

nota bene: need hostNetwork=true in your manifests :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment