Skip to content

Instantly share code, notes, and snippets.

@ianblenke
Last active August 29, 2015 14:16
Show Gist options
  • Save ianblenke/7404ec5c4c39010dcfa9 to your computer and use it in GitHub Desktop.
Save ianblenke/7404ec5c4c39010dcfa9 to your computer and use it in GitHub Desktop.
Installing deis 1.3.1 locally on a coreos node with deisctl
#!/bin/bash
# http://deis.io/get-deis/
set -eo pipefail
[[ -n "$SSH_AUTH_SOCK" ]] || ( echo Make sure you have your ssh agent forwarded; false )
if fleetctl list-units | grep deis ; then
echo "Deis units are already in fleet"
else
# This ssh chicanery is probably overkill, so long as we have SSH_AUTH_SOCK access to an ssh-agent with private key trust to the machines
# Trust all of the member coreos machine's hostkeys
(fleetctl list-machines -fields=ip -no-legend | xargs -l1 -i% ssh-keyscan -t ed25519 % 2>/dev/null; cat ~/.ssh/known_hosts ) | sort | uniq > ~/.ssh/known_hosts
# Generate a key to trust if we don't already have one.
[[ -f ~/.ssh/id_rsa ]] || ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -P ''
# Trust it locally
( cat ~/.ssh/id_rsa.pub; cat ~/.ssh/authorized_keys) | sort | uniq > ~/.ssh/authorized_keys
# Distribute that new private key trust
fleetctl list-machines -fields=ip -no-legend | xargs -l1 -i% rsync -aq ~/.ssh/authorized_keys %:.ssh/
# Distribute the aggregate hostkey trust
fleetctl list-machines -fields=ip -no-legend | xargs -l1 -i% rsync -aq ~/.ssh/known_hosts %:.ssh/
# Distribute that new private key to all of the coreos machines
fleetctl list-machines -fields=ip -no-legend | xargs -l1 -i% rsync -aq ~/.ssh/id_rsa* %:.ssh/
# Install deisctl
sudo -E bash -c 'curl -sSL http://deis.io/deisctl/install.sh | sh -s 1.3.1'
deisctl --version
export FLEETCTL_HOST=$(ifconfig eth0 | grep 'inet ' | awk '{print $2}')
deisctl config platform set sshPrivateKey=~/.ssh/id_rsa
deisctl config platform set domain=example.com
deisctl install platform
deisctl start platform
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment