mirror of https://github.com/k3s-io/k3s
92 lines
3.3 KiB
YAML
92 lines
3.3 KiB
YAML
#cloud-config
|
|
|
|
coreos:
|
|
fleet:
|
|
etcd-servers: http://<master-private-ip>:4001
|
|
metadata: "role=node"
|
|
flannel:
|
|
interface: eth1
|
|
etcd_endpoints: http://<master-private-ip>:4001
|
|
units:
|
|
- name: etcd.service
|
|
mask: true
|
|
- name: fleet.service
|
|
command: start
|
|
- name: flanneld.service
|
|
command: start
|
|
drop-ins:
|
|
- name: 50-network-config.conf
|
|
content: |
|
|
[Service]
|
|
ExecStartPre=/bin/bash -c "until curl http://<master-private-ip>:4001/v2/machines; do sleep 2; done"
|
|
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
|
|
- name: docker.service
|
|
command: start
|
|
drop-ins:
|
|
- name: 51-docker-mirror.conf
|
|
content: |
|
|
[Unit]
|
|
# making sure that flanneld finished startup, otherwise containers
|
|
# won't land in flannel's network...
|
|
Requires=flanneld.service
|
|
After=flanneld.service
|
|
[Service]
|
|
Environment=DOCKER_OPTS='--registry-mirror=http://<master-private-ip>:5000'
|
|
- name: setup-network-environment.service
|
|
command: start
|
|
content: |
|
|
[Unit]
|
|
Description=Setup Network Environment
|
|
Documentation=https://github.com/kelseyhightower/setup-network-environment
|
|
Requires=network-online.target
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/setup-network-environment
|
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
|
|
ExecStart=/opt/bin/setup-network-environment
|
|
RemainAfterExit=yes
|
|
Type=oneshot
|
|
- name: kube-proxy.service
|
|
command: start
|
|
content: |
|
|
[Unit]
|
|
Description=Kubernetes Proxy
|
|
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
|
Requires=setup-network-environment.service
|
|
After=setup-network-environment.service
|
|
|
|
[Service]
|
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.11.0/bin/linux/amd64/kube-proxy
|
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy
|
|
ExecStart=/opt/bin/kube-proxy \
|
|
--master=<master-private-ip>:8080 \
|
|
--logtostderr=true
|
|
Restart=always
|
|
RestartSec=10
|
|
- name: kube-kubelet.service
|
|
command: start
|
|
content: |
|
|
[Unit]
|
|
Description=Kubernetes Kubelet
|
|
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
|
Requires=setup-network-environment.service
|
|
After=setup-network-environment.service
|
|
|
|
[Service]
|
|
EnvironmentFile=/etc/network-environment
|
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.11.0/bin/linux/amd64/kubelet
|
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet
|
|
ExecStart=/opt/bin/kubelet \
|
|
--address=0.0.0.0 \
|
|
--port=10250 \
|
|
--hostname_override=$private_ipv4 \
|
|
--api_servers=<master-private-ip>:8080 \
|
|
--logtostderr=true
|
|
Restart=always
|
|
RestartSec=10
|
|
update:
|
|
group: alpha
|
|
reboot-strategy: off
|