Skip to content

Instantly share code, notes, and snippets.

Spinnaker on GKE

This serves as a reference of how I configured a distrubuted installation of Spinnaker running on GKE. It assumes a certain environment although you may pick and choose from this guide.

Specifics:

  • A seperate GCP project for Cloudbuild (useful if you orchestrate across different project)
  • Use GCS for storage
  • Use CloudBuild and PubSub to trigger pipelines
  • Use GCR as container registry
@mjroeleveld
mjroeleveld / restore-default-gcp-serviceaccounts.sh
Last active December 9, 2022 15:16
Restore default GCP service accounts
PROJECT=project
PROJECT_NUMBER=1343214123423
# GKE
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:service-$PROJECT_NUMBER@container-engine-robot.iam.gserviceaccount.com --role=roles/container.serviceAgent
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:service-$PROJECT_NUMBER@containerregistry.iam.gserviceaccount.com --role=roles/editor
# Compute
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/editor
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/compute.serviceAgent
# APIs
@mjroeleveld
mjroeleveld / makeGithubGraphqlIterator.ts
Last active April 12, 2021 09:48
Iterator that loops over Github GraphQL API result using cursor
import { getOctokit } from '@actions/github';
import { GraphQlQueryResponseData } from '@octokit/graphql';
const MAX_PAGE_SIZE = 100;
export interface IterableListSearch<Iterable> {
nodes: Iterable[];
pageInfo: PageInfo;
}
@mjroeleveld
mjroeleveld / terraform-single-to-multiline-string.sh
Last active January 11, 2022 14:02
Convert Terraform string to multiline string
# First iteration: convert single line strings to EOF blocks for
# resource argument called filter.
#
# filter = "foo\nbar"
#
# becomes
#
# filter = <<EOF
# foo\nbar
# EOF