mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 10:19:35 +00:00
examples: Enable Fleet in etcd/etcd_proxy profiles
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user