Skip to content

Instantly share code, notes, and snippets.

@robertstarmer
Last active April 22, 2016 04:11
Show Gist options
  • Save robertstarmer/a30a09e9b6f395bfdf7bcca87f91b432 to your computer and use it in GitHub Desktop.
Save robertstarmer/a30a09e9b6f395bfdf7bcca87f91b432 to your computer and use it in GitHub Desktop.
CoreOS Cloud Config with Network
#cloud-config
# rawl link to coreos-install.sh http://bit.ly/RmKdL8
# raw link in cloud-config.yml example http://bit.ly/1XLOd4I
# include one or more SSH public keys
ssh_authorized_keys:
- ssh-rsa "AAAAB3NzaC1yc2EAAAADAQABAAABAQC0uZ1Im5/QX2vS3rCajZeOcVV3wVvEuL5Kq6uWNpKCp1g+Ql2BurjOC23p2ROkk111w0nMuPAVY4FMueLkjeu83VAlDqYEjV7u1YAmPnVepHAKd2qnRquVKvw0APLUf0YzgdpX2vgosRHB1CxaSjibzLj0PtjWTWAo99DSoS0KHX9w8d3Ta8M/pj+bWVzvKPW5uYjnGiVKj549MMU1HLuvZU7kEIL3jUdAvqVcvaFkA7hJfsOlj7UaNzsvo9eXMryxbcrKBpNhSBu9DzVD2o5gz8h8KOotqgt/49lf3pl3a2dYQY7nz848G2V6zI+ENSwlgLeZcicCw80OEHc1shqr cil"
users:
- name: "core"
passwd: "$1$dJRHuopb$7rRN3NPymHF3sMS5NHcjW."
ssh_authorized_keys:
- ssh-rsa "AAAAB3NzaC1yc2EAAAADAQABAAABAQC0uZ1Im5/QX2vS3rCajZeOcVV3wVvEuL5Kq6uWNpKCp1g+Ql2BurjOC23p2ROkk111w0nMuPAVY4FMueLkjeu83VAlDqYEjV7u1YAmPnVepHAKd2qnRquVKvw0APLUf0YzgdpX2vgosRHB1CxaSjibzLj0PtjWTWAo99DSoS0KHX9w8d3Ta8M/pj+bWVzvKPW5uYjnGiVKj549MMU1HLuvZU7kEIL3jUdAvqVcvaFkA7hJfsOlj7UaNzsvo9eXMryxbcrKBpNhSBu9DzVD2o5gz8h8KOotqgt/49lf3pl3a2dYQY7nz848G2V6zI+ENSwlgLeZcicCw80OEHc1shqr cil"
groups:
- "sudo"
- "docker"
coreos:
etcd2:
# generate a new token for each unique cluster from https://discovery.etcd.io/new?size=3
# specify the initial size of your cluster with ?size=X
discovery: https://discovery.etcd.io/83f5ef6052898360601d25425422ffa0
advertise-client-urls: http://192.133.145.22:2379,http://192.133.145.22:4001
initial-advertise-peer-urls: http://192.133.145.22:2380
# listen on both the official ports and the legacy ports
# legacy ports can be omitted if your application doesn't depend on them
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://192.133.145.22:2380
units:
- name: systemd-networkd.service
command: stop
- name: 20-enp11s0.network
runtime: true
content: |
[Match]
Name=enp11s0
[Network]
VLAN=vl710
- name: 10-vl710.network
runtime: true
content: |
[Match]
Name=vl710
[Network]
DNS=8.8.8.8
Address=192.133.156.8/26
Gateway=192.133.156.1
- name: 05-vl710.netdev
runtime: true
content: |
[NetDev]
Name=vl710
Kind=vlan
[VLAN]
Id=710
# - name: down-interfaces.service
# command: start
# content: |
# [Service]
# Type=oneshot
# ExecStart=/usr/bin/ip link set enp11s0 down
# ExecStart=/usr/bin/ip addr flush dev enp11s0
- name: systemd-networkd.service
command: restart
- name: etcd2.service
command: start
- name: fleet.service
command: start
- name: flanneld.service
command: start
drop-ins:
- name: 50-network-config.conf
content: |
[Service]
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.1.0.0/16", "Backend": {"Type": "vxlan"}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment