Skip to content

Instantly share code, notes, and snippets.

@jimmycuadra
Last active April 19, 2021 03:04
Show Gist options
  • Select an option

  • Save jimmycuadra/fe79ae8857f3f0d0cae1 to your computer and use it in GitHub Desktop.

Select an option

Save jimmycuadra/fe79ae8857f3f0d0cae1 to your computer and use it in GitHub Desktop.

Revisions

  1. jimmycuadra revised this gist Jan 17, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions cloud-config.yml
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,7 @@ write_files:
    :FORWARD DROP [0:0]
    :OUTPUT ACCEPT [0:0]
    -A INPUT -i lo -j ACCEPT
    -A INPUT -i eth1 -j ACCEPT
    -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
  2. jimmycuadra revised this gist Jan 17, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions cloud-config.yml
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@ coreos:
    # private networking need to use $public_ipv4
    addr: $private_ipv4:4001
    peer-addr: $private_ipv4:7001
    fleet:
    public-ip: $private_ipv4
    units:
    - name: etcd.service
    command: start
  3. jimmycuadra created this gist Jan 17, 2015.
    35 changes: 35 additions & 0 deletions cloud-config.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    #cloud-config

    coreos:
    etcd:
    # generate a new token for each unique cluster from https://discovery.etcd.io/new
    discovery: https://discovery.etcd.io/<token>
    # multi-region deployments, multi-cloud deployments, and droplets without
    # private networking need to use $public_ipv4
    addr: $private_ipv4:4001
    peer-addr: $private_ipv4:7001
    units:
    - name: etcd.service
    command: start
    - name: fleet.service
    command: start
    - name: iptables-restore.service
    enable: true
    write_files:
    - path: /var/lib/iptables/rules-save
    permissions: 0644
    owner: root:root
    content: |
    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT ACCEPT [0:0]
    -A INPUT -i lo -j ACCEPT
    -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
    -A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
    -A INPUT -p icmp -m icmp --icmp-type 3 -j ACCEPT
    -A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT
    COMMIT