Skip to content

Instantly share code, notes, and snippets.

@bcwaldon
Created February 18, 2015 20:39
Show Gist options
  • Save bcwaldon/96ef3a9bc93c7b9247e0 to your computer and use it in GitHub Desktop.
Save bcwaldon/96ef3a9bc93c7b9247e0 to your computer and use it in GitHub Desktop.
kubernetes cloud-config
#cloud-config
coreos:
etcd:
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
fleet:
public-ip: $private_ipv4
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: wait-for-etcd.service
command: start
content: |
[Service]
ExecStart=/usr/bin/bash -c "until curl http://127.0.0.1:4001/v2/machines; do sleep 1; done"
RemainAfterExit=true
Type=oneshot
- name: flanneld.service
command: start
drop-ins:
- name: 30-wait-for-etcd.conf
content: |
[Unit]
Requires=wait-for-etcd.service
After=wait-for-etcd.service
- name: 30-set-network-config.conf
content: |
[Service]
ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.0.0.0/16"}'
- name: flannel-docker-opts.path
command: start
content: |
[Path]
PathExists=/run/flannel_docker_opts.env
Unit=kubernetes-kubelet.service
- name: kubernetes-download@.service
content: |
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.10.1/bin/linux/amd64/%i && chmod +x /opt/bin/%i"
- name: kubernetes-download@kubectl.service
command: start
- name: kubernetes-api.service
command: start
content: |
[Unit]
Requires=kubernetes-download@kube-apiserver.service
After=kubernetes-download@kube-apiserver.service
[Service]
Restart=always
RestartSec=10
ExecStart=/opt/bin/kube-apiserver \
--logtostderr=true \
--etcd_servers=http://127.0.0.1:4001 \
--address=127.0.0.1 \
--port=8080 \
--portal_net=10.1.0.0/16
- name: kubernetes-proxy.service
command: start
content: |
[Unit]
Requires=kubernetes-download@kube-proxy.service
After=kubernetes-download@kube-proxy.service
[Service]
ExecStart=/opt/bin/kube-proxy \
--logtostderr=true \
--etcd_servers=http://127.0.0.1:4001 \
--master=http://127.0.0.1:8080
Restart=always
RestartSec=10
- name: kubernetes-kubelet.service
content: |
[Unit]
Requires=kubernetes-download@kubelet.service
After=kubernetes-download@kubelet.service
Wants=kubernetes-kubelet-register.service
Before=kubernetes-kubelet-register.service
[Service]
Restart=always
RestartSec=10
ExecStart=/opt/bin/kubelet \
--logtostderr=true \
--etcd_servers=http://127.0.0.1:4001 \
--address=0.0.0.0 \
--port=10250 \
--hostname_override=$private_ipv4
- name: kubernetes-kubelet-register.service
content: |
[Service]
Type=oneshot
ExecStart=/usr/bin/curl http://127.0.0.1:8080/api/v1beta1/minions -H 'Content-Type: application/json' -d '{"apiVersion":"v1beta1","kind":"Minion","id":"$public_ipv4","hostIP":"$public_ipv4"}'
- name: kubernetes-fleet.service
command: start
content: |
[Service]
Type=oneshot
ExecStart=/usr/bin/fleetctl start /tmp/kubernetes-scheduler.service
ExecStart=/usr/bin/fleetctl start /tmp/kubernetes-controller-manager.service
write_files:
- path: /tmp/kubernetes-scheduler.service
content: |
[Unit]
Requires=kubernetes-download@kube-scheduler.service
After=kubernetes-download@kube-scheduler.service
[Service]
ExecStart=/opt/bin/kube-scheduler \
--logtostderr=true \
--master=127.0.0.1:8080
- path: /tmp/kubernetes-controller-manager.service
content: |
[Unit]
Requires=kubernetes-download@kube-controller-manager.service
After=kubernetes-download@kube-controller-manager.service
[Service]
ExecStart=/opt/bin/kube-controller-manager \
--logtostderr=true \
--master=127.0.0.1:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment