From e19a30dfbdf7d10308464d2a0efee6d0d75f26ec Mon Sep 17 00:00:00 2001 From: nkinkade Date: Tue, 20 Feb 2018 13:27:00 -0700 Subject: [PATCH] Sets Docker containers to always restart + upgrades machine type for 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. --- deploy_script_exporter.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy_script_exporter.sh b/deploy_script_exporter.sh index 2ac1ed7..1f4827a 100755 --- a/deploy_script_exporter.sh +++ b/deploy_script_exporter.sh @@ -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" @@ -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"