From 9461fc3ffa473a778e42e1a4da97f1399a4ff1ac Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 16 Mar 2016 23:42:51 -0700 Subject: [PATCH] examples: Enable Fleet in etcd/etcd_proxy profiles --- examples/coreos-install.yaml | 4 ++++ examples/etcd-docker.yaml | 4 ++++ examples/etcd-rkt.yaml | 4 ++++ examples/ignition/etcd.yaml | 12 ++++++++++-- examples/ignition/etcd_proxy.yaml | 13 +++++++++++-- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/examples/coreos-install.yaml b/examples/coreos-install.yaml index 3addcad1..f3795991 100644 --- a/examples/coreos-install.yaml +++ b/examples/coreos-install.yaml @@ -19,6 +19,7 @@ groups: networkd_dns: 172.15.0.3 networkd_address: 172.15.0.21/16 ipv4_address: 172.15.0.21 + fleet_metadata: "role=etcd,name=node1" etcd_name: node1 etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" ssh_authorized_keys: @@ -34,6 +35,7 @@ groups: networkd_dns: 172.15.0.3 networkd_address: 172.15.0.22/16 ipv4_address: 172.15.0.22 + fleet_metadata: "role=etcd,name=node2" etcd_name: node2 etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" @@ -48,6 +50,7 @@ groups: networkd_dns: 172.15.0.3 networkd_address: 172.15.0.23/16 ipv4_address: 172.15.0.23 + fleet_metadata: "role=etcd,name=node3" etcd_name: node3 etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" @@ -59,4 +62,5 @@ groups: networkd_name: ens3 networkd_gateway: 172.15.0.1 networkd_dns: 172.15.0.3 + fleet_metadata: role=etcd-proxy etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" diff --git a/examples/etcd-docker.yaml b/examples/etcd-docker.yaml index cc4d6474..b22d0ab6 100644 --- a/examples/etcd-docker.yaml +++ b/examples/etcd-docker.yaml @@ -11,6 +11,7 @@ groups: networkd_dns: 172.17.0.3 networkd_address: 172.17.0.21/16 ipv4_address: 172.17.0.21 + fleet_metadata: "role=etcd,name=node1" etcd_name: node1 etcd_initial_cluster: "node1=http://172.17.0.21:2380,node2=http://172.17.0.22:2380,node3=http://172.17.0.23:2380" @@ -24,6 +25,7 @@ groups: networkd_dns: 172.17.0.3 networkd_address: 172.17.0.22/16 ipv4_address: 172.17.0.22 + fleet_metadata: "role=etcd,name=node2" etcd_name: node2 etcd_initial_cluster: "node1=http://172.17.0.21:2380,node2=http://172.17.0.22:2380,node3=http://172.17.0.23:2380" @@ -37,6 +39,7 @@ groups: networkd_dns: 172.17.0.3 networkd_address: 172.17.0.23/16 ipv4_address: 172.17.0.23 + fleet_metadata: "role=etcd,name=node3" etcd_name: node3 etcd_initial_cluster: "node1=http://172.17.0.21:2380,node2=http://172.17.0.22:2380,node3=http://172.17.0.23:2380" @@ -46,4 +49,5 @@ groups: networkd_name: ens3 networkd_gateway: 172.17.0.1 networkd_dns: 172.17.0.3 + fleet_metadata: role=etcd-proxy etcd_initial_cluster: "node1=http://172.17.0.21:2380,node2=http://172.17.0.22:2380,node3=http://172.17.0.23:2380" diff --git a/examples/etcd-rkt.yaml b/examples/etcd-rkt.yaml index cb0ffd36..661f7a67 100644 --- a/examples/etcd-rkt.yaml +++ b/examples/etcd-rkt.yaml @@ -11,6 +11,7 @@ groups: networkd_dns: 172.15.0.3 networkd_address: 172.15.0.21/16 ipv4_address: 172.15.0.21 + fleet_metadata: "role=etcd,name=node1" etcd_name: node1 etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" @@ -24,6 +25,7 @@ groups: networkd_dns: 172.15.0.3 networkd_address: 172.15.0.22/16 ipv4_address: 172.15.0.22 + fleet_metadata: "role=etcd,name=node2" etcd_name: node2 etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" @@ -37,6 +39,7 @@ groups: networkd_dns: 172.15.0.3 networkd_address: 172.15.0.23/16 ipv4_address: 172.15.0.23 + fleet_metadata: "role=etcd,name=node3" etcd_name: node3 etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" @@ -46,4 +49,5 @@ groups: networkd_name: ens3 networkd_gateway: 172.15.0.1 networkd_dns: 172.15.0.3 + fleet_metadata: role=etcd-proxy etcd_initial_cluster: "node1=http://172.15.0.21:2380,node2=http://172.15.0.22:2380,node3=http://172.15.0.23:2380" \ No newline at end of file diff --git a/examples/ignition/etcd.yaml b/examples/ignition/etcd.yaml index 83b2d2f1..b67da3f4 100644 --- a/examples/ignition/etcd.yaml +++ b/examples/ignition/etcd.yaml @@ -14,6 +14,13 @@ systemd: ExecStart=/usr/bin/bash -c 'curl --url "http://bootcfg.foo:8080/metadata?{{.query}}" --retry 10 --output ${OUTPUT}' [Install] WantedBy=multi-user.target + - name: fleet.service + enable: true + dropins: + - name: fleet-metadata.conf + contents: | + [Service] + Environment="FLEET_METADATA={{.fleet_metadata}}" - name: etcd2.service enable: true dropins: @@ -23,14 +30,15 @@ systemd: Requires=metadata.service After=metadata.service [Service] + # ETCD_NAME, ETCD_INITIAL_CLUSTER EnvironmentFile=/run/metadata/bootcfg ExecStart= ExecStart=/usr/bin/etcd2 \ --advertise-client-urls=http://${IPV4_ADDRESS}:2379 \ --initial-advertise-peer-urls=http://${IPV4_ADDRESS}:2380 \ --listen-client-urls=http://0.0.0.0:2379 \ - --listen-peer-urls=http://${IPV4_ADDRESS}:2380 \ - --initial-cluster=${ETCD_INITIAL_CLUSTER} + --listen-peer-urls=http://${IPV4_ADDRESS}:2380 + networkd: units: - name: 00-{{.networkd_name}}.network diff --git a/examples/ignition/etcd_proxy.yaml b/examples/ignition/etcd_proxy.yaml index 93bfff7e..49b51a65 100644 --- a/examples/ignition/etcd_proxy.yaml +++ b/examples/ignition/etcd_proxy.yaml @@ -14,6 +14,15 @@ systemd: ExecStart=/usr/bin/bash -c 'curl --url http://bootcfg.foo:8080/metadata --retry 10 --output ${OUTPUT}' [Install] WantedBy=multi-user.target + - name: fleet.service + enable: true + dropins: + - name: fleet-metadata.conf + contents: | + [Service] + # FLEET_METADATA + EnvironmentFile=/run/metadata/bootcfg + Environment="FLEET_ETCD_SERVERS=http://127.0.0.1:2379" - name: etcd2.service enable: true dropins: @@ -23,12 +32,12 @@ systemd: Requires=metadata.service After=metadata.service [Service] + # ETCD_INITIAL_CLUSTER EnvironmentFile=/run/metadata/bootcfg ExecStart= ExecStart=/usr/bin/etcd2 \ --proxy on - --listen-client-urls=http://localhost:2379 \ - --initial-cluster=${ETCD_INITIAL_CLUSTER} + --listen-client-urls=http://127.0.0.1:2379 {{ if .ssh_authorized_keys }} passwd: