Skip to content

Instantly share code, notes, and snippets.

@ellerbrock
Created October 26, 2017 21:40
Show Gist options
  • Save ellerbrock/735cc7c0da024184b0b256491c7deab5 to your computer and use it in GitHub Desktop.
Save ellerbrock/735cc7c0da024184b0b256491c7deab5 to your computer and use it in GitHub Desktop.
Example Ignition Configs
{
"ignitionVersion": 1,
"storage": {
"filesystems": [
{
"device": "/dev/disk/by-label/ROOT",
"format": "btrfs",
"create": {
"force": true,
"options": [
"--label=ROOT"
]
}
}
]
},
"systemd": {
"units": [
{
"name": "etcd2.service",
"enable": true,
"dropins": [
{
"name": "metadata.conf",
"contents": "[Unit]\nRequires=coreos-metadata.service\nAfter=coreos-metadata.service\n\n[Service]\nEnvironmentFile=/run/metadata/coreos\nExecStart=\nExecStart=/usr/bin/etcd2 --advertise-client-urls=http://${COREOS_IPV4_PUBLIC}:2379 --initial-advertise-peer-urls=http://${COREOS_IPV4_LOCAL}:2380 --listen-client-urls=http://0.0.0.0:2379 --listen-peer-urls=http://${COREOS_IPV4_LOCAL}:2380 --initial-cluster=${ETCD_NAME}=http://${COREOS_IPV4_LOCAL}:2380"
}
]
}
]
}
}
{
"ignitionVersion": 1,
"storage": {
"filesystems": [
{
"device": "/dev/disk/by-label/ROOT",
"format": "btrfs",
"create": {
"force": true,
"options": [
"--label=ROOT"
]
},
"files":[
{
"path": "/alex",
"contents": "hello",
"mode": 420
}
]
}
]
}
}
ignition_version: 1
systemd:
units:
- name: "etcd2.service"
enable: true
dropins:
- name: "metadata.conf"
contents: |
[Unit]
Requires=metadata.service
After=metadata.service
[Service]
EnvironmentFile=/run/metadata/ec2
ExecStart=
ExecStart=/usr/bin/etcd2 \
--advertise-client-urls=http://${COREOS_IPV4_PUBLIC}:2379 \
--initial-advertise-peer-urls=http://${COREOS_IPV4_LOCAL}:2380 \
--listen-client-urls=http://0.0.0.0:2379 \
--listen-peer-urls=http://${COREOS_IPV4_LOCAL}:2380 \
--initial-cluster=${ETCD_NAME}=http://${COREOS_IPV4_LOCAL}:2380
- name: "metadata.service"
contents: |
[Unit]
Description=EC2 metadata agent
[Service]
Type=oneshot
Environment=OUTPUT=/run/metadata/ec2
ExecStart=/usr/bin/mkdir --parent /run/metadata
ExecStart=/usr/bin/bash -c 'echo "COREOS_IPV4_PUBLIC=$(curl\
--url http://169.254.169.254/2009-04-04/meta-data/public-ipv4\
--retry 10)\nCOREOS_IPV4_LOCAL=$(curl\
--url http://169.254.169.254/2009-04-04/meta-data/local-ipv4\
--retry 10)" > ${OUTPUT}'
{
"ignitionVersion": 1,
"systemd": {
"units": [
{
"name": "etcd2.service",
"enable": true,
"dropins": [
{
"name": "metadata.conf",
"contents": "[Unit]\nRequires=coreos-metadata.service\nAfter=coreos-metadata.service\n\n[Service]\nEnvironmentFile=/run/metadata/coreos\nExecStart=\nExecStart=/usr/bin/etcd2 --advertise-client-urls=http://${COREOS_IPV4_PUBLIC}:2379 --initial-advertise-peer-urls=http://${COREOS_IPV4_LOCAL}:2380 --listen-client-urls=http://0.0.0.0:2379 --listen-peer-urls=http://${COREOS_IPV4_LOCAL}:2380 --initial-cluster=${ETCD_NAME}=http://${COREOS_IPV4_LOCAL}:2380"
}
]
}
]
}
}
{
"ignitionVersion": 1
}
{
"version": 1,
"storage": {
"disks": [
{
"device": "/dev/mmcblk0",
"partitions": [
{
"label": "raid.1.1",
"number": 1,
"size": "+20480",
"start": "0"
},
{
"label": "raid.1.2",
"number": 2,
"size": "+20480",
"start": "0"
},
{
"label": "raid.1.3",
"number": 3,
"size": "+20480",
"start": "0"
}
],
"wipe-table": true
}
],
"raid": [
{
"devices": [
"/dev/disk/by-partlabel/raid.1.1",
"/dev/disk/by-partlabel/raid.1.2",
"/dev/disk/by-partlabel/raid.1.3"
],
"level": "stripe",
"name": "md0"
}
],
"filesystems": [
{
"device": "/dev/md0",
"format": "ext4"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment