Skip to content

Commit

Permalink
Sets Docker containers to always restart + upgrades machine type for …
Browse files Browse the repository at this point in the history
…mlab-oti deployment (#9)

* Changes the GCE machine type for the mlab-oti project to n1-standard-8. n1-highmem-4 had enough RAM but not enough CPU.

* Adds the --restart=always flag to docker-run command so that containers always come back up on their own.

* Puts docker-run flags in a common order for better readability.
  • Loading branch information
nkinkade authored Feb 20, 2018
1 parent bd77add commit e19a30d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deploy_script_exporter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GCE_IMG_FAMILY="coreos-stable"
# instance machine types to account for expected load.
case $PROJECT in
mlab-oti)
MACHINE_TYPE="n1-highmem-4"
MACHINE_TYPE="n1-standard-8"
;;
mlab-staging)
MACHINE_TYPE="n1-standard-2"
Expand Down Expand Up @@ -85,7 +85,7 @@ gcloud compute scp $SCP_FILES $GCE_NAME:~
gcloud compute ssh $GCE_NAME --command "docker build -t ${IMAGE_TAG} ."

# Start a new container based on the new/updated image.
gcloud compute ssh $GCE_NAME --command "docker run --cap-add NET_ADMIN -p 9172:9172 -d ${IMAGE_TAG}"
gcloud compute ssh $GCE_NAME --command "docker run --detach --restart always --publish 9172:9172 --cap-add NET_ADMIN ${IMAGE_TAG}"

# Run Prometheus node_exporter in a container so we can gather VM metrics.
gcloud compute ssh $GCE_NAME --command "docker run --detach --publish 9100:9100 --volume /proc:/host/proc --volume /sys:/host/sys prom/node-exporter --path.procfs /host/proc --path.sysfs /host/sys --no-collector.arp --no-collector.bcache --no-collector.conntrack --no-collector.edac --no-collector.entropy --no-collector.filefd --no-collector.hwmon --no-collector.infiniband --no-collector.ipvs --no-collector.mdadm --no-collector.netstat --no-collector.sockstat --no-collector.time --no-collector.timex --no-collector.uname --no-collector.vmstat --no-collector.wifi --no-collector.xfs --no-collector.zfs"
gcloud compute ssh $GCE_NAME --command "docker run --detach --restart always --publish 9100:9100 --volume /proc:/host/proc --volume /sys:/host/sys prom/node-exporter --path.procfs /host/proc --path.sysfs /host/sys --no-collector.arp --no-collector.bcache --no-collector.conntrack --no-collector.edac --no-collector.entropy --no-collector.filefd --no-collector.hwmon --no-collector.infiniband --no-collector.ipvs --no-collector.mdadm --no-collector.netstat --no-collector.sockstat --no-collector.time --no-collector.timex --no-collector.uname --no-collector.vmstat --no-collector.wifi --no-collector.xfs --no-collector.zfs"

0 comments on commit e19a30d

Please sign in to comment.