From f95e7d5595aa01680a29d827e88952f7fe3b564a Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Thu, 18 Jun 2020 02:25:22 -0400 Subject: [PATCH] Add health check --- .github/workflows/push.yml | 13 +++++++++++-- Dockerfile | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ea5220e27..6c596a43c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -45,14 +45,23 @@ jobs: - name: Create instance template run: | gcloud compute instance-templates create-with-container "zebrad-$SHORT_BRANCH_NAME-$SHA7" \ + --container-image "gcr.io/$PROJECT_ID/$BRANCH_NAME:$SHA7" \ --service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \ --scopes cloud-platform \ - --container-image "gcr.io/$PROJECT_ID/$BRANCH_NAME:$SHA7" + --machine-type n1-highmem-8 \ # Deploy managed instance group using the new instance template - name: Deploy managed instance group + # Assumes the 'zebrad-tracing-filter' healthcheck to hit + # :3000/filter exists, which requires the + # 'allow-tracing-health-check' firewall rule to allow Google + # 'spotter' IPs to hit that port be added to the network + # attached to the instance template (usually it's 'default'). run: | gcloud compute instance-groups managed create \ "zebrad-$SHORT_BRANCH_NAME-$SHA7" \ --template "zebrad-$SHORT_BRANCH_NAME-$SHA7" \ - --size 2 + --health-check zebrad-tracing-filter \ + --initial-delay 60 \ + --region us-central1 \ + --size 2 \ diff --git a/Dockerfile b/Dockerfile index 4534fcea5..f967c608d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN rustc -V; cargo -V; rustup -V; cargo test --all && cargo build --release FROM debian:buster-slim COPY --from=builder /zebra/target/release/zebrad / +EXPOSE 3000 EXPOSE 8233 EXPOSE 18233 CMD [ "/zebrad", "start" ]