Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(provider/google): Added cloudrun provider reference documentation in spinnaker.io #463

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 246 additions & 0 deletions content/en/docs/reference/halyard/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,16 @@ Published: 2020-04-30 21:10:29
- [hal config provider cloudfoundry account list](#hal-config-provider-cloudfoundry-account-list)
- [hal config provider cloudfoundry disable](#hal-config-provider-cloudfoundry-disable)
- [hal config provider cloudfoundry enable](#hal-config-provider-cloudfoundry-enable)
- [hal config provider cloudrun](#hal-config-provider-cloudrun)
- [hal config provider cloudrun account](#hal-config-provider-cloudrun-account)
- [hal config provider cloudrun account add](#hal-config-provider-cloudrun-account-add)
- [hal config provider cloudrun account delete](#hal-config-provider-cloudrun-account-delete)
- [hal config provider cloudrun account edit](#hal-config-provider-cloudrun-account-edit)
- [hal config provider cloudrun account get](#hal-config-provider-cloudrun-account-get)
- [hal config provider cloudrun account list](#hal-config-provider-cloudrun-account-list)
- [hal config provider cloudrun disable](#hal-config-provider-cloudrun-disable)
- [hal config provider cloudrun edit](#hal-config-provider-cloudrun-edit)
- [hal config provider cloudrun enable](#hal-config-provider-cloudrun-enable)
- [hal config provider dcos](#hal-config-provider-dcos)
- [hal config provider dcos account](#hal-config-provider-dcos-account)
- [hal config provider dcos account add](#hal-config-provider-dcos-account-add)
Expand Down Expand Up @@ -9305,6 +9315,242 @@ hal config provider cloudfoundry enable [parameters]

---

## hal config provider cloudrun

The Cloud Run provider is used to deploy resources to any number of Cloud Run applications. To get started with Cloud Run, visit [https://cloud.google.com/run/docs/](https://cloud.google.com/run/docs/). For more information on how to configure individual accounts, please read the documentation under `hal config provider cloudrun account -h`.

#### Usage

```
hal config provider cloudrun [parameters] [subcommands]
```

#### Parameters

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--no-validate`: (_Default_: `false`) Skip validation.

#### Subcommands

- `account`: Manage and view Spinnaker configuration for the cloudrun provider's account
- `disable`: Set the cloudrun provider as disabled
- `edit`: Edit Spinnaker's cloud run configuration.
- `enable`: Set the cloudrun provider as enabled

---

## hal config provider cloudrun account

An account in the Cloud Run provider refers to a single Cloud Run application. Spinnaker assumes that your Cloud Run application already exists. You can create an application in your Google Cloud Platform project by running `gcloud app create --region <region>`.

#### Usage

```
hal config provider cloudrun account ACCOUNT [parameters] [subcommands]
```

#### Parameters

`ACCOUNT`: The name of the account to operate on.

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--no-validate`: (_Default_: `false`) Skip validation.

#### Subcommands

- `add`: Add an account to the cloudrun provider.
- `delete`: Delete a specific cloudrun account by name.
- `edit`: Edit an account in the cloudrun provider.
- `get`: Get the specified account details for the cloudrun provider.
- `list`: List the account names for the cloudrun provider.

---

## hal config provider cloudrun account add

Add an account to the cloudrun provider.

#### Usage

```
hal config provider cloudrun account add ACCOUNT [parameters]
```

#### Parameters

`ACCOUNT`: The name of the account to operate on.

- `--caching-interval-seconds`: The interval in seconds at which Spinnaker will poll for updates in your CloudRun clusters.
- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--environment`: The environment name for the account. Many accounts can share the same environment (e.g. dev, test, prod)
- `--gcloud-release-track`: The gcloud release track (ALPHA, BETA, or STABLE) that Spinnaker will use when deploying to Cloud Run.
- `--json-path`: The path to a JSON service account that Spinnaker will use as credentials. This is only needed if Spinnaker is not deployed on a Google Compute Engine VM, or needs permissions not afforded to the VM it is running on. See [https://cloud.google.com/compute/docs/access/service-accounts](https://cloud.google.com/compute/docs/access/service-accounts) for more information.
- `--local-repository-directory`: (_Default_: `/var/tmp/clouddriver`) A local directory to be used to stage source files for Cloud Run deployments within Spinnaker's Clouddriver microservice.
- `--no-validate`: (_Default_: `false`) Skip validation.
- `--omit-services`: A list of regular expressions. Any service matching one of these regexes will be ignored by Spinnaker.
- `--omit-versions`: A list of regular expressions. Any version matching one of these regexes will be ignored by Spinnaker.
- `--project`: (_Required_) The Google Cloud Platform project this Spinnaker account will manage.
- `--read-permissions`: (_Default_: `[]`) A user must have at least one of these roles in order to view this account's cloud resources.
- `--required-group-membership`: (_Default_: `[]`) A user must be a member of at least one specified group in order to make changes to this account's cloud resources.
- `--services`: A list of regular expressions. Any service matching one of these regexes will be indexed by Spinnaker.
- `--ssh-known-hosts-file-path`: The path to a known_hosts file to be used when connecting with a remote git repository over SSH.
- `--ssh-private-key-file-path`: The path to an SSH private key to be used when connecting with a remote git repository over SSH.
- `--ssh-private-key-passphrase`: (_Sensitive data_ - user will be prompted on standard input) The passphrase to an SSH private key to be used when connecting with a remote git repository over SSH.
- `--ssh-trust-unknown-hosts`: (_Default_: `false`) Enabling this flag will allow Spinnaker to connect with a remote git repository over SSH without verifying the server's IP address against a known_hosts file.
- `--versions`: A list of regular expressions. Any version matching one of these regexes will be indexed by Spinnaker.
- `--write-permissions`: (_Default_: `[]`) A user must have at least one of these roles in order to make changes to this account's cloud resources.

---

## hal config provider cloudrun account delete

Delete a specific cloudrun account by name.

#### Usage

```
hal config provider cloudrun account delete ACCOUNT [parameters]
```

#### Parameters

`ACCOUNT`: The name of the account to operate on.

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--no-validate`: (_Default_: `false`) Skip validation.

---

## hal config provider cloudrun account edit

Edit an account in the cloudrun provider.

#### Usage

```
hal config provider cloudrun account edit ACCOUNT [parameters]
```

#### Parameters

`ACCOUNT`: The name of the account to operate on.

- `--add-read-permission`: Add this permission to the list of read permissions.
- `--add-required-group-membership`: Add this group to the list of required group memberships.
- `--add-write-permission`: Add this permission to the list of write permissions.
- `--caching-interval-seconds`: The interval in seconds at which Spinnaker will poll for updates in your CloudRun clusters.
- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--environment`: The environment name for the account. Many accounts can share the same environment (e.g. dev, test, prod)
- `--gcloud-release-track`: The gcloud release track (ALPHA, BETA, or STABLE) that Spinnaker will use when deploying to Cloud Run.
- `--json-path`: The path to a JSON service account that Spinnaker will use as credentials. This is only needed if Spinnaker is not deployed on a Google Compute Engine VM, or needs permissions not afforded to the VM it is running on. See [https://cloud.google.com/compute/docs/access/service-accounts](https://cloud.google.com/compute/docs/access/service-accounts) for more information.
- `--local-repository-directory`: A local directory to be used to stage source files for Cloud Run deployments within Spinnaker's Clouddriver microservice.
- `--no-validate`: (_Default_: `false`) Skip validation.
- `--omit-services`: A list of regular expressions. Any service matching one of these regexes will be ignored by Spinnaker.
- `--omit-versions`: A list of regular expressions. Any version matching one of these regexes will be ignored by Spinnaker.
- `--project`: The Google Cloud Platform project this Spinnaker account will manage.
- `--read-permissions`: A user must have at least one of these roles in order to view this account's cloud resources.
- `--remove-read-permission`: Remove this permission from the list of read permissions.
- `--remove-required-group-membership`: Remove this group from the list of required group memberships.
- `--remove-write-permission`: Remove this permission to from list of write permissions.
- `--required-group-membership`: A user must be a member of at least one specified group in order to make changes to this account's cloud resources.
- `--services`: A list of regular expressions. Any service matching one of these regexes will be indexed by Spinnaker.
- `--ssh-known-hosts-file-path`: The path to a known_hosts file to be used when connecting with a remote git repository over SSH.
- `--ssh-private-key-file-path`: The path to an SSH private key to be used when connecting with a remote git repository over SSH.
- `--ssh-private-key-passphrase`: (_Sensitive data_ - user will be prompted on standard input) The passphrase to an SSH private key to be used when connecting with a remote git repository over SSH.
- `--ssh-trust-unknown-hosts`: Enabling this flag will allow Spinnaker to connect with a remote git repository over SSH without verifying the server's IP address against a known_hosts file.
- `--versions`: A list of regular expressions. Any version matching one of these regexes will be indexed by Spinnaker.
- `--write-permissions`: A user must have at least one of these roles in order to make changes to this account's cloud resources.

---

## hal config provider cloudrun account get

Get the specified account details for the cloudrun provider.

#### Usage

```
hal config provider cloudrun account get ACCOUNT [parameters]
```

#### Parameters

`ACCOUNT`: The name of the account to operate on.

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--no-validate`: (_Default_: `false`) Skip validation.

---

## hal config provider cloudrun account list

List the account names for the cloudrun provider.

#### Usage

```
hal config provider cloudrun account list [parameters]
```

#### Parameters

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--no-validate`: (_Default_: `false`) Skip validation.

---

## hal config provider cloudrun disable

Set the cloudrun provider as disabled

#### Usage

```
hal config provider cloudrun disable [parameters]
```

#### Parameters

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--no-validate`: (_Default_: `false`) Skip validation.

---

## hal config provider cloudrun edit

Edit Spinnaker's cloud run configuration.

#### Usage

```
hal config provider cloudrun edit [parameters]
```

#### Parameters

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--gcloudPath`: The path to the gcloud executable on the machine running clouddriver.
- `--no-validate`: (_Default_: `false`) Skip validation.

---

## hal config provider cloudrun enable

Set the cloudrun provider as enabled

#### Usage

```
hal config provider cloudrun enable [parameters]
```

#### Parameters

- `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
- `--no-validate`: (_Default_: `false`) Skip validation.

---

## hal config provider dcos

Manage and view Spinnaker configuration for the dcos provider
Expand Down
102 changes: 102 additions & 0 deletions content/en/docs/reference/providers/cloudrun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: "Google Cloud Run"
linkTitle: "Google Cloud Run"
description: Learn how Spinnaker functionality maps to Google Cloud Run.
---

> If you are not familiar with Cloud Run or any of the terms used below, please consult Cloud Run's [reference documentation](https://cloud.google.com/run/docs).

## Resource mapping

### Account
A Spinnaker **account** maps to a single Cloud Run **application**, a top-level resource that contains
services, versions, and instances. Spinnaker authenticates itself with Cloud Run
using service account credentials for a Google Cloud Platform project -
see the [setup guide](/docs/setup/install/providers/cloudrun).

### Load Balancer
A Spinnaker **load balancer** maps to an Cloud Run **service**.

A service has many versions (discussed [below](#server-group)), and a version's `app.yaml` determines the service
it belongs to. If a version's `app.yaml` does not specify the name of a service, it will be deployed to the service named `default`.

Spinnaker cannot create a service, but if a service does not exist when a version is deployed, it will be created automatically.

A service's **traffic split** determines how incoming traffic is allocated between versions.

### Server Group
A Spinnaker **server group** maps to an Cloud Run **version**. An `app.yaml` file (which typically lives alongside your application source code) determines
a version's configuration. If necessary, you can provide Spinnaker with the contents of an `app.yaml`
file when you deploy a version.


### Instance
A Spinnaker **instance** maps to an Cloud Run **instance**.

## Operation mapping

### Deploy

Deploys an Cloud Run version.

At a high level, deploying to Cloud Run using Spinnaker has three steps:

1. You provide Spinnaker with a reference to a git repository, and some information about where your application lives
inside that repository (e.g., branch).
2. Spinnaker clones your repository and finds your application.
3. Spinnaker deploys your application to a new version by executing `gcloud run deploy`.

If your pipeline includes a Deploy stage and has been triggered by a webhook or Jenkins job, you can dynamically resolve the git repository branch that Spinnaker uses to deploy.

### Destroy

Destroys a version.

If a version is serving traffic, it will first be [disabled](#disable).

You cannot destroy a version if it is the only version serving traffic from a service.

### Enable

Sets a version's traffic allocation to 100%.

This operation is provided as a convenience method. If
you would like more fine-grained control over your versions' traffic allocations, see [Edit Load Balancer](#edit-load-balancer).

### Disable

Sets a version's traffic allocation to 0%, and sets the other enabled versions' allocations to their
relative proportions before the disable operation.

This operation is provided as a convenience method, and because it is used implicitly when destroying a version. If you would like more fine-grained control over your versions' traffic allocations, see [Edit Load Balancer](#edit-load-balancer).

You cannot disable a version if it is the only version serving traffic from a service.

### Start

Starts an Cloud Run version - i.e., allows a version to scale according to its scaling policy.

This operation is only available if the version uses manual or basic scaling, or is running in the flexible environment.

### Stop

Stops an Cloud Run version - i.e., scales a version down to zero instances.

This operation is only available if the version uses manual or basic scaling, or is running in the flexible environment.

### Edit Load Balancer

Edits a service's traffic split - i.e., the relative proportion of traffic that each version receives.

If your pipeline includes an Edit Load Balancer stage, you can resolve the targets of a traffic split dynamically.

### Delete Load Balancer

Deletes a service. Deleting a service will also delete all of its versions.

You cannot delete the `default` service. However, you can disable your Cloud Run application from within the
[Google Cloud Console](https://console.cloud.google.com).

### Terminate instance

Deletes an instance.
Loading