CoreOS : cloud config pour instance EC2 avec stockage local Docker + swap

Boris HUISGEN
|
Le fichier cloud-config ci-dessous initialise une instance EC2 CoreOS avec les options suivantes :
paramétrage des timeout fleet et etcd
swap d’1 Go sur le disque local (/dev/xvdb1)
partition BRTFS pour les containers Docker sur disque local (/dev/xvdb2)
désactivation du reboot automatique par sécurité (locksmithd)
#cloud-config coreos: update: reboot-strategy: off etcd: # generate a new token for each unique cluster from https://discovery.etcd.io/new discovery: https://discovery.etcd.io/7c024472504cf1cef428ccc8af8e63f0 # multi-region and multi-cloud deployments need to use $public_ipv4 addr: $private_ipv4:4001 peer-addr: $private_ipv4:7001 peer-election-timeout: 6000 peer-heartbeat-interval: 1500 snapshot: true snapshot-count: 100 fleet: public-ip: $public_ipv4 metadata: region=eu-west etcd-request-timeout: 1500 units: - name: etcd.service command: start - name: fleet.service command: start - name: format-ephemeral.service command: start content: | [Unit] Description=Formats the ephemeral drive [Service] Type=oneshot RemainAfterExit=yes ExecStartPre=/usr/sbin/wipefs -f /dev/xvdb ExecStartPre=/usr/bin/sh -c "(/usr/bin/echo ',1024,S' && /usr/bin/echo ';')|/usr/sbin/sfdisk /dev/xvdb -uM" ExecStartPre=/usr/sbin/mkswap -f /dev/xvdb1 ExecStartPre=/usr/sbin/swapon /dev/xvdb1 ExecStart=/usr/sbin/mkfs.btrfs -f /dev/xvdb2 - name: var-lib-docker.mount command: start content: | [Unit] Description=Mount ephemeral to /var/lib/docker Requires=format-ephemeral.service After=format-ephemeral.service Before=docker.service [Mount] What=/dev/xvdb2 Where=/var/lib/docker Type=btrfs