Skip to content

Commit

Permalink
docs: use Cloud Run functions branding
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybell committed Oct 21, 2024
1 parent 6d1a731 commit c23dc72
Showing 16 changed files with 36 additions and 33 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ interaction flow:
* [The Poller component][autoscaler-poller]
* [The Scaler component][autoscaler-scaler]

These can be deployed to either [Cloud Functions][cloud-functions] or
These can be deployed to either [Cloud Run functions][cloud-functions] or
[Google Kubernetes Engine (GKE)][gke], and configured so that the
Autoscaler runs according to a user-defined schedule. In certain deployment
topologies a third component, the [Forwarder][autoscaler-forwarder], is also
@@ -93,7 +93,7 @@ tracking and auditing.
To deploy the Autoscaler, decide which of the following strategies
is best adjusted to fulfill your technical and operational needs:

* [Deployment to Cloud Functions](terraform/cloud-functions/README.md)
* [Deployment to Cloud Run functions](terraform/cloud-functions/README.md)
* [Deployment to Google Kubernetes Engine (GKE)](terraform/gke/README.md)

In both of the above instances, the Google Cloud Platform resources are
@@ -163,7 +163,7 @@ used to monitor the behavior of the autoscaler, and to configure alerts.
The parameters for configuring the Autoscaler are identical regardless of the chosen
deployment type, but the mechanism for configuration differs slightly:

