Skip to content

Commit

Permalink
Mount /dev/xvdf in cloud-config for etcd
Browse files Browse the repository at this point in the history
  • Loading branch information
adambom committed Oct 25, 2016
1 parent 0653e76 commit 8e73f42
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions modules/etcd/cloud-config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ coreos:
advertise-client-urls: http://${ fqdn }:2379
# cert-file: /etc/kubernetes/ssl/k8s-etcd.pem
# debug: true
data-dir: /media/etcd2
discovery-srv: ${ internal-tld }
initial-advertise-peer-urls: https://${ fqdn }:2380
initial-cluster-state: new
Expand All @@ -25,6 +26,43 @@ coreos:
peer-key-file: /etc/kubernetes/ssl/k8s-etcd-key.pem
units:
- name: format-ebs-volume.service
command: start
content: |
[Unit]
Description=Formats the ebs volume
After=dev-xvdf.device
Requires=dev-xvdf.device
[Service]
ExecStart=/bin/bash -c "(/usr/sbin/blkid -t TYPE=ext4 | grep /dev/xvdf) || (/usr/sbin/wipefs -fa /dev/xvdf && /usr/sbin/mkfs.ext4 /dev/xvdf)"
RemainAfterExit=yes
Type=oneshot
- name: media-etcd2.mount
command: start
content: |
[Unit]
Description=Mount ebs to /media/etcd2
Requires=format-ebs-volume.service
After=format-ebs-volume.service
[Mount]
What=/dev/xvdf
Where=/media/etcd2
Type=ext4
- name: prepare-etcd-data-dir.service
command: start
content: |
[Unit]
Description=Prepares the etcd data directory
Requires=media-etcd2.mount
After=media-etcd2.mount
Before=etcd2.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/chown -R etcd:etcd /media/etcd2
- name: etcd2.service
command: start
drop-ins:
Expand Down

0 comments on commit 8e73f42

Please sign in to comment.