mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 10:19:35 +00:00
* Install a Kubernetes cluster with 1 master, 2 workers * Setup a 3 node etcd cluster and enable update-engine * Include fleet on the cluster as well
76 lines
2.0 KiB
YAML
76 lines
2.0 KiB
YAML
---
|
|
ignition_version: 1
|
|
systemd:
|
|
units:
|
|
- name: metadata.service
|
|
enable: true
|
|
contents: |
|
|
[Unit]
|
|
Description=Bare Metal Metadata Agent
|
|
[Service]
|
|
Type=oneshot
|
|
Environment=OUTPUT=/run/metadata/bootcfg
|
|
ExecStart=/usr/bin/mkdir --parent /run/metadata
|
|
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:
|
|
- name: etcd-metadata.conf
|
|
contents: |
|
|
[Unit]
|
|
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
|
|
storage:
|
|
disks:
|
|
- device: /dev/sda
|
|
wipe_table: true
|
|
partitions:
|
|
- label: ROOT
|
|
number: 0
|
|
filesystems:
|
|
- device: "/dev/sda1"
|
|
format: "ext4"
|
|
create:
|
|
force: true
|
|
options:
|
|
- "-LROOT"
|
|
networkd:
|
|
units:
|
|
- name: 00-{{.networkd_name}}.network
|
|
contents: |
|
|
[Match]
|
|
Name={{.networkd_name}}
|
|
[Network]
|
|
Gateway={{.networkd_gateway}}
|
|
DNS={{.networkd_dns}}
|
|
DNS=8.8.8.8
|
|
Address={{.networkd_address}}
|
|
|
|
{{ if .ssh_authorized_keys }}
|
|
passwd:
|
|
users:
|
|
- name: core
|
|
ssh_authorized_keys:
|
|
{{ range $element := .ssh_authorized_keys }}
|
|
- {{$element}}
|
|
{{end}}
|
|
{{end}}
|