Skip to content

Instantly share code, notes, and snippets.

@krancour
Created June 18, 2015 13:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krancour/c6c10efb1500f54a2607 to your computer and use it in GitHub Desktop.
Save krancour/c6c10efb1500f54a2607 to your computer and use it in GitHub Desktop.
custom deis install
#!/bin/bash
set -e
DEISCTL_VERSION="1.7.0"
deisctl --version | grep $DEISCTL_VERSION || echo "Expected deisctl version (${DEISCTL_VERSION}) not found." && exit 1
echo "Copying Deis units..."
mkdir -p ~/.deis/units
cp units/deis-*.service ~/.deis/units
echo "Deis units copied."
echo "Starting global Deis platform configuration..."
deisctl config platform set domain=devcloud.<my company>.com
echo "Done with global Deis platform configuration."
echo "Installing logspout unit..."
deisctl install logspout
echo "Logspout unit installed."
echo "Configuring logspout..."
deisctl config logspout set image=krancour/deis-logspout:lcc
deisctl config logs set host=log-nonprod.<my company>.com
deisctl config logs set port=514
echo "Logspout configured."
echo "Starting logspout..."
deisctl start logspout
echo "Logspout started."
echo "Installing unit for ONE registry instance..."
deisctl install registry@1
echo "Unit for ONE registry instance installed."
echo "You can scale this component later if desired."
echo "Configuring registry..."
deisctl config registry set image=krancour/deis-registry:lcc
deisctl config registry set s3region=us-east-1
deisctl config registry set s3accessKey=<redacted>
deisctl config registry set s3secretKey=<redacted>
deisctl config registry set s3path=/
deisctl config registry set s3bucket=<my company>-deis-nonprod-registry
deisctl config registry set bucketName=<my company>-deis-nonprod-registry
deisctl config registry set s3encrypt=false
deisctl config registry set s3secure=false
deisctl config store set gateway/accessKey=<redacted>
deisctl config store set gateway/secretKey=<redacted>
deisctl config store set gateway/host=s3.amazonaws.com
deisctl config store set gateway/port=80
echo "Registry configured."
echo "Starting registry..."
deisctl start registry@*
echo "Registry started."
echo "Installing controller unit..."
deisctl install controller
echo "Controller unit installed."
echo "Configuring controller..."
deisctl config controller set image=krancour/deis-controller:lcc
deisctl config database set host=deis-db-nonprod.<my company>.com
deisctl config database set port=5432
deisctl config database set engine=postgresql_psycopg2
deisctl config database set name=deis
deisctl config database set user=deis
deisctl config database set password=<redacted>
echo "Controller configured."
echo "Starting controller..."
deisctl start controller
echo "Controller started."
echo "Installing builder unit..."
deisctl install builder
echo "Builder unit installed."
echo "Configuring builder..."
deisctl config builder set image=krancour/deis-builder:lcc
echo "Builder configured."
echo "Starting builder. This MAY take up to 30 minutes..."
deisctl start builder
echo "Builder started."
echo "Installing publisher unit..."
deisctl install publisher
echo "Publisher unit installed."
echo "Configuring publisher..."
deisctl config publisher set image=krancour/deis-publisher:lcc
echo "Publisher configured."
echo "Starting publisher..."
deisctl start publisher
echo "Publisher started."
echo "Installing units for TWO router instances..."
deisctl install router@1 router@2
echo "Units for TWO router instances installed."
echo "You can scale this component later if desired."
echo "Configuring router..."
deisctl config router set image=krancour/deis-router:lcc
echo "Router configured."
echo "Starting router..."
deisctl start router@*
echo "Router started."
echo "Installing influxdb unit..."
fleetctl load units/influxdb.service
echo "Influxdb unit installed."
echo "Configuring influxdb..."
echo "Influxdb configured."
echo "Starting influxdb..."
fleetctl start influxdb
echo "Influxdb started."
echo "Generating heapster unit from template..."
FIRST_CONTROL_IP=$(fleetctl list-machines | grep controlPlane=true | head -1 | awk '{ print $2 }')
cp units/heapster.service.template units/heapster.service
sed -i s/{{FIRST_CONTROL_IP}}/$FIRST_CONTROL_IP/g units/heapster.service
echo "Heapster unit generated."
echo "Installing heapster unit..."
fleetctl load units/heapster.service
echo "Heapster unit installed."
echo "Configuring heapster..."
echo "Heapster configured."
echo "Starting heapster..."
fleetctl start heapster
echo "Heapster started."
echo "Installing grafana unit..."
fleetctl load units/grafana.service
echo "Grafana unit installed."
echo "Configuring grafana..."
echo "Grafana configured."
echo "Starting grafana..."
fleetctl start grafana
echo "Grafan started."
echo "Publishing grafana..."
OBSERVER_IP=$(fleetctl list-machines | grep observerPlane=true | awk '{ print $2 }')
etcdctl set /deis/services/grafana/grafana $OBSERVER_IP:8081
echo "Grafana published."
echo "Installing cadvisor unit..."
fleetctl load units/cadvisor.service
echo "Cadvisor unit installed."
echo "Configuring cadvisor..."
echo "Cadvisor configured."
echo "Starting cadvisor..."
fleetctl start cadvisor
echo "Cadvisor started."
echo "Installing hourly Deis database backup units..."
fleetctl load units/deis-backup.service
fleetctl load units/deis-backup.timer
echo "Hourly Deis database backup units installed."
echo "Starting Hourly Deis database backup..."
fleetctl start deis-backup.timer
echo "Hourly Deis database backup started."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment