From d923aedc93b4a0464c3d79ccaaeb3a7f7169c3cf Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 14 Dec 2020 11:33:39 -0500 Subject: [PATCH 1/5] Add google-monitoring-enabled=true metadata to deployed instances Enables the Node Problem Detector on Container-Optimized OS, which collects metrics on memory usage, open tcp connections, processes, cpu steal, swap usage, on top of existing host-collected metrics. --- .github/workflows/cd.yml | 1 + .github/workflows/manual-deploy.yml | 1 + .github/workflows/test.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 559390f45f0..4f92883b34a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -88,6 +88,7 @@ jobs: --create-disk name=zebrad-cache-$SHORT_SHA,size=100GB,type=pd-balanced \ --container-mount-disk mount-path="/zebrad-cache",name=zebrad-cache-$SHORT_SHA \ --machine-type n2d-standard-4 \ + --metadata=google-monitoring-enabled=true \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --scopes cloud-platform \ --tags zebrad \ diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index d8f7a9d7f1d..73372603520 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -60,6 +60,7 @@ jobs: --container-mount-disk mount-path='/zebrad-cache',name=zebrad-cache-$SHORT_SHA \ --create-disk name=zebrad-cache-$SHORT_SHA,size=100GB,type=pd-balanced \ --machine-type n2-standard-4 \ + --metadata=google-monitoring-enabled=true \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --tags zebrad \ --zone us-central1-a diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f575ba3fbe9..4ed1052638d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,6 +56,7 @@ jobs: --create-disk name="zebrad-cache-$SHORT_SHA-mainnet-419200",image=zebrad-cache-062a5ae-mainnet-419200 \ --create-disk name="zebrad-cache-$SHORT_SHA-testnet-280000",image=zebrad-cache-2935b4e-testnet-280000 \ --machine-type n2-standard-4 \ + --metadata=google-monitoring-enabled=true \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --scopes cloud-platform \ --tags zebrad \ From e72b26b9607e49e9a3307872f465cdf552946ca1 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Tue, 15 Dec 2020 10:49:12 -0500 Subject: [PATCH 2/5] Add image-family and image-project base image qualifiers --- .github/workflows/cd.yml | 2 ++ .github/workflows/manual-deploy.yml | 2 ++ .github/workflows/test.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 4f92883b34a..2921dc4db4a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -87,6 +87,8 @@ jobs: --container-image "gcr.io/$PROJECT_ID/$REPOSITORY/$BRANCH_NAME:$SHORT_SHA" \ --create-disk name=zebrad-cache-$SHORT_SHA,size=100GB,type=pd-balanced \ --container-mount-disk mount-path="/zebrad-cache",name=zebrad-cache-$SHORT_SHA \ + --image-family cos-stable \ + --image-project cos-cloud \ --machine-type n2d-standard-4 \ --metadata=google-monitoring-enabled=true \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index 73372603520..deb5977d11e 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -59,6 +59,8 @@ jobs: --container-image "gcr.io/$PROJECT_ID/$REPOSITORY/$BRANCH_NAME:$SHORT_SHA" \ --container-mount-disk mount-path='/zebrad-cache',name=zebrad-cache-$SHORT_SHA \ --create-disk name=zebrad-cache-$SHORT_SHA,size=100GB,type=pd-balanced \ + --image-family cos-stable \ + --image-project cos-cloud \ --machine-type n2-standard-4 \ --metadata=google-monitoring-enabled=true \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ed1052638d..02c2c3d7b6b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,6 +55,8 @@ jobs: --container-restart-policy never \ --create-disk name="zebrad-cache-$SHORT_SHA-mainnet-419200",image=zebrad-cache-062a5ae-mainnet-419200 \ --create-disk name="zebrad-cache-$SHORT_SHA-testnet-280000",image=zebrad-cache-2935b4e-testnet-280000 \ + --image-family cos-stable \ + --image-project cos-cloud \ --machine-type n2-standard-4 \ --metadata=google-monitoring-enabled=true \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ From d01b2ea47e63641d13df826c48b23488af3b7061 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Tue, 15 Dec 2020 18:19:23 -0500 Subject: [PATCH 3/5] Try cos-dev instable of -stable --- .github/workflows/manual-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index deb5977d11e..acffba116a0 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -59,7 +59,7 @@ jobs: --container-image "gcr.io/$PROJECT_ID/$REPOSITORY/$BRANCH_NAME:$SHORT_SHA" \ --container-mount-disk mount-path='/zebrad-cache',name=zebrad-cache-$SHORT_SHA \ --create-disk name=zebrad-cache-$SHORT_SHA,size=100GB,type=pd-balanced \ - --image-family cos-stable \ + --image-family cos-dev \ --image-project cos-cloud \ --machine-type n2-standard-4 \ --metadata=google-monitoring-enabled=true \ From faff2de06097dcbc57adfa9b9a2cf6375e24dcc4 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Tue, 29 Dec 2020 22:57:55 -0500 Subject: [PATCH 4/5] Use startup script to start node-problem-detector --- .github/workflows/cd.yml | 4 +--- .github/workflows/manual-deploy.yml | 2 +- .github/workflows/test.yml | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2921dc4db4a..1aac3b60963 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -87,10 +87,8 @@ jobs: --container-image "gcr.io/$PROJECT_ID/$REPOSITORY/$BRANCH_NAME:$SHORT_SHA" \ --create-disk name=zebrad-cache-$SHORT_SHA,size=100GB,type=pd-balanced \ --container-mount-disk mount-path="/zebrad-cache",name=zebrad-cache-$SHORT_SHA \ - --image-family cos-stable \ - --image-project cos-cloud \ --machine-type n2d-standard-4 \ - --metadata=google-monitoring-enabled=true \ + --metadata startup-script="systemctl start node-problem-detector" \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --scopes cloud-platform \ --tags zebrad \ diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index acffba116a0..9533d30124e 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -62,7 +62,7 @@ jobs: --image-family cos-dev \ --image-project cos-cloud \ --machine-type n2-standard-4 \ - --metadata=google-monitoring-enabled=true \ + --metadata startup-script="systemctl start node-problem-detector" \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --tags zebrad \ --zone us-central1-a diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02c2c3d7b6b..05445658196 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,10 +55,8 @@ jobs: --container-restart-policy never \ --create-disk name="zebrad-cache-$SHORT_SHA-mainnet-419200",image=zebrad-cache-062a5ae-mainnet-419200 \ --create-disk name="zebrad-cache-$SHORT_SHA-testnet-280000",image=zebrad-cache-2935b4e-testnet-280000 \ - --image-family cos-stable \ - --image-project cos-cloud \ --machine-type n2-standard-4 \ - --metadata=google-monitoring-enabled=true \ + --metadata startup-script="systemctl start node-problem-detector" \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --scopes cloud-platform \ --tags zebrad \ From f1cebb87f50a8c7f82a5f239f97ba9cd8e9c9171 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Wed, 30 Dec 2020 14:14:51 -0500 Subject: [PATCH 5/5] Try metadata key too --- .github/workflows/manual-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index 9533d30124e..b0590735d8f 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -62,7 +62,7 @@ jobs: --image-family cos-dev \ --image-project cos-cloud \ --machine-type n2-standard-4 \ - --metadata startup-script="systemctl start node-problem-detector" \ + --metadata google-monitoring-enabled=true,startup-script="systemctl start node-problem-detector" \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --tags zebrad \ --zone us-central1-a