* [Cloud Functions](terraform/cloud-functions/README.md#configuration)
* [Cloud Run functions](terraform/cloud-functions/README.md#configuration)
* [Google Kubernetes Engine (GKE)](terraform/gke/README.md#building-and-deploying-the-autoscaler-services)

There is also a [browser-based configuration file editor and a command line
2 changes: 1 addition & 1 deletion autoscaler-config.schema.json
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@
"type": "string",
"minLength": 2,
"pattern": "^projects/[^/]+/topics/[^/]+$",
"description": "PubSub topic (in the form `projects/${projectId}/topics/scaler-topic`) for the Poller function to publish messages for the Scaler function (Required for Cloud Functions deployments)"
"description": "PubSub topic (in the form `projects/${projectId}/topics/scaler-topic`) for the Poller function to publish messages for the Scaler function (Required for Cloud Run functions deployments)"
},
"scalerURL": {
"type": "string",
2 changes: 1 addition & 1 deletion src/autoscaler-common/counters_base.js
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ const ExporterMode = {
};

const EXPORTER_PARAMETERS = {
// GCM direct pushing is only done in Cloud functions deployments, where
// GCM direct pushing is only done in Cloud Run functions deployments, where
// we only flush directly.
//
[ExporterMode.GCM_ONLY_FLUSHING]: {
2 changes: 1 addition & 1 deletion src/functions.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
* @fileoverview
* Cloud Spanner Autoscaler
*
* Entry points for Cloud Functions invocations.
* Entry points for Cloud Run functions invocations.
*/

const poller = require('./poller/poller-core');
12 changes: 6 additions & 6 deletions src/poller/README.md
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
* [Thresholds](#thresholds)
* [Margins](#margins)
* [Metrics](#metrics)
* [Example configuration for Cloud Functions](#example-configuration-for-cloud-functions)
* [Example configuration for Cloud Run functions](#example-configuration-for-cloud-run-functions)
* [Example configuration for Google Kubernetes Engine](#example-configuration-for-google-kubernetes-engine)

## Overview
@@ -61,16 +61,16 @@ instance is [regional or multi-region][spanner-regional].
The following are the configuration parameters consumed by the Poller component.
Some of these parameters are forwarded to the Scaler component as well.

In the case of the Poller and Scaler components deployed to Cloud Functions,
In the case of the Poller and Scaler components deployed to Cloud Run functions,
the parameters are defined using JSON in the payload of the PubSub message that
is published by the Cloud Scheduler job. When deployed to Kubernetes, the
configuration parameters are defined in YAML in a [Kubernetes ConfigMap][configmap].

See the [configuration section][autoscaler-home-config] in the home page for
instructions on how to change the payload.

The Autoscaler JSON (for Cloud functions) or YAML (for GKE) configuration can be
validated by running the command:
The Autoscaler JSON (for Cloud Run functions) or YAML (for GKE) configuration
can be validated by running the command:

```shell
npm install
@@ -84,7 +84,7 @@ npm run validate-config-file -- path/to/config_file
| `projectId` | Project ID of the Cloud Spanner to be monitored by the Autoscaler |
| `instanceId` | Instance ID of the Cloud Spanner to be monitored by the Autoscaler |

### Required for a Cloud Functions deployment
### Required for a Cloud Run functions deployment

| Key | Description |
| ------------------- | ----------- |
@@ -261,7 +261,7 @@ ALTER TABLE spannerAutoscaler ADD COLUMN IF NOT EXISTS scalingMethod STRING(MAX)
ALTER TABLE spannerAutoscaler ADD COLUMN IF NOT EXISTS scalingPreviousSize INT64;
```

## Example configuration for Cloud Functions
## Example configuration for Cloud Run functions

```json
[
2 changes: 1 addition & 1 deletion src/scaler/scaler-core/index.js
Original file line number Diff line number Diff line change
@@ -444,7 +444,7 @@ async function processScalingRequest(spanner, autoscalerState) {
/**
* Handle scale request from a PubSub event.
*
* Called by Cloud Functions Scaler deployment.
* Called by Cloud Run functions Scaler deployment.
*
* @param {{data:string}} pubSubEvent -- a CloudEvent object.
* @param {*} context
8 changes: 4 additions & 4 deletions terraform/README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
·
Monitoring
<br />
<a href="cloud-functions/README.md">Cloud Functions</a>
<a href="cloud-functions/README.md">Cloud Run functions</a>
·
<a href="gke/README.md">Google Kubernetes Engine</a>
</p>
@@ -39,8 +39,8 @@ infrastructure of your Autoscaler.

The Autoscaler can be deployed in two different ways:

* [Deployment to Cloud Functions](cloud-functions/README.md): Autoscaler
components are deployed to [Cloud Functions][cloudfunctions], with
* [Deployment to Cloud Run functions](cloud-functions/README.md): Autoscaler
components are deployed to [Cloud Run functions][cloudfunctions], with
[Pub/Sub][pubsub] used for asynchronous messaging between components. Use
this deployment type for serverless operation, for cross-project
Autoscaling, and to take maximal advantage of Google Cloud managed
@@ -50,7 +50,7 @@ The Autoscaler can be deployed in two different ways:
components are deployed to [Google Kubernetes Engine (GKE)][gke], with
Kubernetes-native constructs used for messaging and configuration. Use this
deployment type if you want to use Kubernetes or cannot use the Google
Cloud service dependencies in the Cloud Functions model described above.
Cloud service dependencies in the Cloud Run functions model described above.

## Monitoring

4 changes: 2 additions & 2 deletions terraform/cloud-functions/README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
·
Monitoring
<br />
Cloud Functions
Cloud Run functions
·
<a href="../gke/README.md">Google Kubernetes Engine</a>
<br />
@@ -43,7 +43,7 @@
## Overview

This directory contains Terraform configuration files to quickly set up the
infrastructure of your Autoscaler on Cloud Functions.
infrastructure of your Autoscaler on Cloud Run functions.

## Architecture

5 changes: 3 additions & 2 deletions terraform/cloud-functions/centralized/README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@

<p align="center">
<!-- In one sentence: what does the code in this directory do? -->
Set up the Autoscaler in Cloud Functions in a centralized deployment using Terraform
Set up the Autoscaler in Cloud Run functions in a centralized
deployment using Terraform
<br />
<a href="../../../README.md">Home</a>
·
@@ -19,7 +20,7 @@
·
<a href="../README.md#Monitoring">Monitoring</a>
<br />
Cloud Functions
Cloud Run functions
·
<a href="../../gke/README.md">Google Kubernetes Engine</a>
<br />
5 changes: 3 additions & 2 deletions terraform/cloud-functions/distributed/README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@

<p align="center">
<!-- In one sentence: what does the code in this directory do? -->
Set up the Autoscaler in Cloud Functions in a distributed deployment using Terraform
Set up the Autoscaler in Cloud Run functions in a distributed
deployment using Terraform
<br />
<a href="../../../README.md">Home</a>
·
@@ -19,7 +20,7 @@
·
<a href="../README.md#Monitoring">Monitoring</a>
<br />
Cloud Functions
Cloud Run functions
·
<a href="../../gke/README.md">Google Kubernetes Engine</a>
<br />
5 changes: 3 additions & 2 deletions terraform/cloud-functions/per-project/README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@

<p align="center">
<!-- In one sentence: what does the code in this directory do? -->
Set up the Autoscaler in Cloud Functions in a per-project deployment using Terraform
Set up the Autoscaler in Cloud Run functions in a per-project
deployment using Terraform
<br />
<a href="../../../README.md">Home</a>
·
@@ -19,7 +20,7 @@
·
<a href="../README.md#Monitoring">Monitoring</a>
<br />
Cloud Functions
Cloud Run functions
·
<a href="../../gke/README.md">Google Kubernetes Engine</a>
<br />
8 changes: 4 additions & 4 deletions terraform/gke/README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
·
<a href="../README.md#Monitoring">Monitoring</a>
<br />
<a href="../cloud-functions/README.md">Cloud Functions</a>
<a href="../cloud-functions/README.md">Cloud Run functions</a>
·
Google Kubernetes Engine
</p>
@@ -104,7 +104,7 @@ The GKE deployment has the following pros and cons:
### Pros

* **Kubernetes-based**: For teams that may not be able to use Google Cloud
services such as [Cloud Functions][cloud-functions], this design enables
services such as [Cloud Run functions][cloud-functions], this design enables
the use of the autoscaler.
* **Configuration**: The control over scheduler parameters belongs to the team
that owns the Spanner instance, therefore the team has the highest degree of
@@ -116,7 +116,7 @@ The GKE deployment has the following pros and cons:

### Cons

* **Infrastructure**: In contrast to the [Cloud Functions][cloud-functions]
* **Infrastructure**: In contrast to the [Cloud Run functions][cloud-functions]
design, some long-lived infrastructure and services are required.
* **Maintenance**: with each team being responsible for the Autoscaler
configuration and infrastructure it may become difficult to make sure that
@@ -617,7 +617,7 @@ Next, follow the instructions in the
## Metrics in GKE deployment
Unlike a in cloud functions deployment, In a GKE deployment, the counters
Unlike in a Cloud Run functions deployment, in a GKE deployment, the counters
generated by the `poller` and `scaler` components are forwarded to the
[OpenTelemetry Collector (`otel-collector`)][otel-collector] service.
This service is specified by an the environmental variable `OTEL_COLLECTOR_URL`
2 changes: 1 addition & 1 deletion terraform/gke/decoupled/README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
·
<a href="../../README.md#Monitoring">Monitoring</a>
<br />
<a href="../../cloud-functions/README.md">Cloud Functions</a>
<a href="../../cloud-functions/README.md">Cloud Run functions</a>
·
Google Kubernetes Engine
</p>
2 changes: 1 addition & 1 deletion terraform/gke/unified/README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
·
<a href="../../README.md#Monitoring">Monitoring</a>
<br />
<a href="../../cloud-functions/README.md">Cloud Functions</a>
<a href="../../cloud-functions/README.md">Cloud Run functions</a>
·
Google Kubernetes Engine
</p>
2 changes: 1 addition & 1 deletion terraform/modules/autoscaler-functions/main.tf
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ resource "google_pubsub_topic_iam_member" "scaler_pubsub_sub_iam" {
}


// Cloud Functions
// Cloud Run functions

resource "google_storage_bucket" "bucket_gcf_source" {
project = var.project_id
2 changes: 1 addition & 1 deletion terraform/modules/forwarder/main.tf
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ resource "google_pubsub_topic_iam_member" "forwader_pubsub_sub_binding" {
member = "serviceAccount:${google_service_account.forwarder_sa.email}"
}

// Cloud Functions
// Cloud Run functions

resource "google_storage_bucket" "bucket_gcf_source" {
project = var.project_id

0 comments on commit c23dc72

Please sign in to comment.